From owner-svn-src-all@FreeBSD.ORG Fri Dec 9 23:26:38 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0618D1065777; Fri, 9 Dec 2011 23:26:35 +0000 (UTC) (envelope-from brooks@lor.one-eyed-alien.net) Received: from lor.one-eyed-alien.net (lor.one-eyed-alien.net [69.66.77.232]) by mx1.freebsd.org (Postfix) with ESMTP id E72DE8FC0A; Fri, 9 Dec 2011 23:26:31 +0000 (UTC) Received: from lor.one-eyed-alien.net (localhost [127.0.0.1]) by lor.one-eyed-alien.net (8.14.4/8.14.4) with ESMTP id pB9NPON1068789; Fri, 9 Dec 2011 17:25:24 -0600 (CST) (envelope-from brooks@lor.one-eyed-alien.net) Received: (from brooks@localhost) by lor.one-eyed-alien.net (8.14.4/8.14.4/Submit) id pB9NPO8H068788; Fri, 9 Dec 2011 17:25:24 -0600 (CST) (envelope-from brooks) Date: Fri, 9 Dec 2011 17:25:24 -0600 From: Brooks Davis To: Ben Laurie Message-ID: <20111209232524.GD60242@lor.one-eyed-alien.net> References: <201111112257.pABMvqjl012442@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="u65IjBhB3TIa72Vp" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r227459 - in head/sys: dev/lmc net netgraph netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Dec 2011 23:26:38 -0000 --u65IjBhB3TIa72Vp Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, Nov 12, 2011 at 04:33:36PM -0800, Ben Laurie wrote: > On Fri, Nov 11, 2011 at 2:57 PM, Brooks Davis wrote: > > Author: brooks > > Date: Fri Nov 11 22:57:52 2011 > > New Revision: 227459 > > URL: http://svn.freebsd.org/changeset/base/227459 > > > > Log: > > ?In r191367 the need for if_free_type() was removed and a new member > > ?if_alloctype was used to store the origional interface type. ?Take > > ?advantage of this change by removing all existing uses of if_free_type= () > > ?in favor of if_free(). >=20 > Just an observation: this change removes an annotation that could be > useful for correctness checking. Do we care? Oops, I meant to respond to this earlier. I think in this case it's not a significant loss because we're only losing this annotation in 7 of the approximately 200 locations we free an interface. A better overall solution to this correctness issue would be a mechanism to assert that assignments to ifp->if_alloctype only occur if_alloc() and that similarly ifp->if_l2com isn't changed outside if_alloc/if_free(). -- Brooks >=20 > > > > ?MFC after: ? ?1 Month > > > > Modified: > > ?head/sys/dev/lmc/if_lmc.c > > ?head/sys/net/if_bridge.c > > ?head/sys/net/if_lagg.c > > ?head/sys/net/if_tap.c > > ?head/sys/net/if_vlan.c > > ?head/sys/netgraph/ng_fec.c > > ?head/sys/netinet/ip_carp.c > > > > Modified: head/sys/dev/lmc/if_lmc.c > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D > > --- head/sys/dev/lmc/if_lmc.c ? Fri Nov 11 22:27:09 2011 ? ? ? ?(r22745= 8) > > +++ head/sys/dev/lmc/if_lmc.c ? Fri Nov 11 22:57:52 2011 ? ? ? ?(r22745= 9) > > @@ -4945,7 +4945,9 @@ lmc_ifnet_detach(softc_t *sc) > > ? /* Detach from the ifnet kernel interface. */ > > ? if_detach(sc->ifp); > > > > -# if (__FreeBSD_version >=3D 600000) > > +# if (defined(__FreeBSD__) && __FreeBSD_version >=3D 800082) > > + ?if_free(sc->ifp); > > +# elif (defined(__FreeBSD__) && __FreeBSD_version >=3D 600000) > > ? if_free_type(sc->ifp, NSPPP ? IFT_PPP : IFT_OTHER); > > ?# endif > > ? } > > > > Modified: head/sys/net/if_bridge.c > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D > > --- head/sys/net/if_bridge.c ? ?Fri Nov 11 22:27:09 2011 ? ? ? ?(r22745= 8) > > +++ head/sys/net/if_bridge.c ? ?Fri Nov 11 22:57:52 2011 ? ? ? ?(r22745= 9) > > @@ -676,7 +676,7 @@ bridge_clone_destroy(struct ifnet *ifp) > > > > ? ? ? ?bstp_detach(&sc->sc_stp); > > ? ? ? ?ether_ifdetach(ifp); > > - ? ? ? if_free_type(ifp, IFT_ETHER); > > + ? ? ? if_free(ifp); > > > > ? ? ? ?/* Tear down the routing table. */ > > ? ? ? ?bridge_rtable_fini(sc); > > > > Modified: head/sys/net/if_lagg.c > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D > > --- head/sys/net/if_lagg.c ? ? ?Fri Nov 11 22:27:09 2011 ? ? ? ?(r22745= 8) > > +++ head/sys/net/if_lagg.c ? ? ?Fri Nov 11 22:57:52 2011 ? ? ? ?(r22745= 9) > > @@ -275,7 +275,7 @@ lagg_clone_create(struct if_clone *ifc, > > ? ? ? ? ? ? ? ?if (lagg_protos[i].ti_proto =3D=3D LAGG_PROTO_DEFAULT) { > > ? ? ? ? ? ? ? ? ? ? ? ?sc->sc_proto =3D lagg_protos[i].ti_proto; > > ? ? ? ? ? ? ? ? ? ? ? ?if ((error =3D lagg_protos[i].ti_attach(sc)) != =3D 0) { > > - ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? if_free_type(ifp, IFT_ETHER); > > + ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? if_free(ifp); > > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?free(sc, M_DEVBUF); > > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?return (error); > > ? ? ? ? ? ? ? ? ? ? ? ?} > > @@ -293,7 +293,6 @@ lagg_clone_create(struct if_clone *ifc, > > ? ? ? ?ifmedia_set(&sc->sc_media, IFM_ETHER | IFM_AUTO); > > > > ? ? ? ?if_initname(ifp, ifc->ifc_name, unit); > > - ? ? ? ifp->if_type =3D IFT_ETHER; > > ? ? ? ?ifp->if_softc =3D sc; > > ? ? ? ?ifp->if_start =3D lagg_start; > > ? ? ? ?ifp->if_init =3D lagg_init; > > @@ -305,7 +304,7 @@ lagg_clone_create(struct if_clone *ifc, > > ? ? ? ?IFQ_SET_READY(&ifp->if_snd); > > > > ? ? ? ?/* > > - ? ? ? ?* Attach as an ordinary ethernet device, childs will be attach= ed > > + ? ? ? ?* Attach as an ordinary ethernet device, children will be atta= ched > > ? ? ? ? * as special device IFT_IEEE8023ADLAG. > > ? ? ? ? */ > > ? ? ? ?ether_ifattach(ifp, eaddr); > > @@ -352,7 +351,7 @@ lagg_clone_destroy(struct ifnet *ifp) > > > > ? ? ? ?ifmedia_removeall(&sc->sc_media); > > ? ? ? ?ether_ifdetach(ifp); > > - ? ? ? if_free_type(ifp, IFT_ETHER); > > + ? ? ? if_free(ifp); > > > > ? ? ? ?mtx_lock(&lagg_list_mtx); > > ? ? ? ?SLIST_REMOVE(&lagg_list, sc, lagg_softc, sc_entries); > > > > Modified: head/sys/net/if_tap.c > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D > > --- head/sys/net/if_tap.c ? ? ? Fri Nov 11 22:27:09 2011 ? ? ? ?(r22745= 8) > > +++ head/sys/net/if_tap.c ? ? ? Fri Nov 11 22:57:52 2011 ? ? ? ?(r22745= 9) > > @@ -218,7 +218,7 @@ tap_destroy(struct tap_softc *tp) > > ? ? ? ?knlist_destroy(&tp->tap_rsel.si_note); > > ? ? ? ?destroy_dev(tp->tap_dev); > > ? ? ? ?ether_ifdetach(ifp); > > - ? ? ? if_free_type(ifp, IFT_ETHER); > > + ? ? ? if_free(ifp); > > > > ? ? ? ?mtx_destroy(&tp->tap_mtx); > > ? ? ? ?free(tp, M_TAP); > > > > Modified: head/sys/net/if_vlan.c > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D > > --- head/sys/net/if_vlan.c ? ? ?Fri Nov 11 22:27:09 2011 ? ? ? ?(r22745= 8) > > +++ head/sys/net/if_vlan.c ? ? ?Fri Nov 11 22:57:52 2011 ? ? ? ?(r22745= 9) > > @@ -967,7 +967,7 @@ vlan_clone_create(struct if_clone *ifc, > > ? ? ? ? ? ? ? ? ? ? ? ? */ > > ? ? ? ? ? ? ? ? ? ? ? ?ether_ifdetach(ifp); > > ? ? ? ? ? ? ? ? ? ? ? ?vlan_unconfig(ifp); > > - ? ? ? ? ? ? ? ? ? ? ? if_free_type(ifp, IFT_ETHER); > > + ? ? ? ? ? ? ? ? ? ? ? if_free(ifp); > > ? ? ? ? ? ? ? ? ? ? ? ?ifc_free_unit(ifc, unit); > > ? ? ? ? ? ? ? ? ? ? ? ?free(ifv, M_VLAN); > > > > @@ -989,7 +989,7 @@ vlan_clone_destroy(struct if_clone *ifc, > > > > ? ? ? ?ether_ifdetach(ifp); ? ?/* first, remove it from system-wide lis= ts */ > > ? ? ? ?vlan_unconfig(ifp); ? ? /* now it can be unconfigured and freed = */ > > - ? ? ? if_free_type(ifp, IFT_ETHER); > > + ? ? ? if_free(ifp); > > ? ? ? ?free(ifv, M_VLAN); > > ? ? ? ?ifc_free_unit(ifc, unit); > > > > > > Modified: head/sys/netgraph/ng_fec.c > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D > > --- head/sys/netgraph/ng_fec.c ?Fri Nov 11 22:27:09 2011 ? ? ? ?(r22745= 8) > > +++ head/sys/netgraph/ng_fec.c ?Fri Nov 11 22:57:52 2011 ? ? ? ?(r22745= 9) > > @@ -1332,7 +1332,7 @@ ng_fec_shutdown(node_p node) > > ? ? ? ?} > > > > ? ? ? ?ether_ifdetach(priv->ifp); > > - ? ? ? if_free_type(priv->ifp, IFT_ETHER); > > + ? ? ? if_free(priv->ifp); > > ? ? ? ?ifmedia_removeall(&priv->ifmedia); > > ? ? ? ?ng_fec_free_unit(priv->unit); > > ? ? ? ?free(priv, M_NETGRAPH); > > > > Modified: head/sys/netinet/ip_carp.c > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D > > --- head/sys/netinet/ip_carp.c ?Fri Nov 11 22:27:09 2011 ? ? ? ?(r22745= 8) > > +++ head/sys/netinet/ip_carp.c ?Fri Nov 11 22:57:52 2011 ? ? ? ?(r22745= 9) > > @@ -472,7 +472,7 @@ carp_clone_destroy(struct ifnet *ifp) > > ? ? ? ?mtx_unlock(&carp_mtx); > > ? ? ? ?bpfdetach(ifp); > > ? ? ? ?if_detach(ifp); > > - ? ? ? if_free_type(ifp, IFT_ETHER); > > + ? ? ? if_free(ifp); > > ?#ifdef INET > > ? ? ? ?free(sc->sc_imo.imo_membership, M_CARP); > > ?#endif > > >=20 --u65IjBhB3TIa72Vp Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (FreeBSD) iD8DBQFO4pjjXY6L6fI4GtQRAgRhAKDDJ9KWqyWecmxR0FDnV4eNBGtjIACgsyaz +oWaHZHi/lAct3txgpia95Q= =t61w -----END PGP SIGNATURE----- --u65IjBhB3TIa72Vp--