Traditionally USB drivers used netif_rx to pass the received CAN frames/skbs to the network stack. In netif_rx() the skbs are queued to the local CPU. If IRQs are handled in round robin, CAN frames may be delivered out-of-order to user space. To support devices without timestamping the TX path of the rx-offload helper is cleaned up and extended: - rename rx_offload_get_echo_skb() -> can_rx_offload_get_echo_skb_queue_timestamp() - add can_rx_offload_get_echo_skb_queue_tail() The last patch converts the gs_usb driver to NAPI with the rx-offload helper. This series depends on the gs_usb cleanup series: https://lore.kernel.org/all/20230718-gs_usb-cleanups-v1-0-c3b9154ec605@xxxxxxxxxxxxxx Link: https://lore.kernel.org/all/559D628C.5020100@xxxxxxxxxxxx Link: https://github.com/candle-usb/candleLight_fw/issues/166 Signed-off-by: Marc Kleine-Budde <mkl@xxxxxxxxxxxxxx> --- Changes in v2: - move cleanup patches into separate series: https://lore.kernel.org/all/20230718-gs_usb-cleanups-v1-0-c3b9154ec605@xxxxxxxxxxxxxx - use GS_NAPI_WEIGHT instead of hard coded 32 - move can_rx_offload_add_manual()/can_rx_offload_del() to gs_make_candev()/gs_destroy_candev() - Link to v1: https://lore.kernel.org/all/20230705-gs_usb-rx-offload-v1-0-8e7e46e40137@xxxxxxxxxxxxxx --- Marc Kleine-Budde (3): can: rx-offload: rename rx_offload_get_echo_skb() -> can_rx_offload_get_echo_skb_queue_timestamp() can: rx-offload: add can_rx_offload_get_echo_skb_queue_tail() can: gs_usb: convert to NAPI/rx-offload to avoid OoO reception drivers/net/can/dev/rx-offload.c | 36 ++++++++++-- drivers/net/can/flexcan/flexcan-core.c | 4 +- drivers/net/can/m_can/m_can.c | 8 +-- drivers/net/can/spi/mcp251xfd/mcp251xfd-tef.c | 6 +- drivers/net/can/ti_hecc.c | 4 +- drivers/net/can/usb/Kconfig | 1 + drivers/net/can/usb/gs_usb.c | 85 +++++++++++++++++++++------ include/linux/can/rx-offload.h | 11 ++-- 8 files changed, 116 insertions(+), 39 deletions(-) --- base-commit: 59062ea9b7dc0bc8d6f0bb03283d8c6fb170f6da change-id: 20230705-gs_usb-rx-offload-722d22567d68 Best regards, -- Marc Kleine-Budde <mkl@xxxxxxxxxxxxxx>