All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stephen Hemminger <shemminger@vyatta.com>
To: Ben Greear <greearb@candelatech.com>
Cc: netdev@vger.kernel.org
Subject: Re: [net-next 1/2] qdisc:  Allow qdiscs to provide backpressure up the stack.
Date: Wed, 25 Aug 2010 13:44:52 -0700	[thread overview]
Message-ID: <20100825134452.5aac9dfb@nehalam> (raw)
In-Reply-To: <1282762851-3612-1-git-send-email-greearb@candelatech.com>

On Wed, 25 Aug 2010 12:00:50 -0700
Ben Greear <greearb@candelatech.com> wrote:

> Some qdiscs, in some instances, can reliably detect when they
> are about to drop a packet in the dev_queue_xmit path.  In
> this case, it would be nice to provide backpressure up the
> stack, and NOT free the skb in the qdisc logic.
> 
> Signed-off-by: Ben Greear <greearb@candelatech.com>
> ---
> :100644 100644 59962db... 20be932... M	include/linux/netdevice.h
> :100644 100644 3c8728a... 146a97a... M	include/net/sch_generic.h
> :100644 100644 859e30f... f360a9b... M	net/core/dev.c
> :100644 100644 2aeb3a4... 0692717... M	net/sched/sch_generic.c
>  include/linux/netdevice.h |    7 +++++++
>  include/net/sch_generic.h |   19 +++++++++++++++++++
>  net/core/dev.c            |   19 ++++++++++++++-----
>  net/sched/sch_generic.c   |   20 ++++++++++++++++++++
>  4 files changed, 60 insertions(+), 5 deletions(-)
> 
> diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
> index 59962db..20be932 100644
> --- a/include/linux/netdevice.h
> +++ b/include/linux/netdevice.h
> @@ -97,6 +97,7 @@ struct wireless_dev;
>  #define NET_XMIT_DROP		0x01	/* skb dropped			*/
>  #define NET_XMIT_CN		0x02	/* congestion notification	*/
>  #define NET_XMIT_POLICED	0x03	/* skb is shot by police	*/
> +#define NET_XMIT_BUSY	  	0x04	/* congestion, but skb was NOT freed */
>  #define NET_XMIT_MASK		0x0f	/* qdisc flags in net/sch_generic.h */
>  
>  /* NET_XMIT_CN is special. It does not guarantee that this packet is lost. It
> @@ -1296,6 +1297,12 @@ extern int		dev_open(struct net_device *dev);
>  extern int		dev_close(struct net_device *dev);
>  extern void		dev_disable_lro(struct net_device *dev);
>  extern int		dev_queue_xmit(struct sk_buff *skb);
> +
> +/* Similar to dev_queue_xmit, but if try_no_consume != 0,
> + * it may return NET_XMIT_BUSY and NOT free the skb if it detects congestion
> + */
> +extern int		try_dev_queue_xmit(struct sk_buff *skb, int try_no_consume);
> +
>  extern int		register_netdevice(struct net_device *dev);
>  extern void		unregister_netdevice_queue(struct net_device *dev,
>  						   struct list_head *head);
> diff --git a/include/net/sch_generic.h b/include/net/sch_generic.h
> index 3c8728a..146a97a 100644
> --- a/include/net/sch_generic.h
> +++ b/include/net/sch_generic.h
> @@ -43,6 +43,7 @@ struct qdisc_size_table {
>  
>  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.

  parent reply	other threads:[~2010-08-25 20:44 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 ` Stephen Hemminger [this message]
2010-08-25 20:56   ` [net-next 1/2] qdisc: Allow qdiscs to provide backpressure up the stack 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
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=20100825134452.5aac9dfb@nehalam \
    --to=shemminger@vyatta.com \
    --cc=greearb@candelatech.com \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.