From owner-svn-src-all@FreeBSD.ORG Wed May 6 13:30:46 2009 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 B9ECC106566C; Wed, 6 May 2009 13:30:46 +0000 (UTC) (envelope-from zec@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A750F8FC13; Wed, 6 May 2009 13:30:46 +0000 (UTC) (envelope-from zec@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n46DUkNd018837; Wed, 6 May 2009 13:30:46 GMT (envelope-from zec@svn.freebsd.org) Received: (from zec@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n46DUkv4018835; Wed, 6 May 2009 13:30:46 GMT (envelope-from zec@svn.freebsd.org) Message-Id: <200905061330.n46DUkv4018835@svn.freebsd.org> From: Marko Zec Date: Wed, 6 May 2009 13:30:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r191846 - in head/sys: netinet netinet6 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: Wed, 06 May 2009 13:30:47 -0000 Author: zec Date: Wed May 6 13:30:46 2009 New Revision: 191846 URL: http://svn.freebsd.org/changeset/base/191846 Log: Remove unnecessary CURVNET_SET() calls where curvnet context is (i.e. seems to be) already set. This should reduce console noise due to curvnet recursion reports. This change has no impact on nooptions VIMAGE builds. Approved by: julian (mentor) Modified: head/sys/netinet/igmp.c head/sys/netinet6/mld6.c Modified: head/sys/netinet/igmp.c ============================================================================== --- head/sys/netinet/igmp.c Wed May 6 08:49:39 2009 (r191845) +++ head/sys/netinet/igmp.c Wed May 6 13:30:46 2009 (r191846) @@ -528,9 +528,6 @@ igmp_ra_alloc(void) /* * Attach IGMP when PF_INET is attached to an interface. - * - * VIMAGE: Currently we set the vnet pointer, although it is - * likely that it was already set by our caller. */ struct igmp_ifinfo * igmp_domifattach(struct ifnet *ifp) @@ -540,7 +537,6 @@ igmp_domifattach(struct ifnet *ifp) CTR3(KTR_IGMPV3, "%s: called for ifp %p(%s)", __func__, ifp, ifp->if_xname); - CURVNET_SET(ifp->if_vnet); IGMP_LOCK(); igi = igi_alloc_locked(ifp); @@ -548,7 +544,6 @@ igmp_domifattach(struct ifnet *ifp) igi->igi_flags |= IGIF_SILENT; IGMP_UNLOCK(); - CURVNET_RESTORE(); return (igi); } @@ -600,9 +595,6 @@ out: * * SMPNG: igmp_ifdetach() needs to take IF_ADDR_LOCK(). * XXX This is also bitten by unlocked ifma_protospec access. - * - * VIMAGE: curvnet should have been set by caller, but let's not assume - * that for now. */ void igmp_ifdetach(struct ifnet *ifp) @@ -614,8 +606,6 @@ igmp_ifdetach(struct ifnet *ifp) CTR3(KTR_IGMPV3, "%s: called for ifp %p(%s)", __func__, ifp, ifp->if_xname); - CURVNET_SET(ifp->if_vnet); - IGMP_LOCK(); igi = ((struct in_ifinfo *)ifp->if_afdata[AF_INET])->ii_igmp; @@ -648,15 +638,10 @@ igmp_ifdetach(struct ifnet *ifp) } IGMP_UNLOCK(); - - CURVNET_RESTORE(); } /* * Hook for domifdetach. - * - * VIMAGE: curvnet should have been set by caller, but let's not assume - * that for now. */ void igmp_domifdetach(struct ifnet *ifp) @@ -666,14 +651,12 @@ igmp_domifdetach(struct ifnet *ifp) CTR3(KTR_IGMPV3, "%s: called for ifp %p(%s)", __func__, ifp, ifp->if_xname); - CURVNET_SET(ifp->if_vnet); IGMP_LOCK(); igi = ((struct in_ifinfo *)ifp->if_afdata[AF_INET])->ii_igmp; igi_delete_locked(ifp); IGMP_UNLOCK(); - CURVNET_RESTORE(); } static void Modified: head/sys/netinet6/mld6.c ============================================================================== --- head/sys/netinet6/mld6.c Wed May 6 08:49:39 2009 (r191845) +++ head/sys/netinet6/mld6.c Wed May 6 13:30:46 2009 (r191846) @@ -292,12 +292,10 @@ static __inline uint32_t mld_restore_context(struct mbuf *m) { -#ifdef notyet #if defined(VIMAGE) && defined(INVARIANTS) - KASSERT(curvnet == (m->m_pkthdr.header), + KASSERT(curvnet == m->m_pkthdr.header, ("%s: called when curvnet was not restored", __func__)); #endif -#endif return (m->m_pkthdr.flowid); } @@ -455,8 +453,6 @@ mld_is_addr_reported(const struct in6_ad * Attach MLD when PF_INET6 is attached to an interface. * * SMPng: Normally called with IF_AFDATA_LOCK held. - * VIMAGE: Currently we set the vnet pointer, although it is - * likely that it was already set by our caller. */ struct mld_ifinfo * mld_domifattach(struct ifnet *ifp) @@ -466,7 +462,6 @@ mld_domifattach(struct ifnet *ifp) CTR3(KTR_MLD, "%s: called for ifp %p(%s)", __func__, ifp, ifp->if_xname); - CURVNET_SET(ifp->if_vnet); MLD_LOCK(); mli = mli_alloc_locked(ifp); @@ -474,7 +469,6 @@ mld_domifattach(struct ifnet *ifp) mli->mli_flags |= MLIF_SILENT; MLD_UNLOCK(); - CURVNET_RESTORE(); return (mli); } @@ -528,9 +522,6 @@ out: * SMPng: Caller must hold IN6_MULTI_LOCK(). * Must take IF_ADDR_LOCK() to cover if_multiaddrs iterator. * XXX This routine is also bitten by unlocked ifma_protospec access. - * - * VIMAGE: curvnet should have been set by caller, but let's not assume - * that for now. */ void mld_ifdetach(struct ifnet *ifp) @@ -542,8 +533,6 @@ mld_ifdetach(struct ifnet *ifp) CTR3(KTR_MLD, "%s: called for ifp %p(%s)", __func__, ifp, ifp->if_xname); - CURVNET_SET(ifp->if_vnet); - IN6_MULTI_LOCK_ASSERT(); MLD_LOCK(); @@ -570,7 +559,6 @@ mld_ifdetach(struct ifnet *ifp) } MLD_UNLOCK(); - CURVNET_RESTORE(); } /* @@ -578,8 +566,6 @@ mld_ifdetach(struct ifnet *ifp) * Runs after link-layer cleanup; free MLD state. * * SMPng: Normally called with IF_AFDATA_LOCK held. - * VIMAGE: curvnet should have been set by caller, but let's not assume - * that for now. */ void mld_domifdetach(struct ifnet *ifp) @@ -588,13 +574,9 @@ mld_domifdetach(struct ifnet *ifp) CTR3(KTR_MLD, "%s: called for ifp %p(%s)", __func__, ifp, ifp->if_xname); - CURVNET_SET(ifp->if_vnet); - MLD_LOCK(); mli_delete_locked(ifp); MLD_UNLOCK(); - - CURVNET_RESTORE(); } static void