[PATCH net-next 0/3] net: gre: add skb drop reasons to gre packet receive

menglong8.dong@gmail.com posted 3 patches 4 years, 3 months ago
include/linux/skbuff.h     |  6 ++++++
include/trace/events/skb.h |  4 ++++
net/ipv4/gre_demux.c       | 12 +++++++++---
net/ipv4/ip_gre.c          | 30 +++++++++++++++++++-----------
4 files changed, 38 insertions(+), 14 deletions(-)
[PATCH net-next 0/3] net: gre: add skb drop reasons to gre packet receive
Posted by menglong8.dong@gmail.com 4 years, 3 months ago
From: Menglong Dong <imagedong@tencent.com>

In the commit c504e5c2f964 ("net: skb: introduce kfree_skb_reason()"),
we added the support of reporting the reasons of skb drops to kfree_skb
tracepoint. And in this series patches, reasons for skb drops are added
to gre packet receiving path.

gre_rcv() in gre_demux.c is handled in the 1th patch.

In order to report skb drop reasons, we make erspan_rcv() return
PACKET_NEXT when no tunnel device found in the 2th patch. This may don't
correspond to 'PACKET_NEXT', but don't matter.

And gre_rcv() in ip_gre.c is handled in the 3th patch.

Following drop reasons are added(what they mean can be see in the
document for them):

SKB_DROP_REASON_GRE_VERSION
SKB_DROP_REASON_GRE_NOHANDLER
SKB_DROP_REASON_GRE_CSUM
SKB_DROP_REASON_GRE_NOTUNNEL

Maybe SKB_DROP_REASON_GRE_NOHANDLER can be replaced with
SKB_DROP_REASON_GRE_VERSION? As no gre_protocol found means that gre
version not supported.

PS: This set is parallel with the set "net: icmp: add skb drop reasons
to icmp", please don't mind :)

Menglong Dong (3):
  net: gre_demux: add skb drop reasons to gre_rcv()
  net: ipgre: make erspan_rcv() return PACKET_NEXT
  net: ipgre: add skb drop reasons to gre_rcv()

 include/linux/skbuff.h     |  6 ++++++
 include/trace/events/skb.h |  4 ++++
 net/ipv4/gre_demux.c       | 12 +++++++++---
 net/ipv4/ip_gre.c          | 30 +++++++++++++++++++-----------
 4 files changed, 38 insertions(+), 14 deletions(-)

-- 
2.35.1