Date: Mon, 01 Jun 2009 10:01:17 -0700 From: Julian Elischer <julian@elischer.org> To: Robert Watson <rwatson@FreeBSD.org> Cc: svn-src-projects@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r193212 - projects/pnet/sys/net Message-ID: <4A24095D.1020209@elischer.org> In-Reply-To: <200906010903.n5193tai070679@svn.freebsd.org> References: <200906010903.n5193tai070679@svn.freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
Robert Watson wrote: > Author: rwatson > Date: Mon Jun 1 09:03:55 2009 > New Revision: 193212 > URL: http://svn.freebsd.org/changeset/base/193212 > > Log: > Add missing VNET setup in the deferred dispatch case. "oooh" goody > > Lock around stats updates in forced direct dispatch mode. > > Modified: > projects/pnet/sys/net/netisr.c > > Modified: projects/pnet/sys/net/netisr.c > ============================================================================== > --- projects/pnet/sys/net/netisr.c Mon Jun 1 08:50:56 2009 (r193211) > +++ projects/pnet/sys/net/netisr.c Mon Jun 1 09:03:55 2009 (r193212) > @@ -77,6 +77,7 @@ __FBSDID("$FreeBSD$"); > #include <sys/socket.h> > #include <sys/sysctl.h> > #include <sys/systm.h> > +#include <sys/vimage.h> > > #ifdef DDB > #include <ddb/ddb.h> > @@ -697,7 +698,10 @@ netisr_process_workstream_proto(struct n > if (local_npw.nw_head == NULL) > local_npw.nw_tail = NULL; > local_npw.nw_len--; > + VNET_ASSERT(m->m_pkthdr.rcvif != NULL); > + CURVNET_SET(m->m_pkthdr.rcvif->if_vnet); > np[proto].np_handler(m); > + CURVNET_RESTORE(); > } > KASSERT(local_npw.nw_len == 0, > ("%s(%u): len %u", __func__, proto, local_npw.nw_len)); > @@ -882,13 +886,17 @@ netisr_dispatch_src(u_int proto, uintptr > /* > * If direct dispatch is forced, then unconditionally dispatch > * without a formal CPU selection. Borrow the current CPU's stats, > - * even if there's no worker on it. > + * even if there's no worker on it. In this case we don't update > + * nws_flags because all netisr processing will be source ordered due > + * to always being forced to directly dispatch. > */ > if (netisr_direct_force) { > nwsp = &nws[curcpu]; > npwp = &nwsp->nws_work[proto]; > + NWS_LOCK(nwsp); > npwp->nw_dispatched++; > npwp->nw_handled++; > + NWS_UNLOCK(nwsp); > np[proto].np_handler(m); > error = 0; > goto out_unlock;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4A24095D.1020209>