Skip to content

Commit 5f11416

Browse files
committed
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 <[email protected]>
1 parent b0fcee8 commit 5f11416

File tree

4 files changed

+8
-3
lines changed

4 files changed

+8
-3
lines changed

include/linux/netdevice.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2661,6 +2661,11 @@ static inline void skb_gro_remcsum_cleanup(struct sk_buff *skb,
26612661
remcsum_unadjust((__sum16 *)ptr, grc->delta);
26622662
}
26632663

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+
26642669
static inline int dev_hard_header(struct sk_buff *skb, struct net_device *dev,
26652670
unsigned short type,
26662671
const void *daddr, const void *saddr,

net/ethernet/eth.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -474,7 +474,7 @@ struct sk_buff **eth_gro_receive(struct sk_buff **head,
474474
out_unlock:
475475
rcu_read_unlock();
476476
out:
477-
NAPI_GRO_CB(skb)->flush |= flush;
477+
skb_gro_flush_final(skb, pp, flush);
478478

479479
return pp;
480480
}

net/ipv4/af_inet.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1423,7 +1423,7 @@ struct sk_buff **inet_gro_receive(struct sk_buff **head, struct sk_buff *skb)
14231423
rcu_read_unlock();
14241424

14251425
out:
1426-
NAPI_GRO_CB(skb)->flush |= flush;
1426+
skb_gro_flush_final(skb, pp, flush);
14271427

14281428
return pp;
14291429
}

net/ipv6/ip6_offload.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ static struct sk_buff **ipv6_gro_receive(struct sk_buff **head,
253253
rcu_read_unlock();
254254

255255
out:
256-
NAPI_GRO_CB(skb)->flush |= flush;
256+
skb_gro_flush_final(skb, pp, flush);
257257

258258
return pp;
259259
}

0 commit comments

Comments
 (0)