• Dongli Zhang's avatar
    net: tap: track dropped skb via kfree_skb_reason() · 736f16de
    Dongli Zhang authored
    The TAP can be used as vhost-net backend. E.g., the tap_handle_frame() is
    the interface to forward the skb from TAP to vhost-net/virtio-net.
    
    However, there are many "goto drop" in the TAP 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_CSUM
    - SKB_DROP_REASON_SKB_GSO_SEG
    - SKB_DROP_REASON_SKB_UCOPY_FAULT
    - SKB_DROP_REASON_DEV_HDR
    - SKB_DROP_REASON_FULL_RING
    
    Cc: Joao Martins <joao.m.martins@oracle.com>
    Cc: Joe Jin <joe.jin@oracle.com>
    Signed-off-by: default avatarDongli Zhang <dongli.zhang@oracle.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    736f16de
tap.c 30.5 KB