Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

gre: Count GRE packet drops

GRE is silently dropping packets without updating statistics.

In case of drop, increment rx_dropped counter to provide visibility into
packet loss. For the case where no GRE protocol handler is registered,
use rx_nohandler.

Reviewed-by: Dragos Tatulea <dtatulea@nvidia.com>
Reviewed-by: Nimrod Oren <noren@nvidia.com>
Signed-off-by: Gal Pressman <gal@nvidia.com>
Link: https://patch.msgid.link/20260409090945.1542440-1-gal@nvidia.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

authored by

Gal Pressman and committed by
Jakub Kicinski
8632175c 4e17b9b4

+8 -2
+6 -2
net/ipv4/gre_demux.c
··· 159 159 rcu_read_lock(); 160 160 proto = rcu_dereference(gre_proto[ver]); 161 161 if (!proto || !proto->handler) 162 - goto drop_unlock; 162 + goto drop_nohandler; 163 163 ret = proto->handler(skb); 164 164 rcu_read_unlock(); 165 165 return ret; 166 166 167 - drop_unlock: 167 + drop_nohandler: 168 168 rcu_read_unlock(); 169 + dev_core_stats_rx_nohandler_inc(skb->dev); 170 + kfree_skb(skb); 171 + return NET_RX_DROP; 169 172 drop: 173 + dev_core_stats_rx_dropped_inc(skb->dev); 170 174 kfree_skb(skb); 171 175 return NET_RX_DROP; 172 176 }
+1
net/ipv4/ip_gre.c
··· 468 468 out: 469 469 icmp_send(skb, ICMP_DEST_UNREACH, ICMP_PORT_UNREACH, 0); 470 470 drop: 471 + dev_core_stats_rx_dropped_inc(skb->dev); 471 472 kfree_skb(skb); 472 473 return 0; 473 474 }
+1
net/ipv6/ip6_gre.c
··· 593 593 out: 594 594 icmpv6_send(skb, ICMPV6_DEST_UNREACH, ICMPV6_PORT_UNREACH, 0); 595 595 drop: 596 + dev_core_stats_rx_dropped_inc(skb->dev); 596 597 kfree_skb(skb); 597 598 return 0; 598 599 }