All of lore.kernel.org
 help / color / mirror / Atom feed
From: Florian Westphal <fw@strlen.de>
To: Cong Wang <xiyou.wangcong@gmail.com>
Cc: Florian Westphal <fw@strlen.de>,
	Linux Kernel Network Developers <netdev@vger.kernel.org>
Subject: Re: [PATCH RFC] sched: split classification and enqueue
Date: Wed, 22 Jun 2016 19:23:44 +0200	[thread overview]
Message-ID: <20160622172344.GG10213@breakpoint.cc> (raw)
In-Reply-To: <CAM_iQpXGX=jPO7q=W32o3X2_4ce5PbY2PuTMhkmhtGP6PXuH4Q@mail.gmail.com>

Cong Wang <xiyou.wangcong@gmail.com> wrote:
> On Wed, Jun 22, 2016 at 3:03 AM, Florian Westphal <fw@strlen.de> wrote:
> >
> > This (unfinished!) hack splits classification and enqueue into
> > two steps.
> >
> > Before enqueueing the packet and *before* acquiring the root qdisc lock,
> > the new qdisc ->classify() function is invoked.
> >
> > This function -- much like enqueue in the current scheme -- looks up
> > a child class and/or determines the next qdisc where the packet needs
> > to be handled via the classifier action subsystem.
> > Then it invokes the new ->classify() hook of the child, which can repeat
> > until the leaf qdisc is reached.
> 
> Then how is the atomicity guaranteed? One of the important
> purposes of the qdisc lock is to guarantee the atomicity of any
> change of in the whole hierarchy, i.e., qdisc/class/filter/action.

Not in this PoC, but I think that this could be solved e.g. by adding a
sequence counter that gets sampled pre-classify, we'd then only have to
check post-aquiring the root lock if its unchanged.  If not, some
class/filter, etc changed and we can just drop skb (or re-do the
classification, but I dislike such loops).

Only config changes would increment the counter, so it should not be
a lot of overhead.

  reply	other threads:[~2016-06-22 17:23 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-22 10:03 [PATCH RFC] sched: split classification and enqueue Florian Westphal
2016-06-22 17:05 ` Cong Wang
2016-06-22 17:23   ` Florian Westphal [this message]
2016-06-22 17:29 ` Alexei Starovoitov
2016-06-22 17:41   ` Florian Westphal
2016-06-22 18:15 ` Stephen Hemminger

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=20160622172344.GG10213@breakpoint.cc \
    --to=fw@strlen.de \
    --cc=netdev@vger.kernel.org \
    --cc=xiyou.wangcong@gmail.com \
    /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.