* [PATCH] can: m_can: apply rate-limiting to lost msg in rx
@ 2025-06-20 10:00 Sean Nyekjaer
2025-06-21 2:13 ` Vincent Mailhol
0 siblings, 1 reply; 5+ messages in thread
From: Sean Nyekjaer @ 2025-06-20 10:00 UTC (permalink / raw)
To: Chandrasekar Ramakrishnan, Marc Kleine-Budde, Vincent Mailhol,
Fengguang Wu, Varka Bhadram, Dong Aisheng
Cc: linux-can, linux-kernel, Sean Nyekjaer
Wrap the "msg lost in rxf0" error in m_can_handle_lost_msg() with
a call to net_ratelimit() to prevent flooding the kernel log
with repeated error messages.
Fixes: e0d1f4816f2a ("can: m_can: add Bosch M_CAN controller support")
Signed-off-by: Sean Nyekjaer <sean@geanix.com>
---
drivers/net/can/m_can/m_can.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/net/can/m_can/m_can.c b/drivers/net/can/m_can/m_can.c
index 6c656bfdb3235e1f5d6405c49b07b821ddacc1b9..b0638d23879cf4257b8f4555d1123f45f9595ad7 100644
--- a/drivers/net/can/m_can/m_can.c
+++ b/drivers/net/can/m_can/m_can.c
@@ -665,7 +665,8 @@ static int m_can_handle_lost_msg(struct net_device *dev)
struct can_frame *frame;
u32 timestamp = 0;
- netdev_err(dev, "msg lost in rxf0\n");
+ if (net_ratelimit())
+ netdev_err(dev, "msg lost in rxf0\n");
stats->rx_errors++;
stats->rx_over_errors++;
---
base-commit: db22720545207f734aaa9d9f71637bfc8b0155e0
change-id: 20250620-mcan_ratelimit-e7e1f9d8fa9c
Best regards,
--
Sean Nyekjaer <sean@geanix.com>
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] can: m_can: apply rate-limiting to lost msg in rx
2025-06-20 10:00 [PATCH] can: m_can: apply rate-limiting to lost msg in rx Sean Nyekjaer
@ 2025-06-21 2:13 ` Vincent Mailhol
2025-06-26 13:45 ` Sean Nyekjaer
0 siblings, 1 reply; 5+ messages in thread
From: Vincent Mailhol @ 2025-06-21 2:13 UTC (permalink / raw)
To: Sean Nyekjaer
Cc: linux-can, linux-kernel, Chandrasekar Ramakrishnan,
Marc Kleine-Budde, Fengguang Wu, Varka Bhadram, Dong Aisheng
On 20/06/2025 at 19:00, Sean Nyekjaer wrote:
> Wrap the "msg lost in rxf0" error in m_can_handle_lost_msg() with
> a call to net_ratelimit() to prevent flooding the kernel log
> with repeated error messages.
Note that another solution is to simply remove the error message. The users can
use the CAN error frames or the netstasts instead to see if lost messages occurred.
That said, I am OK with your proposed patch. See above comment as a simple FYI.
> Fixes: e0d1f4816f2a ("can: m_can: add Bosch M_CAN controller support")
> Signed-off-by: Sean Nyekjaer <sean@geanix.com>
Reviewed-by: Vincent Mailhol <mailhol.vincent@wanadoo.fr>
Yours sincerely,
Vincent Mailhol
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] can: m_can: apply rate-limiting to lost msg in rx
2025-06-21 2:13 ` Vincent Mailhol
@ 2025-06-26 13:45 ` Sean Nyekjaer
2025-06-26 13:57 ` Marc Kleine-Budde
0 siblings, 1 reply; 5+ messages in thread
From: Sean Nyekjaer @ 2025-06-26 13:45 UTC (permalink / raw)
To: Vincent Mailhol
Cc: linux-can, linux-kernel, Chandrasekar Ramakrishnan,
Marc Kleine-Budde, Fengguang Wu, Varka Bhadram, Dong Aisheng
Hi,
On Sat, Jun 21, 2025 at 11:13:33AM +0100, Vincent Mailhol wrote:
> On 20/06/2025 at 19:00, Sean Nyekjaer wrote:
> > Wrap the "msg lost in rxf0" error in m_can_handle_lost_msg() with
> > a call to net_ratelimit() to prevent flooding the kernel log
> > with repeated error messages.
>
> Note that another solution is to simply remove the error message. The users can
> use the CAN error frames or the netstasts instead to see if lost messages occurred.
>
> That said, I am OK with your proposed patch. See above comment as a simple FYI.
I'm up for both solutions :)
@Marc what would you prefer?
>
> > Fixes: e0d1f4816f2a ("can: m_can: add Bosch M_CAN controller support")
> > Signed-off-by: Sean Nyekjaer <sean@geanix.com>
>
> Reviewed-by: Vincent Mailhol <mailhol.vincent@wanadoo.fr>
>
>
> Yours sincerely,
> Vincent Mailhol
>
/Sean
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] can: m_can: apply rate-limiting to lost msg in rx
2025-06-26 13:45 ` Sean Nyekjaer
@ 2025-06-26 13:57 ` Marc Kleine-Budde
2025-06-26 14:46 ` Vincent Mailhol
0 siblings, 1 reply; 5+ messages in thread
From: Marc Kleine-Budde @ 2025-06-26 13:57 UTC (permalink / raw)
To: Sean Nyekjaer
Cc: Vincent Mailhol, linux-can, linux-kernel,
Chandrasekar Ramakrishnan, Fengguang Wu, Varka Bhadram,
Dong Aisheng
[-- Attachment #1: Type: text/plain, Size: 1032 bytes --]
On 26.06.2025 13:45:09, Sean Nyekjaer wrote:
> Hi,
>
> On Sat, Jun 21, 2025 at 11:13:33AM +0100, Vincent Mailhol wrote:
> > On 20/06/2025 at 19:00, Sean Nyekjaer wrote:
> > > Wrap the "msg lost in rxf0" error in m_can_handle_lost_msg() with
> > > a call to net_ratelimit() to prevent flooding the kernel log
> > > with repeated error messages.
> >
> > Note that another solution is to simply remove the error message. The users can
> > use the CAN error frames or the netstasts instead to see if lost messages occurred.
> >
> > That said, I am OK with your proposed patch. See above comment as a simple FYI.
>
> I'm up for both solutions :)
>
> @Marc what would you prefer?
If it is my call, then make it a netdev_dbg();
regards,
Marc
--
Pengutronix e.K. | Marc Kleine-Budde |
Embedded Linux | https://www.pengutronix.de |
Vertretung Nürnberg | Phone: +49-5121-206917-129 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-9 |
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] can: m_can: apply rate-limiting to lost msg in rx
2025-06-26 13:57 ` Marc Kleine-Budde
@ 2025-06-26 14:46 ` Vincent Mailhol
0 siblings, 0 replies; 5+ messages in thread
From: Vincent Mailhol @ 2025-06-26 14:46 UTC (permalink / raw)
To: Marc Kleine-Budde, Sean Nyekjaer
Cc: linux-can, linux-kernel, Chandrasekar Ramakrishnan, Fengguang Wu,
Varka Bhadram, Dong Aisheng
On 26/06/2025 at 22:57, Marc Kleine-Budde wrote:
> On 26.06.2025 13:45:09, Sean Nyekjaer wrote:
>> Hi,
>>
>> On Sat, Jun 21, 2025 at 11:13:33AM +0100, Vincent Mailhol wrote:
>>> On 20/06/2025 at 19:00, Sean Nyekjaer wrote:
>>>> Wrap the "msg lost in rxf0" error in m_can_handle_lost_msg() with
>>>> a call to net_ratelimit() to prevent flooding the kernel log
>>>> with repeated error messages.
>>>
>>> Note that another solution is to simply remove the error message. The users can
>>> use the CAN error frames or the netstasts instead to see if lost messages occurred.
>>>
>>> That said, I am OK with your proposed patch. See above comment as a simple FYI.
>>
>> I'm up for both solutions :)
>>
>> @Marc what would you prefer?
>
> If it is my call, then make it a netdev_dbg();
I am also OK with that :)
Yours sincerely,
Vincent Mailhol
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2025-06-26 14:56 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-06-20 10:00 [PATCH] can: m_can: apply rate-limiting to lost msg in rx Sean Nyekjaer
2025-06-21 2:13 ` Vincent Mailhol
2025-06-26 13:45 ` Sean Nyekjaer
2025-06-26 13:57 ` Marc Kleine-Budde
2025-06-26 14:46 ` Vincent Mailhol
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).