Subject: Re: [net-next 1/2] qdisc: Allow qdiscs to provide backpressure up the stack.

From: Ben Greear <[email-masked]>
Date: Wed, 25 Aug 2010 13:56:42 -0700

On 08/25/2010 01:44 PM, Stephen Hemminger wrote:
> On Wed, 25 Aug 2010 12:00:50 -0700

>>   struct Qdisc {
>>   	int 			(*enqueue)(struct sk_buff *skb, struct Qdisc *dev);
>> +	int 			(*try_enqueue)(struct sk_buff *, struct Qdisc *dev); /* May return NET_XMIT_BUSY and NOT free skb. */
>>
>
>
> There aren't that many qdisc modules; just fix them all and change
> semantics of enqueue.  How do you expect to handle the retry? Spinning
> at the higher level is a bad idea and there is no non-racy way to get
> a callback to make forward progress.

It may only make sense for things like macvlan at this point, since
it is already valid to return NET_XMIT_BUSY and not free the SKB
when you call dev->hard_start_xmit().

Using the try_ logic for sockets and such would probably require a good
deal more work, and probably is something I'd not attempt any time
soon (there are others who know that code better, so maybe they'd
be able & willing to do that work).

If/when all the calling code knows how to do the retry logic properly,
then we could have a single enqueue method, but I think to allow
incremental changes, it's best to have the two methods for now.

Thanks,
Ben

-- 
Ben Greear <[email-masked]>
Candela Technologies Inc  http://www.candelatech.com