linux-can.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
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@gmail.com, jonathon.reinhart@gmail.com
Subject: Re: Fighting out-of-order reception with RPS?
Date: Thu, 09 Jul 2015 07:55:43 +0200	[thread overview]
Message-ID: <559E0CDF.7080309@hartkopp.net> (raw)
In-Reply-To: <CALx6S35OJHyr6iwfdtYW6P-ke2pmsmQ9BjO-D=qjgCHxwF7oew@mail.gmail.com>


On 08.07.2015 23:17, Tom Herbert wrote:
> On Wed, Jul 8, 2015 at 10:49 AM, Oliver Hartkopp <socketcan@hartkopp.net> wrote:
(..)
>> When receiving CAN frames from a specific CAN network interface (e.g. can0)
>> the frames are sporadically out-of-order on SMP systems like my Core i7 laptop
>> with 4 CPUs. This out-of-order reception kills reliable communication e.g. for
>> CAN transport protocols.
>>
>> First approach was to set the smp_affinity for the USB adapter on irq 28 with:
(..)
>> Next idea was to use RPS after reading Documentation/networking/scaling.txt
(..)
>>
>> My two questions:
>>
>> 1. Is there any better solution to meet the described requirements?
>
> I would suggest that you look into how there are OOO packets in the
> first place. Even if the interrupts is allowed to happen on different
> CPUs by sm_affinity, NAPI execution should be serialized for the
> device so that OOO shouldn't happen. The result of your RPS setting
> should be all packets go to the same queue, this shouldn't normally
> affect the ordering. Looking at drivers/net/can there are apparently
> several variants of the driver. Do you know which one you're running?

I have two CAN hardware interfaces I can test together with a SMP system:

1. PCAN-USB using the driver at drivers/net/can/usb/peak_usb/
2. PCAN Compact PCIe using drivers/net/can/sja1000/(peak_pci.c / sja1000.c)

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.

Best regards,
Oliver

>
>> 2. If not: How can enable this RPS solution by default for CAN interfaces?


  reply	other threads:[~2015-07-09  5:55 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 [this message]
2015-07-10  2:48     ` Tom Herbert
2015-07-10 20:36       ` Oliver Hartkopp
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=559E0CDF.7080309@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 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).