lkml.org 
[lkml]   [2022]   [Feb]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH net-next v4 4/4] net: tun: track dropped skb via kfree_skb_reason()
From
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@oracle.com>
> Cc: Joe Jin <joe.jin@oracle.com>
> Signed-off-by: Dongli Zhang <dongli.zhang@oracle.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@kernel.org>

\
 
 \ /
  Last update: 2022-02-28 02:21    [W:0.140 / U:0.012 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site