[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20110106220030.GA2084@verge.net.au>
Date: Fri, 7 Jan 2011 07:01:12 +0900
From: Simon Horman <horms@...ge.net.au>
To: Eric Dumazet <eric.dumazet@...il.com>
Cc: Rusty Russell <rusty@...tcorp.com.au>,
virtualization@...ts.linux-foundation.org,
Jesse Gross <jesse@...ira.com>, dev@...nvswitch.org,
virtualization@...ts.osdl.org, netdev@...r.kernel.org,
kvm@...r.kernel.org, "Michael S. Tsirkin" <mst@...hat.com>
Subject: Re: Flow Control and Port Mirroring Revisited
On Thu, Jan 06, 2011 at 02:28:18PM +0100, Eric Dumazet wrote:
> Le jeudi 06 janvier 2011 à 21:44 +0900, Simon Horman a écrit :
>
> > Hi Eric !
> >
> > Thanks for the advice. I had thought about the socket buffer but at some
> > point it slipped my mind.
> >
> > In any case the following patch seems to implement the change that I had in
> > mind. However my discussions Michael Tsirkin elsewhere in this thread are
> > beginning to make me think that think that perhaps this change isn't the
> > best solution.
> >
> > diff --git a/datapath/actions.c b/datapath/actions.c
> > index 5e16143..505f13f 100644
> > --- a/datapath/actions.c
> > +++ b/datapath/actions.c
> > @@ -384,7 +384,12 @@ static int do_execute_actions(struct datapath *dp, struct sk_buff *skb,
> >
> > for (a = actions, rem = actions_len; rem > 0; a = nla_next(a, &rem)) {
> > if (prev_port != -1) {
> > - do_output(dp, skb_clone(skb, GFP_ATOMIC), prev_port);
> > + struct sk_buff *nskb = skb_clone(skb, GFP_ATOMIC);
> > + if (nskb) {
> > + if (skb->sk)
> > + skb_set_owner_w(nskb, skb->sk);
> > + do_output(dp, nskb, prev_port);
> > + }
> > prev_port = -1;
> > }
> >
> > I got a rather nasty panic without the if (skb->sk),
> > I guess some skbs don't have a socket.
>
> Indeed, some packets are not linked to a socket.
>
> (ARP packets for example)
>
> Sorry, I should have mentioned it :)
Not at all, the occasional panic during hacking is good for the soul.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists