]> git.itanic.dy.fi Git - linux-stable/commit
can: gs_usb: convert to NAPI/rx-offload to avoid OoO reception
authorMarc Kleine-Budde <mkl@pengutronix.de>
Fri, 2 Jun 2023 07:29:07 +0000 (09:29 +0200)
committerMarc Kleine-Budde <mkl@pengutronix.de>
Fri, 28 Jul 2023 07:45:25 +0000 (09:45 +0200)
commit24bc41b4558347672a3db61009c339b1f5692169
tree7570ccd9412a428d8c477b9c761c62701f6e91b7
parent8e0e2950c9ef48f7f40a7175048744ec2390b16e
can: gs_usb: convert to NAPI/rx-offload to avoid OoO reception

The driver used to pass received CAN frames/skbs to the network stack
with netif_rx(). In netif_rx() the skbs are queued to the local CPU.
If IRQs are handled in round robin, OoO packets may occur.

To avoid out-of-order reception convert the driver from netif_rx() to
NAPI.

For USB devices with timestamping support use the rx-offload helper
can_rx_offload_queue_timestamp() for the RX, and
can_rx_offload_get_echo_skb_queue_timestamp() for the TX path. Devices
without timestamping support use can_rx_offload_queue_tail() for RX,
and can_rx_offload_get_echo_skb_queue_tail() for the TX path.

Link: https://lore.kernel.org/all/559D628C.5020100@hartkopp.net
Link: https://github.com/candle-usb/candleLight_fw/issues/166
Link: https://lore.kernel.org/all/20230718-gs_usb-rx-offload-v2-3-716e542d14d5@pengutronix.de
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
drivers/net/can/usb/Kconfig
drivers/net/can/usb/gs_usb.c