Date: Wed, 17 Dec 2008 00:14:28 +0000 (UTC) From: Kip Macy <kmacy@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r186200 - head/sys/netinet Message-ID: <200812170014.mBH0ES9I051450@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
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,
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200812170014.mBH0ES9I051450>