Linux CAN drivers development
 help / color / mirror / Atom feed
* Debugging dropped/missing frames in the network layer
@ 2022-08-09 12:30 Magnus Aagaard Sørensen
  2022-08-09 12:45 ` Marc Kleine-Budde
  0 siblings, 1 reply; 2+ messages in thread
From: Magnus Aagaard Sørensen @ 2022-08-09 12:30 UTC (permalink / raw)
  To: linux-can

I am working with an out-of-tree kernel driver which maps LIN messages 
via a UART onto the CAN networking stack, to allow for using the regular 
CAN tools to also work with LIN messages (The driver in question is 
sllin, https://github.com/lin-bus/linux-lin/, based on slcan from what I 
understand).

During use, I see a lot of frames missing from the output. From 
debugging the module, I can see that the kernel module receive the 
messages as expected, but they never show up in user space using 
candump. I can trace the messages in the module to the hand-off to the 
networking stack via a netif_rx call.

Are there any additional handles in the networking/CAN stack to show me 
where the missing frames are being discarded before reaching user space, 
or which could otherwise help me narrow down the origin of this issue? 
The frames are transmitted from a custom/third party device at 19200 
kbps and with 100 ms spacing.

Hardware on the Linux side is a Raspberry Pi 4 running kernel 5.15.56 in 
64 bit mode.

Regards, Magnus.


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Debugging dropped/missing frames in the network layer
  2022-08-09 12:30 Debugging dropped/missing frames in the network layer Magnus Aagaard Sørensen
@ 2022-08-09 12:45 ` Marc Kleine-Budde
  0 siblings, 0 replies; 2+ messages in thread
From: Marc Kleine-Budde @ 2022-08-09 12:45 UTC (permalink / raw)
  To: Magnus Aagaard Sørensen; +Cc: linux-can

[-- Attachment #1: Type: text/plain, Size: 1543 bytes --]

On 09.08.2022 14:30:43, Magnus Aagaard Sørensen wrote:
> I am working with an out-of-tree kernel driver which maps LIN messages via a
> UART onto the CAN networking stack, to allow for using the regular CAN tools
> to also work with LIN messages (The driver in question is sllin,
> https://github.com/lin-bus/linux-lin/, based on slcan from what I
> understand).

FYI: in net-next/main the slcan driver has undergone a major cleanup.

> During use, I see a lot of frames missing from the output. From debugging
> the module, I can see that the kernel module receive the messages as
> expected, but they never show up in user space using candump. I can trace
> the messages in the module to the hand-off to the networking stack via a
> netif_rx call.
> 
> Are there any additional handles in the networking/CAN stack to show me
> where the missing frames are being discarded before reaching user space, or
> which could otherwise help me narrow down the origin of this issue? The
> frames are transmitted from a custom/third party device at 19200 kbps and
> with 100 ms spacing.

Try running candump with -d.

| -d     (monitor dropped CAN frames)

> Hardware on the Linux side is a Raspberry Pi 4 running kernel 5.15.56 in 64
> bit mode.

Marc
-- 
Pengutronix e.K.                 | Marc Kleine-Budde           |
Embedded Linux                   | https://www.pengutronix.de  |
Vertretung West/Dortmund         | Phone: +49-231-2826-924     |
Amtsgericht Hildesheim, HRA 2686 | Fax:   +49-5121-206917-5555 |

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-08-09 12:45 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-08-09 12:30 Debugging dropped/missing frames in the network layer Magnus Aagaard Sørensen
2022-08-09 12:45 ` Marc Kleine-Budde

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox