All of lore.kernel.org
 help / color / mirror / Atom feed
From: John Fastabend <john.r.fastabend@intel.com>
To: Cong Wang <xiyou.wangcong@gmail.com>
Cc: Eric Dumazet <eric.dumazet@gmail.com>,
	Linux Kernel Network Developers <netdev@vger.kernel.org>,
	"David S. Miller" <davem@davemloft.net>,
	Jamal Hadi Salim <jhs@mojatatu.com>
Subject: Re: [RFC Patch net-next] net_sched: make classifying lockless on ingress
Date: Fri, 20 Dec 2013 17:09:54 -0800	[thread overview]
Message-ID: <52B4EA62.2020603@intel.com> (raw)
In-Reply-To: <CAM_iQpWLTL-PmiNz8k7Kv9KcHsFTennATKgbwQWXX2FN8vdxjg@mail.gmail.com>

On 12/20/2013 3:57 PM, Cong Wang wrote:
> On Fri, Dec 20, 2013 at 3:49 PM, Eric Dumazet <eric.dumazet@gmail.com> wrote:
>> On Fri, 2013-12-20 at 15:28 -0800, Cong Wang wrote:
>>
>>> diff --git a/net/core/dev.c b/net/core/dev.c
>>> index c482fe8..7cc0d6a 100644
>>> --- a/net/core/dev.c
>>> +++ b/net/core/dev.c
>>> @@ -3382,10 +3382,8 @@ static int ing_filter(struct sk_buff *skb, struct netdev_queue *rxq)
>>>
>>>        q = rxq->qdisc;
>>>        if (q != &noop_qdisc) {
>>> -             spin_lock(qdisc_lock(q));
>>>                if (likely(!test_bit(__QDISC_STATE_DEACTIVATED, &q->state)))
>>>                        result = qdisc_enqueue_root(skb, q);
>>> -             spin_unlock(qdisc_lock(q));
>>>        }
>>>
>>
>> Well... That would be too easy.
>>
>> Really, a lot more work would be needed.
>>
>> Qdisc ->enqueue()/dequeue()/reset()/... all assume the qdisc lock is
>> held.
>
> Just push the lock down to ->enqueue() ? Since ingress qdisc is classless
> and its ->dequeue() is nop.
>

huh? You need to make all the classifiers lockless probably via RCU and
then make the actions safe as well. If you want to take a look at what
I started doing its here https://github.com/jrfastab/Linux-Kernel-QOS/ 
complete with a nasty bug in the u32 classifier that I haven't had time
to track down yet. Probably others for that matter.

I have primarily been concerned with xmit qdiscs so far and using mqprio
allows using the skb->priority field for qdisc selection in the
multiqueue nics which has been good enough. I suppose I should _finally_
get around to completing this seeing its come up twice now in a few
weeks and I've been thinking about if for longer than I care to
remember.

.John

      parent reply	other threads:[~2013-12-21  1:10 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-12-20 23:28 [RFC Patch net-next] net_sched: make classifying lockless on ingress Cong Wang
2013-12-20 23:49 ` Eric Dumazet
2013-12-20 23:57   ` Cong Wang
2013-12-21  0:08     ` Eric Dumazet
2013-12-21  0:24       ` Cong Wang
2013-12-21  2:32         ` John Fastabend
2013-12-21 22:11           ` Jamal Hadi Salim
2013-12-21 23:09             ` John Fastabend
2013-12-22 16:01               ` Jamal Hadi Salim
2013-12-24  0:56               ` Cong Wang
2013-12-24  6:08                 ` John Fastabend
2013-12-26 12:02                   ` Jamal Hadi Salim
2013-12-21  1:09     ` John Fastabend [this message]

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=52B4EA62.2020603@intel.com \
    --to=john.r.fastabend@intel.com \
    --cc=davem@davemloft.net \
    --cc=eric.dumazet@gmail.com \
    --cc=jhs@mojatatu.com \
    --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.