Re: [PATCH net-next] net-core: add InMacErrors counter

From: Jakub Kicinski
Date: Fri Jan 21 2022 - 22:41:17 EST


On Sat, 22 Jan 2022 00:03:01 +0000 Jeffrey Ji wrote:
> From: jeffreyji <jeffreyji@xxxxxxxxxx>
>
> Increment InMacErrors counter when packet dropped due to incorrect dest
> MAC addr.
>
> example output from nstat:
> \~# nstat -z "*InMac*"
> \#kernel
> Ip6InMacErrors 0 0.0
> IpExtInMacErrors 1 0.0
>
> Tested: Created 2 netns, sent 1 packet using trafgen from 1 to the other
> with "{eth(daddr=$INCORRECT_MAC...}", verified that nstat showed the
> counter was incremented.
>
> Signed-off-by: jeffreyji <jeffreyji@xxxxxxxxxx>

How about we use the new kfree_skb_reason() instead to avoid allocating
per-netns memory the stats?