From owner-freebsd-current@FreeBSD.ORG Sun Jun 10 00:15:05 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 36659106566C; Sun, 10 Jun 2012 00:15:05 +0000 (UTC) (envelope-from yanegomi@gmail.com) Received: from mail-pz0-f54.google.com (mail-pz0-f54.google.com [209.85.210.54]) by mx1.freebsd.org (Postfix) with ESMTP id E2C1B8FC15; Sun, 10 Jun 2012 00:15:04 +0000 (UTC) Received: by dadv36 with SMTP id v36so4076873dad.13 for ; Sat, 09 Jun 2012 17:15:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=subject:mime-version:content-type:from:in-reply-to:date:cc :message-id:references:to:x-mailer; bh=jOvIXBxUe4aaRUmQiqhSh3aQDwpPV5fNuapkUEwX3Sg=; b=xcjPZAonLBu/pAq7QlNoMxQetFEL2AmoDkNMgJUWGSrebWKdiHYsVObOpAGEb5B9np ObowTrzY6PK5lQQqzmetvq0Wrwwz2UCKDFQo2mCmikDmM1neh0ChnIzomsLiRKCQh99H lTroqMYXZTvXsiBPHacCjkAVLdhJpz4iZnOJAn4eNffVtjfDes5ojevfAMgCgVEsKxA6 Y3jQILpnlLTnTOp7B/Ue0UlF4m09o5l6qeALgzHS1MZEgAxYmwe+9oGPinutzlMTCo7V F5QWC5tqWoq1R4GWiR3cShXsX6IQiHPk8SYARxAvNW/rw5BVafFwv+An9a6b2//oGw6k qBJg== Received: by 10.68.233.102 with SMTP id tv6mr10549926pbc.153.1339287304499; Sat, 09 Jun 2012 17:15:04 -0700 (PDT) Received: from [192.168.20.11] (c-24-19-191-56.hsd1.wa.comcast.net. [24.19.191.56]) by mx.google.com with ESMTPS id tk1sm12967822pbc.8.2012.06.09.17.15.01 (version=TLSv1/SSLv3 cipher=OTHER); Sat, 09 Jun 2012 17:15:03 -0700 (PDT) Mime-Version: 1.0 (Apple Message framework v1278) From: Garrett Cooper In-Reply-To: <201206051010.22321.jhb@freebsd.org> Date: Sat, 9 Jun 2012 17:14:59 -0700 Message-Id: <5C1A97F3-F392-44B5-B197-3E8C68CED7FE@gmail.com> References: <20120526142229.GA3893@tinyCurrent> <201205311134.55258.jhb@freebsd.org> <20120605132750.GA2122@tiny> <201206051010.22321.jhb@freebsd.org> To: John Baldwin X-Mailer: Apple Mail (2.1278) Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: swills@freebsd.org, Matthias Apitz , 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: Sun, 10 Jun 2012 00:15:05 -0000 On Jun 5, 2012, at 7:10 AM, John Baldwin wrote: > 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 = escribi=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_UNLOCK' >>>> 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/... ); >=20 > Sorry, they are if_maddr_rlock() and if_maddr_runlock(). They are in = if_var.h=20 > right below the macro you looked at. :) >=20 > > /* > * 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) >=20 > /* > * Function variations on locking macros intended to be used by = loadable > * kernel modules in order to divorce them from the internals of = address list > * 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 */ > >=20 >> based on the SVN diff of the kernel: >>=20 >>=20 > = http://svnweb.freebsd.org/base/head/sys/net/if_var.h?r1=3D231229&r2=3D2332= 02&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: >=20 > 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. I wish I read this part before I submitted = http://www.freebsd.org/cgi/query-pr.cgi?pr=3D168904 :/. Thanks! -Garrett=