[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <acdce090-dfa6-5449-ae7c-cfd0dde46aa2@kernel.org>
Date: Sun, 27 Feb 2022 18:20:23 -0700
From: David Ahern <dsahern@...nel.org>
To: Dongli Zhang <dongli.zhang@...cle.com>, netdev@...r.kernel.org,
bpf@...r.kernel.org
Cc: linux-kernel@...r.kernel.org, davem@...emloft.net, kuba@...nel.org,
rostedt@...dmis.org, mingo@...hat.com, ast@...nel.org,
daniel@...earbox.net, andrii@...nel.org, imagedong@...cent.com,
joao.m.martins@...cle.com, joe.jin@...cle.com, edumazet@...gle.com
Subject: Re: [PATCH net-next v4 4/4] net: tun: track dropped skb via
kfree_skb_reason()
On 2/26/22 1:49 AM, Dongli Zhang wrote:
> The TUN can be used as vhost-net backend. E.g, the tun_net_xmit() is the
> interface to forward the skb from TUN to vhost-net/virtio-net.
>
> However, there are many "goto drop" in the TUN driver. Therefore, the
> kfree_skb_reason() is involved at each "goto drop" to help userspace
> ftrace/ebpf to track the reason for the loss of packets.
>
> The below reasons are introduced:
>
> - SKB_DROP_REASON_SKB_PULL
> - SKB_DROP_REASON_SKB_TRIM
> - SKB_DROP_REASON_DEV_READY
> - SKB_DROP_REASON_TAP_FILTER
> - SKB_DROP_REASON_TAP_TXFILTER
>
> Cc: Joao Martins <joao.m.martins@...cle.com>
> Cc: Joe Jin <joe.jin@...cle.com>
> Signed-off-by: Dongli Zhang <dongli.zhang@...cle.com>
> ---
> Changed since v1:
> - revise the reason name
> Changed since v2:
> - declare drop_reason as type "enum skb_drop_reason"
> Changed since v3:
> - rename to TAP_FILTER and TAP_TXFILTER
> - honor reverse xmas tree style declaration for 'drop_reason' in
> tun_net_xmit()
>
> drivers/net/tun.c | 37 ++++++++++++++++++++++++++++---------
> include/linux/skbuff.h | 10 ++++++++++
> include/trace/events/skb.h | 5 +++++
> 3 files changed, 43 insertions(+), 9 deletions(-)
>
Reviewed-by: David Ahern <dsahern@...nel.org>
Powered by blists - more mailing lists