Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 3 Dec 2013 12:13:41 -0500
From:      John Baldwin <jhb@freebsd.org>
To:        freebsd-net@freebsd.org
Cc:        "Justin T. Gibbs" <gibbs@scsiguy.com>, Roger Pau =?utf-8?q?Monn=C3=A9?= <royger@freebsd.org>, net@freebsd.org
Subject:   Re: Defaults for if_capenable and detecting user initiated changes
Message-ID:  <201312031213.41677.jhb@freebsd.org>
In-Reply-To: <0E13D481-9D6D-4B52-A5AD-B671BF3A85AF@scsiguy.com>
References:  <0E13D481-9D6D-4B52-A5AD-B671BF3A85AF@scsiguy.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Wednesday, November 27, 2013 12:59:08 pm Justin T. Gibbs wrote:
> Hi net,
>=20
> I=E2=80=99m reviewing a patch from Roger Pau Monn=C3=A9 for the Xen netfr=
ont driver.  The=20
goal of the change is to avoid disturbing the user=E2=80=99s settings for t=
he=20
interface just because the backend device has changed or the connection to =
the=20
backend was reset.  I=E2=80=99ve attached the latest version of the patch.
>=20
> The current patch leaves the interface settings alone if they can be=20
supported by the newly attached backend.  What would be ideal is to enable=
=20
capabilities that default to being enabled if they were not explicitly=20
disabled by the user and can be supported by the new backend.  Unfortunatel=
y,=20
I don=E2=80=99t think the if_capenable and if_capabilities fields are descr=
iptive=20
enough to deal with an interface whose capabilities can change at runtime. =
=20
Just as can be done with link speed, some of these settings need to allow a=
n=20
=E2=80=9Cauto/default=E2=80=9D setting in addition to on or off.  This woul=
d allow the user to=20
explicitly disable a capability if needed, but generally allow the system t=
o=20
chose the most optimal settings when they are supported.  Would this be=20
difficult to add?

Couldn't you maintain this state in the Xen netfront driver's softc?
You already get the ioctls that track changes to the capenable field,
so you when a change explicitly disables a capability you can set that
in a 'forced off' or 'forced on' field.  Perhaps more of a 'forced'
field that you just update by doing:

	sc->capforced |=3D (oldcapenable ^ newcapenable)

However, it's not clear to me if you can get the underlying adapters
initial capenable list.  If so, I think capforced should be all you
need to handle this (though it might be easier if you have separate
forcedon and forcedoff fields).

=2D-=20
John Baldwin



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201312031213.41677.jhb>