From owner-freebsd-arch@FreeBSD.ORG Tue Jun 13 05:04:19 2006 Return-Path: X-Original-To: freebsd-arch@freebsd.org Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 12F4C16A418 for ; Tue, 13 Jun 2006 05:04:19 +0000 (UTC) (envelope-from brdavis@odin.ac.hmc.edu) Received: from odin.ac.hmc.edu (Odin.AC.HMC.Edu [134.173.32.75]) by mx1.FreeBSD.org (Postfix) with ESMTP id BAAE143D49 for ; Tue, 13 Jun 2006 05:04:18 +0000 (GMT) (envelope-from brdavis@odin.ac.hmc.edu) Received: from odin.ac.hmc.edu (localhost.localdomain [127.0.0.1]) by odin.ac.hmc.edu (8.13.0/8.13.0) with ESMTP id k5D53JtQ003990; Mon, 12 Jun 2006 22:03:19 -0700 Received: (from brdavis@localhost) by odin.ac.hmc.edu (8.13.0/8.13.0/Submit) id k5D53J6T003989; Mon, 12 Jun 2006 22:03:19 -0700 Date: Mon, 12 Jun 2006 22:03:19 -0700 From: Brooks Davis To: Xin LI Message-ID: <20060613050319.GA9290@odin.ac.hmc.edu> References: <1150166974.936.6.camel@spirit> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="h31gzZEtNLTqOjlF" Content-Disposition: inline In-Reply-To: <1150166974.936.6.camel@spirit> User-Agent: Mutt/1.4.1i X-Virus-Scanned: by amavisd-new Cc: freebsd-arch@freebsd.org Subject: Re: Why do we do if_init for AF_INET even if the interface is running? X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Jun 2006 05:04:19 -0000 --h31gzZEtNLTqOjlF Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Jun 13, 2006 at 10:49:34AM +0800, Xin LI wrote: > Hi, >=20 > Is there any reason why we do if_init() for AF_INET regardless whether > the interface is already in IF_DRV_RUNNING? This seems to cause the > interface to reinitialize its link level state, which causes the network > to stop for a short while. >=20 > The proposed patch is inspired from NetBSD net/if_ethersubr.c,v 1.86 > which says: >=20 > "When setting an address on an interface, for address families which > do not require changing the link-level address, only (*if_init)() > if the interface is not already RUNNING." >=20 > I think we may want this as well. >=20 > Comments? As Sam says, there are hardware filters that need to be initialized. My feeling is that you're correct that doing so via if_init is a bug since that's way too big a hammer, but there are too many edge cases for it to be possible to have a flag day. If we want to move to more selective updating, the way to do it is probably some sort of flag similar to IFF_NEEDSGIANT that tell the interface subsystem to keep the old behavior and otherwise pass the change down to the driver to decide what it needs to do. That way we could make the change over time and eventually deprecate and then remove the flag. -- Brooks --=20 Any statement of the form "X is the one, true Y" is FALSE. PGP fingerprint 655D 519C 26A7 82E7 2529 9BF0 5D8E 8BE9 F238 1AD4 --h31gzZEtNLTqOjlF Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.1 (GNU/Linux) iD8DBQFEjkcWXY6L6fI4GtQRAng2AJ4lyQZVFvQCIy0TzqWjceAj/6IgJwCfU3FX xcKaRkDtttpc15rfBZWdWkk= =pAfW -----END PGP SIGNATURE----- --h31gzZEtNLTqOjlF--