Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 20 Feb 2014 00:02:50 +0400
From:      Gleb Smirnoff <glebius@FreeBSD.org>
To:        Mikolaj Golub <trociny@FreeBSD.org>
Cc:        svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Martin Matuska <mm@FreeBSD.org>
Subject:   Re: svn commit: r262196 - head/sys/netpfil/pf
Message-ID:  <20140219200250.GB77637@FreeBSD.org>
In-Reply-To: <20140219184859.GA3844@gmail.com>
References:  <201402182217.s1IMHCeM077356@svn.freebsd.org> <20140219184859.GA3844@gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, Feb 19, 2014 at 08:49:01PM +0200, Mikolaj Golub wrote:
M> > -SLIST_HEAD(pf_overload_head, pf_overload_entry);
M> > +struct pf_overload_head {
M> > +	SLIST_HEAD(, pf_overload_entry) head;
M> > +	struct vnet			*vnet;
M> > +};
M> >  static VNET_DEFINE(struct pf_overload_head, pf_overloadqueue);
M> >  #define V_pf_overloadqueue	VNET(pf_overloadqueue)
M> 
M> ...
M> 
M> > -	SLIST_INIT(&V_pf_overloadqueue);
M> > +	SLIST_INIT(&V_pf_overloadqueue.head);
M> >  	TASK_INIT(&V_pf_overloadtask, 0, pf_overload_task, &V_pf_overloadqueue);
M> > +	V_pf_overloadqueue.vnet = curvnet;
M> 
M> Why not pass vnet as a context to pf_overload_task instead of
M> &V_pf_overloadqueue? Then you would not need this hack with storing a
M> vnet inside a vnet variable.

Yes, that would look much better.

The pf_overloadqueue can be made global after that. Its lock is
already global.

-- 
Totus tuus, Glebius.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20140219200250.GB77637>