From owner-freebsd-net@FreeBSD.ORG Fri Dec 6 16:26:04 2013 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C7AD37A7; Fri, 6 Dec 2013 16:26:04 +0000 (UTC) Received: from aslan.scsiguy.com (mail.scsiguy.com [70.89.174.89]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 9BEC31B52; Fri, 6 Dec 2013 16:26:04 +0000 (UTC) Received: from raycaruso-lt.sldomain.com (207-225-98-3.dia.static.qwest.net [207.225.98.3]) (authenticated bits=0) by aslan.scsiguy.com (8.14.7/8.14.5) with ESMTP id rB6GPsHg047332 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO); Fri, 6 Dec 2013 09:25:57 -0700 (MST) (envelope-from gibbs@scsiguy.com) Mime-Version: 1.0 (Mac OS X Mail 7.0 \(1822\)) Subject: Re: Defaults for if_capenable and detecting user initiated changes From: "Justin T. Gibbs" In-Reply-To: <201312031213.41677.jhb@freebsd.org> Date: Fri, 6 Dec 2013 09:25:48 -0700 Message-Id: <526A243B-7B66-45BD-9B45-3BFB04F1E16D@scsiguy.com> References: <0E13D481-9D6D-4B52-A5AD-B671BF3A85AF@scsiguy.com> <201312031213.41677.jhb@freebsd.org> To: John Baldwin X-Mailer: Apple Mail (2.1822) X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.4.3 (aslan.scsiguy.com [70.89.174.89]); Fri, 06 Dec 2013 09:25:58 -0700 (MST) Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.17 Cc: freebsd-net@freebsd.org, =?iso-8859-1?Q?Roger_Pau_Monn=E9?= , net@freebsd.org X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Dec 2013 16:26:04 -0000 On Dec 3, 2013, at 10:13 AM, John Baldwin wrote: > On Wednesday, November 27, 2013 12:59:08 pm Justin T. Gibbs wrote: >> Hi net, >>=20 >> I=92m reviewing a patch from Roger Pau Monn=E9 for the Xen netfront = driver. The=20 > goal of the change is to avoid disturbing the user=92s settings for = the=20 > interface just because the backend device has changed or the = connection to the=20 > backend was reset. I=92ve 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. = Unfortunately,=20 > I don=92t think the if_capenable and if_capabilities fields are = descriptive=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 an=20 > =93auto/default=94 setting in addition to on or off. This would allow = the user to=20 > explicitly disable a capability if needed, but generally allow the = system to=20 > chose the most optimal settings when they are supported. Would this = be=20 > difficult to add? >=20 > 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: >=20 > sc->capforced |=3D (oldcapenable ^ newcapenable) >=20 > 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). >=20 > --=20 > John Baldwin Certainly this could be done in the Xen driver. The reason I posted my = question, however, was to ask whether this should be more generically = tracked by the if layer instead of handled by the underlying driver. = Lots of user interfaces support a =93restore defaults=94 capability = (e.g. for the novice administrator who screws up, or as a step in = writing a script/procedure that starts by getting to a known state), so = I think this is interesting for more than this particular Xen issue. =97 Justin