netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ahmad Fatoum <a.fatoum@pengutronix.de>
To: linux-can@vger.kernel.org, netdev@vger.kernel.org, pabeni@redhat.com
Cc: Sascha Hauer <kernel@pengutronix.de>
Subject: [BUG] pfifo_fast may cause out-of-order CAN frame transmission
Date: Wed, 8 Jan 2020 15:55:34 +0100	[thread overview]
Message-ID: <661cc33a-5f65-2769-cc1a-65791cb4b131@pengutronix.de> (raw)

Hello,

I've run into an issue of CAN frames being sent out-of-order on an i.MX6 Dual
with Linux v5.5-rc5. Bisecting has lead me down to this commit:

ba27b4cdaaa ("net: dev: introduce support for sch BYPASS for lockless qdisc")

With it, using pfifo_fast, every few hundred frames, FlexCAN's .ndo_start_xmit is
passed frames in an order different from how userspace stuffed them into the same
socket.

Reverting it fixes the issue as does booting with maxcpus=1 or using pfifo
instead of pfifo_fast.

According to [1], such reordering shouldn't be happening.

Details on my setup:
Kernel version: v5.5-rc5, (occurs much more often with LOCKDEP turned on)
CAN-Bitrate: 250 kbit/s
CAN frames are generated with:
cangen canX -I2 -L1 -Di -i -g0.12 -p 100
which keeps polling after ENOBUFS until socket is writable, sends out a CAN
frame with one incrementing payload byte and then waits 120 usec before repeating.

Please let me know if any additional info is needed.

Cheers
Ahmad

[1]: http://linux-tc-notes.sourceforge.net/tc/doc/sch_pfifo_fast.txt

-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

             reply	other threads:[~2020-01-08 14:55 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-08 14:55 Ahmad Fatoum [this message]
2020-01-09 12:51 ` [BUG] pfifo_fast may cause out-of-order CAN frame transmission Paolo Abeni
2020-01-09 17:39   ` Ahmad Fatoum
2020-01-10 16:31     ` Paolo Abeni
2020-01-12 21:29       ` Ahmad Fatoum
     [not found]         ` <57a2352dfc442ea2aa9cd653f8e09db277bf67c7.camel@redhat.com>
2020-01-20 16:06           ` Ahmad Fatoum
2020-02-04 16:25             ` Ahmad Fatoum
2020-02-06 13:21               ` Paolo Abeni
2020-02-06 17:06                 ` Oliver Hartkopp
2020-02-14 16:03                 ` Ahmad Fatoum
2020-10-07 21:07                 ` Vijayendra Suman

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=661cc33a-5f65-2769-cc1a-65791cb4b131@pengutronix.de \
    --to=a.fatoum@pengutronix.de \
    --cc=kernel@pengutronix.de \
    --cc=linux-can@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.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).