From: Oliver Hartkopp <socketcan@hartkopp.net>
To: Tom Herbert <tom@herbertland.com>
Cc: Linux Kernel Network Developers <netdev@vger.kernel.org>,
"linux-can@vger.kernel.org" <linux-can@vger.kernel.org>,
Sunil Kovvuri <sunil.kovvuri@gmail.com>,
Jonathon Reinhart <jonathon.reinhart@gmail.com>
Subject: Re: Fighting out-of-order reception with RPS?
Date: Fri, 10 Jul 2015 22:36:43 +0200 [thread overview]
Message-ID: <55A02CDB.6000302@hartkopp.net> (raw)
In-Reply-To: <CALx6S37JjusJ=+L3mXT0Dzf8XuU0+dgJQ7_Xn4U0nBtkf0gCHQ@mail.gmail.com>
On 07/10/2015 04:48 AM, Tom Herbert wrote:
> On Wed, Jul 8, 2015 at 10:55 PM, Oliver Hartkopp <socketcan@hartkopp.net> wrote:
>> Both drivers do not use NAPI. The just follow the way
>>
>> interrupt -> alloc_skb() -> fill skb -> netif_rx(skb)
>>
>> I'm usually testing with the USB adapters as the PCIe setup is not very
>> handy.
>>
> Okay, I see what is happening. In netif_rx when RPS is not enabled
> that packet is queued to the backlog queue for the local CPU. Since
> you're doing round robin on the interrupts then OOO packets can be a
> result. Unfortunately, this is the expected behavior. The correct
> kernel fix would be to move to these drivers to use NAPI.
Hm. Doesn't sound like a good solution when there's a difference between NAPI
and non-NAPI drivers in matters of OOO, right?
> RPS
> eliminates the OOO, but if there is no ability to derive a flow hash
> from packets everything will wind up one queue without load balancing.
Correct.
That's why I added
skb_set_hash(skb, dev->ifindex, PKT_HASH_TYPE_L2);
in my driver, because the only relevant flow identifiction is the number of
the incoming CAN interface.
> Besides that, automatically setting RPS in drivers is a difficult
> proposition since there is no definitively "correct" way to do that in
> an arbitrary configuration.
What about checking in netif_rx() if the non-NAPI driver has set a hash (aka
the driver is OOO sensitive)?
And if so we could automatically set rps_cpus for this interface in a way that
all CPUs are enabled to take skbs following the hash.
Best regards,
Oliver
next prev parent reply other threads:[~2015-07-10 20:36 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-07-08 17:49 Fighting out-of-order reception with RPS? Oliver Hartkopp
2015-07-08 21:17 ` Tom Herbert
2015-07-09 5:55 ` Oliver Hartkopp
2015-07-10 2:48 ` Tom Herbert
2015-07-10 20:36 ` Oliver Hartkopp [this message]
2015-07-11 4:35 ` Eric Dumazet
2015-07-12 19:15 ` Oliver Hartkopp
2015-07-13 3:22 ` David Miller
2015-07-13 4:57 ` Eric Dumazet
2015-07-14 17:09 ` Oliver Hartkopp
2015-07-14 18:02 ` Tom Herbert
2015-07-14 19:03 ` David Miller
2015-07-14 19:05 ` Oliver Hartkopp
2015-07-13 19:08 ` Tom Herbert
2015-07-09 6:34 ` Holger Schurig
2015-07-09 8:48 ` Oliver Hartkopp
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=55A02CDB.6000302@hartkopp.net \
--to=socketcan@hartkopp.net \
--cc=jonathon.reinhart@gmail.com \
--cc=linux-can@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=sunil.kovvuri@gmail.com \
--cc=tom@herbertland.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.