netdev
[Top] [All Lists]

Re: [PATCH]: was Re: LLTX and netif_stop_queue

To: "David S. Miller" <davem@xxxxxxxxxxxxx>
Subject: Re: [PATCH]: was Re: LLTX and netif_stop_queue
From: Lennert Buytenhek <buytenh@xxxxxxxxxxxxxx>
Date: Wed, 26 Jan 2005 14:25:12 +0100
Cc: shemminger@xxxxxxxx, roland@xxxxxxxxxxx, hadi@xxxxxxxxxx, iod00d@xxxxxx, eric.lemoine@xxxxxxxxx, netdev@xxxxxxxxxxx, ak@xxxxxxx, openib-general@xxxxxxxxxx, kaber@xxxxxxxxx
In-reply-to: <20050125222705.1ee878fd.davem@xxxxxxxxxxxxx>
References: <20050103171227.GD7370@xxxxxxxxxxxxxxxxx> <1104812294.1085.53.camel@xxxxxxxxxxxxxxxx> <20050119144711.3fdd3d93.davem@xxxxxxxxxxxxx> <20050119151853.259de49a@xxxxxxxxxxxxxxxxx> <20050119164640.6c67bdfa.davem@xxxxxxxxxxxxx> <52r7kgu5n5.fsf@xxxxxxxxxxx> <20050119230526.393a5184.davem@xxxxxxxxxxxxx> <20050120085611.33f9485e@xxxxxxxxxxxxxxxxx> <20050121105452.GA12988@xxxxxxxxxxxxxxxxx> <20050125222705.1ee878fd.davem@xxxxxxxxxxxxx>
Sender: netdev-bounce@xxxxxxxxxxx
User-agent: Mutt/1.4.1i
On Tue, Jan 25, 2005 at 10:27:05PM -0800, David S. Miller wrote:

> > If multiple CPUs can call into the tunneling drivers without taking
> > any locks, we'd need some extra locking in there, or just do what
> > Alexey describes and keep track of recursion in the skb.
> 
> Another idea is that, just like how loopback made it's statistics
> per-cpu for LLTX support, this recursion variable could be per-cpu
> as well.

I've thought about this a bit, and the only sane way of doing recursion
detection that doesn't involve 'struct net_device' would be to keep track
of the recursion depth (perhaps per-CPU as you suggest) and tossing the
packet when it exceeds some random value, right?

To reproduce the current behaviour more closely you'd have to keep a
small per-CPU array of 'struct net_device *' pointers as a kind of
recursion stack, and toss the packet when you hit a net_device that's
already on the list.  But that seems like slight overkill.


--L

<Prev in Thread] Current Thread [Next in Thread>