# Re: \[PATCH net-next 6/7\] can: add drop reasons in the receive path of AF\_CAN

- From: Davide Caratti \<hidden\>
- Date: 2025-06-11 11:39:57 
- List: netdev
- Page: https://ratatoskr.run/netdev/2025/06/9360715
- Thread: https://ratatoskr.run/netdev/2025/06/9360702/t.md

```text
On Tue, Jun 10, 2025 at 03:50:39PM -0700, Jakub Kicinski wrote:
> On Tue, 10 Jun 2025 11:46:21 +0200 Marc Kleine-Budde wrote:
> > Besides the existing pr_warn_once(), use skb drop reasons in case AF_CAN
> > layer drops non-conformant CAN{,FD,XL} frames, or conformant frames
> > received by "wrong" devices, so that it's possible to debug (and count)
> > such events using existing tracepoints:
> 
> Hm, I wonder if the protocol is really the most useful way 
> to categorize. Does it actually help to identify problems on
> production systems?
> 
> AFAIU we try to categorize by drop condition. So given the condition
> is:
> 
> 	if (unlikely(dev->type != ARPHRD_CAN || !can_get_ml_priv(dev) || !can_is_canfd_skb(skb))) 
> 
> my intuition would be to split this into two: "not a CAN device" and
> "invalid CAN frame". 

hello,

yes, that makes sense: I will post a follow-up patch soon.

thanks,
-- 
davide

```
