netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ben Greear <greearb@candelatech.com>
To: David Miller <davem@davemloft.net>
Cc: netdev@vger.kernel.org
Subject: Re: [net-next 1/2] qdisc: Allow qdiscs to provide backpressure up the stack.
Date: Thu, 26 Aug 2010 22:22:23 -0700	[thread overview]
Message-ID: <4C774B8F.2030805@candelatech.com> (raw)
In-Reply-To: <20100826.213419.189712657.davem@davemloft.net>

On 08/26/2010 09:34 PM, David Miller wrote:
> From: Ben Greear<greearb@candelatech.com>
> Date: Thu, 26 Aug 2010 21:14:39 -0700
>
>> I'll look into the NET_XMIT_CN, but if that propagates backpressure up
>> through mac-vlan, then something must know how to re-start the tx
>> logic.
>
> It doesn't need to, as it drops and frees up the packet.

If there were 5 pkts in the socket buffer, and the attempt to
send the first one caused NET_XMIT_CN, then
based on your comment below about UDP being throttled, I assume
the other 4 are kept until later?

What logic wakes up the socket transmit logic for those other 4
packets?

For sch_generic, it never returns NET_XMIT_CN at all..it just returns
NET_XMIT_DROP and deletes the passed-in skb.  Others, such as sch_fifo
drop the oldest pkt, keep the one passed in, and returns NET_XMIT_CN,
so it could not benefit from my patch.

>> One thing that really bothers me about the current qdisc stuff is that
>> it just frees the packet when it cannot accept it.
>
> Without the drop, things like RED simply would not work.

Even if RED could never work, the sch_generic can.

>> This *should* allow us to better throttle UDP sockets without
>> dropping as many packets on the sending side, and would probably
>> help TCP as well.
>
> UDP is well throttled by the socket send buffer.
>
> The only problematic case is pktgen and it's an abberation and
> an obscure case.  It's in fact trying to bypass all of the
> queueing and accounting the stack normally makes use of.

 From looking at upstream code, it seems that pktgen does the
right thing when NET_XMIT_CN or NET_XMIT_DROP is returned,
as long as you don't mind busy-spinning and perhaps some
accounting errors (NET_XMIT_CN doesn't mean *your* pkt was
deleted, just that somebody's packet was).

For accounting purposes, it would still be nice to get
NET_TX_BUSY because then you can just retry the packet
and you know that your packet was not transmitted or dropped.

Thanks,
Ben

-- 
Ben Greear <greearb@candelatech.com>
Candela Technologies Inc  http://www.candelatech.com

  reply	other threads:[~2010-08-27  5:22 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-08-25 19:00 [net-next 1/2] qdisc: Allow qdiscs to provide backpressure up the stack Ben Greear
2010-08-25 19:00 ` [net-next 2/2] macvlan: Enable qdisc backoff logic Ben Greear
2010-08-25 19:24   ` Arnd Bergmann
2010-08-25 19:27     ` Ben Greear
2010-08-25 19:38       ` Hagen Paul Pfeifer
2010-08-25 19:49         ` Ben Greear
2010-08-25 19:59       ` Arnd Bergmann
2010-08-25 20:49         ` Ben Greear
2010-08-26 13:55           ` Arnd Bergmann
2010-08-26 15:33             ` Ben Greear
2010-08-26 17:45             ` Ben Greear
2010-08-27 13:16               ` Arnd Bergmann
2010-08-25 20:44 ` [net-next 1/2] qdisc: Allow qdiscs to provide backpressure up the stack Stephen Hemminger
2010-08-25 20:56   ` Ben Greear
2010-08-26 22:59 ` David Miller
2010-08-27  4:14   ` Ben Greear
2010-08-27  4:34     ` David Miller
2010-08-27  5:22       ` Ben Greear [this message]
2010-08-27  5:36         ` David Miller
2010-08-27  5:58           ` Ben Greear
2010-08-27  6:11             ` David Miller
2010-08-27 15:26               ` Ben Greear
2010-08-27 15:59                 ` Eric Dumazet
2010-08-27 17:00                   ` Ben Greear

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4C774B8F.2030805@candelatech.com \
    --to=greearb@candelatech.com \
    --cc=davem@davemloft.net \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).