netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Miller <davem@davemloft.net>
To: jussi.kivilinna@mbnet.fi
Cc: jarkao2@gmail.com, kaber@trash.net, netdev@vger.kernel.org
Subject: Re: qdisc_enqueue, NET_XMIT_SUCCESS and kfree_skb
Date: Sun, 17 Aug 2008 23:52:37 -0700 (PDT)	[thread overview]
Message-ID: <20080817.235237.24119245.davem@davemloft.net> (raw)
In-Reply-To: <20080807143654.16955ngk5tnp5kzk@hayate.ip6>

From: "Jussi Kivilinna" <jussi.kivilinna@mbnet.fi>
Date: Thu, 07 Aug 2008 14:36:54 +0300

> Quoting "Jarek Poplawski" <jarkao2@gmail.com>:
> 
> > There is also some doubt about differences between ->enqueue() and
> > ->requeue() wrt. kfree_skb() and returning codes: maybe it would be
> > better (for uniformity) to add similar changes to requeues (and
> > dev_requeue_skb()) as well?
> >
> 
> I think requeue should be changed to return same as enqueue, netem even
> uses requeue as enqueue replacement for packet reordering. Maybe add
> new function qdisc_requeue_tree to handle freeing and masking flags and
> change outside uses of requeue to use it (qdisc_peek_len in hfsc,
> sch_atm_dequeue, dev_requeue_skb).

Yes, I in fact stumbled through this stuff while working on
the HTB/TBF ->enqueue() fixes.

It's not going to be easy to cure this completely and we'll
have to work in stages.

What I'll do tonight is first make a simple set of fixes,
like fixing these things to use the proper NET_XMIT_*
values instead of constant "0" and stuff like that.

Next I'll do the real ->requeue() return value audit.

As an aside I still think we really don't need ->requeue(),
once we pull a packet out of ->enqueue() it's out of the
packet scheduler's realm and we can definitely hold onto it
as the next packet to give to the device.  This netem code
is really an abuse of this ->requeue() callback.  It was
never meant to be used like that.

In fact, as I look at how TBF and NETEM want to use ->requeue() they
could just the same implement it using my suggested alternative for
->requeue() which is just an SKB list ala gso_list hung off of the
qdisc.

They all just want to "insert to front" when they call ->requeue(),
nothing more.

In the TBF case, it wants to defer the send to some time in the
future.  But that would work in my scheme as well as it would now.
TBF's ->enqueue() would return NULL yet stick the packet into
the qdisc->skb_list, the watchdog is schedules will run the queue
when it fires.

So, in short, the more I think about it the more I think we can
certainly kill off ->requeue() and all of it's resulting complexity.

  parent reply	other threads:[~2008-08-18  6:52 UTC|newest]

Thread overview: 44+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-07-31 17:14 [PATCH] net_sched: Add qdisc __NET_XMIT_STOLEN flag Jarek Poplawski
2008-08-01  6:15 ` Patrick McHardy
2008-08-01  7:58   ` Jarek Poplawski
2008-08-01 10:19   ` [PATCH] net_sched: Add qdisc __NET_XMIT_BYPASS flag Jarek Poplawski
2008-08-04  1:25     ` David Miller
2008-08-04  6:28       ` [PATCH take 2] " Jarek Poplawski
2008-08-04  6:42         ` David Miller
2008-08-04  6:51           ` Jarek Poplawski
2008-08-04  8:55           ` [PATCH 1/2 respin] net_sched: Add qdisc __NET_XMIT_STOLEN flag Jarek Poplawski
2008-08-05  5:38             ` David Miller
2008-08-04  8:57           ` [PATCH 2/2 respin] net_sched: Add qdisc __NET_XMIT_BYPASS flag Jarek Poplawski
2008-08-05  6:14             ` David Miller
2008-08-05  6:34               ` Jarek Poplawski
2008-08-05  6:31                 ` David Miller
2008-08-05  6:47                   ` Jarek Poplawski
2008-08-04 18:35         ` [PATCH take 2] " Jussi Kivilinna
2008-08-04 21:03           ` Jarek Poplawski
2008-08-05 12:43             ` Jussi Kivilinna
2008-08-05 15:50               ` Jarek Poplawski
2008-08-06 19:42                 ` qdisc_enqueue, NET_XMIT_SUCCESS and kfree_skb (Was: Re: [PATCH take 2] net_sched: Add qdisc __NET_XMIT_BYPASS flag) Jussi Kivilinna
2008-08-06 21:52                   ` Jarek Poplawski
2008-08-07  3:26                     ` qdisc_enqueue, NET_XMIT_SUCCESS and kfree_skb David Miller
2008-08-07  5:09                       ` David Miller
2008-08-07  6:24                         ` Jarek Poplawski
2008-08-07 10:09                         ` Jarek Poplawski
2008-08-07 10:10                           ` David Miller
2008-08-07 10:31                             ` Jarek Poplawski
2008-08-07 10:45                               ` David Miller
2008-08-07 11:39                                 ` Jarek Poplawski
2008-08-07 11:36                           ` Jussi Kivilinna
2008-08-07 12:05                             ` Jarek Poplawski
2008-08-18  6:52                             ` David Miller [this message]
2008-08-19 12:50                               ` Herbert Xu
2008-08-19 13:08                                 ` Patrick McHardy
2008-08-19 13:11                                   ` Herbert Xu
2008-08-19 13:20                                     ` Patrick McHardy
2008-08-19 13:42                                       ` Herbert Xu
2008-08-19 20:10                                         ` Denys Fedoryshchenko
2008-08-19 20:21                                           ` Jarek Poplawski
2008-08-19 20:26                                           ` David Miller
2008-08-07 11:40                     ` qdisc_enqueue, NET_XMIT_SUCCESS and kfree_skb (Was: Re: [PATCH take 2] net_sched: Add qdisc __NET_XMIT_BYPASS flag) Jussi Kivilinna
2008-08-07 12:23                       ` Jarek Poplawski
2008-08-05 21:22               ` [PATCH take 2] net_sched: Add qdisc __NET_XMIT_BYPASS flag David Miller
2008-08-04  6:48       ` [PATCH take 3] " Jarek Poplawski

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=20080817.235237.24119245.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=jarkao2@gmail.com \
    --cc=jussi.kivilinna@mbnet.fi \
    --cc=kaber@trash.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).