From owner-svn-src-head@FreeBSD.ORG Wed Dec 17 00:14:28 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 76C6F1065675; Wed, 17 Dec 2008 00:14:28 +0000 (UTC) (envelope-from kmacy@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 625B68FC12; Wed, 17 Dec 2008 00:14:28 +0000 (UTC) (envelope-from kmacy@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 mBH0ES48051451; Wed, 17 Dec 2008 00:14:28 GMT (envelope-from kmacy@svn.freebsd.org) Received: (from kmacy@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBH0ES9I051450; Wed, 17 Dec 2008 00:14:28 GMT (envelope-from kmacy@svn.freebsd.org) Message-Id: <200812170014.mBH0ES9I051450@svn.freebsd.org> From: Kip Macy Date: Wed, 17 Dec 2008 00:14:28 +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: r186200 - head/sys/netinet X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Dec 2008 00:14:28 -0000 Author: kmacy Date: Wed Dec 17 00:14:28 2008 New Revision: 186200 URL: http://svn.freebsd.org/changeset/base/186200 Log: default to doing lla_lookup with shared afdata lock and returning a shared lock on the lle - thus restoring parallel performance to pre-arpv2 level Modified: head/sys/netinet/if_ether.c Modified: head/sys/netinet/if_ether.c ============================================================================== --- head/sys/netinet/if_ether.c Wed Dec 17 00:11:56 2008 (r186199) +++ head/sys/netinet/if_ether.c Wed Dec 17 00:14:28 2008 (r186200) @@ -251,7 +251,7 @@ arpresolve(struct ifnet *ifp, struct rte { INIT_VNET_INET(ifp->if_vnet); struct llentry *la = 0; - u_int flags; + u_int flags = 0; int error, renew; *lle = NULL; @@ -268,18 +268,19 @@ arpresolve(struct ifnet *ifp, struct rte return (0); } } - - flags = (ifp->if_flags & (IFF_NOARP | IFF_STATICARP)) ? 0 : LLE_CREATE; - /* XXXXX - * Since this function returns an llentry, the - * lock is held by the caller. - * XXX if caller is required to hold lock, assert it */ retry: - IF_AFDATA_LOCK(ifp); + IF_AFDATA_RLOCK(ifp); la = lla_lookup(LLTABLE(ifp), flags, dst); - IF_AFDATA_UNLOCK(ifp); + IF_AFDATA_RUNLOCK(ifp); + if ((la == NULL) && ((flags & LLE_EXCLUSIVE) == 0) + && ((ifp->if_flags & (IFF_NOARP | IFF_STATICARP)) == 0)) { + flags |= (LLE_CREATE | LLE_EXCLUSIVE); + IF_AFDATA_WLOCK(ifp); + la = lla_lookup(LLTABLE(ifp), flags, dst); + IF_AFDATA_WUNLOCK(ifp); + } if (la == NULL) { if (flags & LLE_CREATE) log(LOG_DEBUG,