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

net: Prepare gro for packet consuming gro callbacks

The upcomming IPsec ESP gro callbacks will consume the skb,
so prepare for that.

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

+20
+9
include/linux/netdevice.h
··· 352 352 GRO_HELD, 353 353 GRO_NORMAL, 354 354 GRO_DROP, 355 + GRO_CONSUMED, 355 356 }; 356 357 typedef enum gro_result gro_result_t; 357 358 ··· 2662 2661 remcsum_unadjust((__sum16 *)ptr, grc->delta); 2663 2662 } 2664 2663 2664 + #ifdef CONFIG_XFRM_OFFLOAD 2665 + static inline void skb_gro_flush_final(struct sk_buff *skb, struct sk_buff **pp, int flush) 2666 + { 2667 + if (PTR_ERR(pp) != -EINPROGRESS) 2668 + NAPI_GRO_CB(skb)->flush |= flush; 2669 + } 2670 + #else 2665 2671 static inline void skb_gro_flush_final(struct sk_buff *skb, struct sk_buff **pp, int flush) 2666 2672 { 2667 2673 NAPI_GRO_CB(skb)->flush |= flush; 2668 2674 } 2675 + #endif 2669 2676 2670 2677 static inline int dev_hard_header(struct sk_buff *skb, struct net_device *dev, 2671 2678 unsigned short type,
+7
net/core/dev.c
··· 4505 4505 if (&ptype->list == head) 4506 4506 goto normal; 4507 4507 4508 + if (IS_ERR(pp) && PTR_ERR(pp) == -EINPROGRESS) { 4509 + ret = GRO_CONSUMED; 4510 + goto ok; 4511 + } 4512 + 4508 4513 same_flow = NAPI_GRO_CB(skb)->same_flow; 4509 4514 ret = NAPI_GRO_CB(skb)->free ? GRO_MERGED_FREE : GRO_MERGED; 4510 4515 ··· 4614 4609 4615 4610 case GRO_HELD: 4616 4611 case GRO_MERGED: 4612 + case GRO_CONSUMED: 4617 4613 break; 4618 4614 } 4619 4615 ··· 4686 4680 break; 4687 4681 4688 4682 case GRO_MERGED: 4683 + case GRO_CONSUMED: 4689 4684 break; 4690 4685 } 4691 4686
+4
net/xfrm/Kconfig
··· 5 5 bool 6 6 depends on NET 7 7 8 + config XFRM_OFFLOAD 9 + bool 10 + depends on XFRM 11 + 8 12 config XFRM_ALGO 9 13 tristate 10 14 select XFRM