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

net: Add a skb_gro_flush_final helper.

Add a skb_gro_flush_final helper to prepare for consuming
skbs in call_gro_receive. We will extend this helper to not
touch the skb if the skb is consumed by a gro callback with
a followup patch. We need this to handle the upcomming IPsec
ESP callbacks as they reinject the skb to the napi_gro_receive
asynchronous. The handler is used in all gro_receive functions
that can call the ESP gro handlers.

Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>

+8 -3
+5
include/linux/netdevice.h
··· 2661 2661 remcsum_unadjust((__sum16 *)ptr, grc->delta); 2662 2662 } 2663 2663 2664 + static inline void skb_gro_flush_final(struct sk_buff *skb, struct sk_buff **pp, int flush) 2665 + { 2666 + NAPI_GRO_CB(skb)->flush |= flush; 2667 + } 2668 + 2664 2669 static inline int dev_hard_header(struct sk_buff *skb, struct net_device *dev, 2665 2670 unsigned short type, 2666 2671 const void *daddr, const void *saddr,
+1 -1
net/ethernet/eth.c
··· 474 474 out_unlock: 475 475 rcu_read_unlock(); 476 476 out: 477 - NAPI_GRO_CB(skb)->flush |= flush; 477 + skb_gro_flush_final(skb, pp, flush); 478 478 479 479 return pp; 480 480 }
+1 -1
net/ipv4/af_inet.c
··· 1423 1423 rcu_read_unlock(); 1424 1424 1425 1425 out: 1426 - NAPI_GRO_CB(skb)->flush |= flush; 1426 + skb_gro_flush_final(skb, pp, flush); 1427 1427 1428 1428 return pp; 1429 1429 }
+1 -1
net/ipv6/ip6_offload.c
··· 253 253 rcu_read_unlock(); 254 254 255 255 out: 256 - NAPI_GRO_CB(skb)->flush |= flush; 256 + skb_gro_flush_final(skb, pp, flush); 257 257 258 258 return pp; 259 259 }