aboutsummaryrefslogtreecommitdiffstats
path: root/net/core/dev.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/core/dev.c')
-rw-r--r--net/core/dev.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/net/core/dev.c b/net/core/dev.c
index b1722a2d1fb..cd29e613bc5 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -2590,17 +2590,24 @@ struct sk_buff *napi_frags_skb(struct napi_struct *napi)
2590{ 2590{
2591 struct sk_buff *skb = napi->skb; 2591 struct sk_buff *skb = napi->skb;
2592 struct ethhdr *eth; 2592 struct ethhdr *eth;
2593 unsigned int hlen;
2594 unsigned int off;
2593 2595
2594 napi->skb = NULL; 2596 napi->skb = NULL;
2595 2597
2596 skb_reset_mac_header(skb); 2598 skb_reset_mac_header(skb);
2597 skb_gro_reset_offset(skb); 2599 skb_gro_reset_offset(skb);
2598 2600
2599 eth = skb_gro_header(skb, sizeof(*eth)); 2601 off = skb_gro_offset(skb);
2600 if (!eth) { 2602 hlen = off + sizeof(*eth);
2601 napi_reuse_skb(napi, skb); 2603 eth = skb_gro_header_fast(skb, off);
2602 skb = NULL; 2604 if (skb_gro_header_hard(skb, hlen)) {
2603 goto out; 2605 eth = skb_gro_header_slow(skb, hlen, off);
2606 if (unlikely(!eth)) {
2607 napi_reuse_skb(napi, skb);
2608 skb = NULL;
2609 goto out;
2610 }
2604 } 2611 }
2605 2612
2606 skb_gro_pull(skb, sizeof(*eth)); 2613 skb_gro_pull(skb, sizeof(*eth));