From owner-freebsd-current@FreeBSD.ORG Tue Jun 5 15:02:19 2012 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3E1441065670; Tue, 5 Jun 2012 15:02:19 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigknife-pt.tunnel.tserv9.chi1.ipv6.he.net [IPv6:2001:470:1f10:75::2]) by mx1.freebsd.org (Postfix) with ESMTP id 133838FC0C; Tue, 5 Jun 2012 15:02:19 +0000 (UTC) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 6D266B9AB; Tue, 5 Jun 2012 11:02:18 -0400 (EDT) From: John Baldwin To: Matthias Apitz Date: Tue, 5 Jun 2012 10:10:22 -0400 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p13; KDE/4.5.5; amd64; ; ) References: <20120526142229.GA3893@tinyCurrent> <201205311134.55258.jhb@freebsd.org> <20120605132750.GA2122@tiny> In-Reply-To: <20120605132750.GA2122@tiny> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Message-Id: <201206051010.22321.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Tue, 05 Jun 2012 11:02:18 -0400 (EDT) Cc: swills@freebsd.org, freebsd-current@freebsd.org Subject: Re: 10-CURRENT r235646 && open-vm-tools-8.6.0-425873 X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jun 2012 15:02:19 -0000 On Tuesday, June 05, 2012 9:27:51 am Matthias Apitz wrote: > El d=EDa Thursday, May 31, 2012 a las 11:34:55AM -0400, John Baldwin escr= ibi=F3: >=20 > > > cc1: warnings being treated as errors > > > if_vxn.c: In function 'vxn_load_multicast': > > > if_vxn.c:719: warning: implicit declaration of function 'IF_ADDR_LOCK' > > > if_vxn.c:719: warning: nested extern declaration of 'IF_ADDR_LOCK' > > > [-Wnested-ext erns] > > > if_vxn.c:746: warning: implicit declaration of function 'IF_ADDR_UNLO= CK' > > > if_vxn.c:746: warning: nested extern declaration of 'IF_ADDR_UNLOCK' > > > [-Wnested-e xterns] > > > *** [if_vxn.o] Error code 1 > > >=20 >=20 > > It should be using if_mcast_rlock() and if_mcast_runlock() instead of=20 using=20 > > those macros directly. This works all the way back to 8.0. > >=20 >=20 > Thanks for your patch proposal; but using this it can't find the > if_mcast_rlock() and if_mcast_runlock() functions declaration (and I > don't see them in /usr/src/... ); Sorry, they are if_maddr_rlock() and if_maddr_runlock(). They are in if_va= r.h=20 right below the macro you looked at. :) /* * Locks for address lists on the network interface. */ #define IF_ADDR_LOCK_INIT(if) rw_init(&(if)->if_addr_lock, "if_addr_lock") #define IF_ADDR_LOCK_DESTROY(if) rw_destroy(&(if)->if_addr_lock) #define IF_ADDR_WLOCK(if) rw_wlock(&(if)->if_addr_lock) #define IF_ADDR_WUNLOCK(if) rw_wunlock(&(if)->if_addr_lock) #define IF_ADDR_RLOCK(if) rw_rlock(&(if)->if_addr_lock) #define IF_ADDR_RUNLOCK(if) rw_runlock(&(if)->if_addr_lock) #define IF_ADDR_LOCK_ASSERT(if) rw_assert(&(if)->if_addr_lock, RA_LOCKED) #define IF_ADDR_WLOCK_ASSERT(if) rw_assert(&(if)->if_addr_lock, RA_WLOCKED) /* * Function variations on locking macros intended to be used by loadable * kernel modules in order to divorce them from the internals of address li= st * locking. */ void if_addr_rlock(struct ifnet *ifp); /* if_addrhead */ void if_addr_runlock(struct ifnet *ifp); /* if_addrhead */ void if_maddr_rlock(struct ifnet *ifp); /* if_multiaddrs */ void if_maddr_runlock(struct ifnet *ifp); /* if_multiaddrs */ > based on the SVN diff of the kernel: >=20 >=20 http://svnweb.freebsd.org/base/head/sys/net/if_var.h?r1=3D231229&r2=3D23320= 2&pathrev=3D233202 >=20 > I came up with another proposal: >=20 > *** modules/freebsd/vmxnet/net_compat.h.orig Wed Sep 21 20:25:15 2011 > --- modules/freebsd/vmxnet/net_compat.h Tue Jun 5 15:13:55 2012 > *************** > *** 170,178 **** > #if __FreeBSD_version < 505000 > # define VXN_IF_ADDR_LOCK(_ifp) > # define VXN_IF_ADDR_UNLOCK(_ifp) > #else > ! # define VXN_IF_ADDR_LOCK(_ifp) IF_ADDR_LOCK((_ifp)) > ! # define VXN_IF_ADDR_UNLOCK(_ifp) IF_ADDR_UNLOCK((_ifp)) > #endif >=20 > #endif /* _VXN_NET_COMPAT_H_ */ > --- 170,181 ---- > #if __FreeBSD_version < 505000 > # define VXN_IF_ADDR_LOCK(_ifp) > # define VXN_IF_ADDR_UNLOCK(_ifp) > + #elif __FreeBSD_version < 800000 > + # define VXN_IF_ADDR_LOCK(_ifp) IF_ADDR_LOCK((_ifp)) > + # define VXN_IF_ADDR_UNLOCK(_ifp) IF_ADDR_UNLOCK((_ifp)) > #else > ! # define VXN_IF_ADDR_LOCK(_ifp) IF_ADDR_WLOCK((_ifp)) > ! # define VXN_IF_ADDR_UNLOCK(_ifp) IF_ADDR_WUNLOCK((_ifp)) > #endif >=20 > #endif /* _VXN_NET_COMPAT_H_ */ >=20 > and using this it compiles fine; but later on it has another problem: No, we do not wish to expose those to drivers as we do not want the locks part of the ABI. Plus, you should be using read-locks for this anyway. =2D-=20 John Baldwin