netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Stefan Mätje" <stefan.maetje@esd.eu>
To: "mkl@pengutronix.de" <mkl@pengutronix.de>
Cc: "mailhol@kernel.org" <mailhol@kernel.org>,
	"socketcan@hartkopp.net" <socketcan@hartkopp.net>,
	"linux-can@vger.kernel.org" <linux-can@vger.kernel.org>,
	socketcan <socketcan@esd.eu>,
	Frank Jungclaus <frank.jungclaus@esd.eu>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"horms@kernel.org" <horms@kernel.org>,
	"olivier@sobrie.be" <olivier@sobrie.be>
Subject: Re: [PATCH 4/6] can: esd_usb: Add watermark handling for TX jobs
Date: Mon, 18 Aug 2025 09:55:00 +0000	[thread overview]
Message-ID: <aa9e49d52421ac821062f6cdbccc77e81838dc03.camel@esd.eu> (raw)
In-Reply-To: <20250813-chubby-lizard-from-asgard-fb7867-mkl@pengutronix.de>

Am Mittwoch, dem 13.08.2025 um 10:13 +0200 schrieb Marc Kleine-Budde:
> On 11.08.2025 23:06:09, Stefan Mätje wrote:
> > The driver tried to keep as much CAN frames as possible submitted to the
> > USB device (ESD_USB_MAX_TX_URBS). This has led to occasional "No free
> > context" error messages in high load situations like with
> > "cangen -g 0 -p 10 canX".
> > 
> > This patch now calls netif_stop_queue() already if the number of active
> > jobs reaches ESD_USB_TX_URBS_HI_WM which is < ESD_USB_MAX_TX_URBS.
> > The netif_start_queue() is called in esd_usb_tx_done_msg() only if
> > the number of active jobs is <= ESD_USB_TX_URBS_LO_WM.
> > 
> > This change eliminates the occasional error messages and significantly
> > reduces the number of calls to netif_start_queue() and
> > netif_stop_queue().
> > 
> > The watermark limits have been chosen with the CAN-USB/Micro in mind to
> > not to compromise its TX throughput. This device is running on USB 1.1
> > only with its 1ms USB polling cycle where a ESD_USB_TX_URBS_LO_WM
> > value below 9 decreases the TX throughput.
> > 
> > Signed-off-by: Stefan Mätje <stefan.maetje@esd.eu>
> 
> Please add a Fixes tag.

I did not add a fixes tag because I had the impression that the code was working
fine with older kernels and the occasional messages began showing up only with
newer kernels after ~ 6.11. So I was not able to pinpoint the error to the patch 
that exposed the problem. 

But I retested the stuff now with older kernels. Somewhere between 5.4 and the 5.15
the problem starts. But on older kernels it can only be exposed transmitting zero
byte frames with "cangen -I i -g 0 -p 10 -L 0 canX" and additionally load the system
with other heavy tasks.

The code was unchanged since the initial implementation. I will then add a fixes 
tag that denotes the initial implementation. That would be:

Fixes: 96d8e90382dc ("can: Add driver for esd CAN-USB/2 device")


  reply	other threads:[~2025-08-18  9:55 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-11 21:06 [PATCH 0/6] can: esd_usb: Fixes and improvements Stefan Mätje
2025-08-11 21:06 ` [PATCH 1/6] can: esd_usb: Fix possible calls to kfree() with NULL Stefan Mätje
2025-08-12 12:33   ` Vadim Fedorenko
2025-08-15 14:57     ` Stefan Mätje
2025-08-17 15:02       ` David Laight
2025-08-13  9:20   ` Marc Kleine-Budde
2025-08-15 15:02     ` Stefan Mätje
2025-08-19 16:16       ` Stefan Mätje
2025-08-11 21:06 ` [PATCH 2/6] can: esd_usb: Fix not detecting version reply in probe routine Stefan Mätje
2025-08-13  8:26   ` Marc Kleine-Budde
2025-08-13 11:44     ` Vincent Mailhol
2025-08-19 16:41       ` Stefan Mätje
2025-08-19 16:23     ` Stefan Mätje
2025-08-11 21:06 ` [PATCH 3/6] can: esd_usb: Fix handling of TX context objects Stefan Mätje
2025-08-13  8:14   ` Marc Kleine-Budde
2025-08-15 15:29     ` Stefan Mätje
2025-08-11 21:06 ` [PATCH 4/6] can: esd_usb: Add watermark handling for TX jobs Stefan Mätje
2025-08-13  8:13   ` Marc Kleine-Budde
2025-08-18  9:55     ` Stefan Mätje [this message]
2025-08-11 21:06 ` [PATCH 5/6] can: esd_usb: Rework display of error messages Stefan Mätje
2025-08-13  8:12   ` Marc Kleine-Budde
2025-08-14 12:45     ` Marc Kleine-Budde
2025-08-18 12:21       ` Stefan Mätje
2025-08-11 21:06 ` [PATCH 6/6] can: esd_usb: Avoid errors triggered from USB disconnect Stefan Mätje
2025-08-13  8:09   ` Marc Kleine-Budde
2025-08-16 13:11     ` Stefan Mätje

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=aa9e49d52421ac821062f6cdbccc77e81838dc03.camel@esd.eu \
    --to=stefan.maetje@esd.eu \
    --cc=frank.jungclaus@esd.eu \
    --cc=horms@kernel.org \
    --cc=linux-can@vger.kernel.org \
    --cc=mailhol@kernel.org \
    --cc=mkl@pengutronix.de \
    --cc=netdev@vger.kernel.org \
    --cc=olivier@sobrie.be \
    --cc=socketcan@esd.eu \
    --cc=socketcan@hartkopp.net \
    /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).