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>
This commit is contained in:
Steffen Klassert 2017-02-15 09:39:39 +01:00
parent b0fcee825c
commit 5f114163f2
4 changed files with 8 additions and 3 deletions

View File

@ -2661,6 +2661,11 @@ static inline void skb_gro_remcsum_cleanup(struct sk_buff *skb,
remcsum_unadjust((__sum16 *)ptr, grc->delta); remcsum_unadjust((__sum16 *)ptr, grc->delta);
} }
static inline void skb_gro_flush_final(struct sk_buff *skb, struct sk_buff **pp, int flush)
{
NAPI_GRO_CB(skb)->flush |= flush;
}
static inline int dev_hard_header(struct sk_buff *skb, struct net_device *dev, static inline int dev_hard_header(struct sk_buff *skb, struct net_device *dev,
unsigned short type, unsigned short type,
const void *daddr, const void *saddr, const void *daddr, const void *saddr,

View File

@ -474,7 +474,7 @@ struct sk_buff **eth_gro_receive(struct sk_buff **head,
out_unlock: out_unlock:
rcu_read_unlock(); rcu_read_unlock();
out: out:
NAPI_GRO_CB(skb)->flush |= flush; skb_gro_flush_final(skb, pp, flush);
return pp; return pp;
} }

View File

@ -1423,7 +1423,7 @@ out_unlock:
rcu_read_unlock(); rcu_read_unlock();
out: out:
NAPI_GRO_CB(skb)->flush |= flush; skb_gro_flush_final(skb, pp, flush);
return pp; return pp;
} }

View File

@ -253,7 +253,7 @@ out_unlock:
rcu_read_unlock(); rcu_read_unlock();
out: out:
NAPI_GRO_CB(skb)->flush |= flush; skb_gro_flush_final(skb, pp, flush);
return pp; return pp;
} }