Hello, picking up Oleksij's work. While reviewing the patch "can: rx-offload: introduce can_rx_offload_get_echo_skb() and can_rx_offload_queue_sorted() functions", I noticed some code duplication from the can_get_echo_skb() function. I created the first 4 patches to factor out the non skb sending code from can_get_echo_skb() into a seperate function, so that it can be re-used in can_rx_offload_get_echo_skb(). Further I improved the error handling in __can_get_echo_skb() by replacing a BUG() by a netdev_err() and introducing a netdev_err() for a error condition previously silently ignored. Here's Oleksij's original cover letter: --------->8-------->8-------->8-------->8-------->8-------->8-------->8------- Some applications (fox example J1939 stack) listen on CAN bus an use TX-ECHO and RX packages. The order of this messages should be correct. Current Linux CAN implementation do not guarantee correct order of RX and TX-ECHO package. The same is with CAN bus status messages. This patches extend the CAN framework and fixes this issue for the flexcan driver. Other driver still can be affected. The test is available on this branch: https://github.com/olerem/can-utils/commits/canfdtest-2018.09.18 The test setup should have two peers: slave and master. The master peer will be tested, the slave is needed only to response to the traffic generated on the master peer. run on slave: canfdtest -v can0 run on master: canfdtest -v -g can0 & while(true); do chrt 50 dd if=/dev/zero of=/dev/null count=10000 status=none; done The master peer should have enough system load to increase probability of unsorted packages. --------->8-------->8-------->8-------->8-------->8-------->8-------->8------- Marc