Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 9 Apr 2010 16:17:22 +0200
From:      Luigi Rizzo <rizzo@iet.unipi.it>
To:        Julian Elischer <julian@elischer.org>
Cc:        freebsd-ipfw@freebsd.org, Anders Hagman <anders.hagman@halleforshunden.org>
Subject:   Re: dummynet and vnet kernel panic
Message-ID:  <20100409141722.GA53191@onelab2.iet.unipi.it>
In-Reply-To: <4BBCF17F.4000408@elischer.org>
References:  <4BBCE3EE.506@halleforshunden.org> <20100407203802.GA91356@onelab2.iet.unipi.it> <4BBCF17F.4000408@elischer.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, Apr 07, 2010 at 01:56:31PM -0700, Julian Elischer wrote:
> On 4/7/10 1:38 PM, Luigi Rizzo wrote:
> >On Wed, Apr 07, 2010 at 09:58:38PM +0200, Anders Hagman wrote:
> >>Hi
> >>
> >>When using dummynet inside a vnet node with a simple pipe the kernel
> >>panic on the first packet.
> >>
> >>I use 8.0-STABLE cvsuped at 7 Apr 15:28
> >>The ipfw code with dummynet is largely changed and the patch in the url
> >>below will not work.
> >>http://www.freebsd.org/cgi/query-pr.cgi?pr=143621
> >>
> >>Is there a fix in the near future?
> >
> >haven't tried it myself, but adapting the patch seems
> >reasonably trivial. I'll see what i can do.
> >
> >Are there any vnet experts who can comment ?
> 
> the change itself looks as if it makes sense
> but I have not really tested it or gone to great length.
> 
> -----------
> 
> the following URL gives you the change that was made to make the OLD
> version of dummynet Vimage compatible.
> 
> http://p4db.freebsd.org/fileLogView.cgi?FSPC=//depot/projects/vimage/src/sys/netinet/ipfw/ip_dummynet.c

Question:
the change in PR 143621 just makes sure that curvnet
points to something sensible while a packet is reinjected
by dummynet_send();
the code in P4 does something completely different, as it
remaps the global variables to the per-vimage ones, and does
not seem to touch dummynet_send() at all.
So how does the code in P4 make sure that curvnet is set properly ?

> does this still apply to 8.x? or did you redo the dummynet in 8?
> if you didn't it may be worth looking to see if these changes apply to 
> 8.x real soon before it's frozen.

former global variables are now mostly in a single struct, dn_cfg.
There are however 150 lines where the global variable is used, so
I am bit scared at renaming all of these occurrences from dn_cfg
to V_dn_cfg. I'd rather follow a different approach, i.e

    VNET_DEFINE(struct dn_cfg, _base_dn_cfg);
    #define dn_cfg		VNET(_base_dn_cfg)

would this make sense to you ?

	cheers
	luigi



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