diff options
Diffstat (limited to 'net/core')
| -rw-r--r-- | net/core/dev.c | 2 | ||||
| -rw-r--r-- | net/core/gen_estimator.c | 12 | ||||
| -rw-r--r-- | net/core/skbuff.c | 8 |
3 files changed, 13 insertions, 9 deletions
diff --git a/net/core/dev.c b/net/core/dev.c index 1ae654391442..3721fbb9a83c 100644 --- a/net/core/dev.c +++ b/net/core/dev.c | |||
| @@ -3143,7 +3143,7 @@ pull: | |||
| 3143 | put_page(skb_shinfo(skb)->frags[0].page); | 3143 | put_page(skb_shinfo(skb)->frags[0].page); |
| 3144 | memmove(skb_shinfo(skb)->frags, | 3144 | memmove(skb_shinfo(skb)->frags, |
| 3145 | skb_shinfo(skb)->frags + 1, | 3145 | skb_shinfo(skb)->frags + 1, |
| 3146 | --skb_shinfo(skb)->nr_frags); | 3146 | --skb_shinfo(skb)->nr_frags * sizeof(skb_frag_t)); |
| 3147 | } | 3147 | } |
| 3148 | } | 3148 | } |
| 3149 | 3149 | ||
diff --git a/net/core/gen_estimator.c b/net/core/gen_estimator.c index 9fbe7f7429b0..6743146e4d6b 100644 --- a/net/core/gen_estimator.c +++ b/net/core/gen_estimator.c | |||
| @@ -232,7 +232,7 @@ int gen_new_estimator(struct gnet_stats_basic_packed *bstats, | |||
| 232 | est->last_packets = bstats->packets; | 232 | est->last_packets = bstats->packets; |
| 233 | est->avpps = rate_est->pps<<10; | 233 | est->avpps = rate_est->pps<<10; |
| 234 | 234 | ||
| 235 | spin_lock(&est_tree_lock); | 235 | spin_lock_bh(&est_tree_lock); |
| 236 | if (!elist[idx].timer.function) { | 236 | if (!elist[idx].timer.function) { |
| 237 | INIT_LIST_HEAD(&elist[idx].list); | 237 | INIT_LIST_HEAD(&elist[idx].list); |
| 238 | setup_timer(&elist[idx].timer, est_timer, idx); | 238 | setup_timer(&elist[idx].timer, est_timer, idx); |
| @@ -243,7 +243,7 @@ int gen_new_estimator(struct gnet_stats_basic_packed *bstats, | |||
| 243 | 243 | ||
| 244 | list_add_rcu(&est->list, &elist[idx].list); | 244 | list_add_rcu(&est->list, &elist[idx].list); |
| 245 | gen_add_node(est); | 245 | gen_add_node(est); |
| 246 | spin_unlock(&est_tree_lock); | 246 | spin_unlock_bh(&est_tree_lock); |
| 247 | 247 | ||
| 248 | return 0; | 248 | return 0; |
| 249 | } | 249 | } |
| @@ -270,7 +270,7 @@ void gen_kill_estimator(struct gnet_stats_basic_packed *bstats, | |||
| 270 | { | 270 | { |
| 271 | struct gen_estimator *e; | 271 | struct gen_estimator *e; |
| 272 | 272 | ||
| 273 | spin_lock(&est_tree_lock); | 273 | spin_lock_bh(&est_tree_lock); |
| 274 | while ((e = gen_find_node(bstats, rate_est))) { | 274 | while ((e = gen_find_node(bstats, rate_est))) { |
| 275 | rb_erase(&e->node, &est_root); | 275 | rb_erase(&e->node, &est_root); |
| 276 | 276 | ||
| @@ -281,7 +281,7 @@ void gen_kill_estimator(struct gnet_stats_basic_packed *bstats, | |||
| 281 | list_del_rcu(&e->list); | 281 | list_del_rcu(&e->list); |
| 282 | call_rcu(&e->e_rcu, __gen_kill_estimator); | 282 | call_rcu(&e->e_rcu, __gen_kill_estimator); |
| 283 | } | 283 | } |
| 284 | spin_unlock(&est_tree_lock); | 284 | spin_unlock_bh(&est_tree_lock); |
| 285 | } | 285 | } |
| 286 | EXPORT_SYMBOL(gen_kill_estimator); | 286 | EXPORT_SYMBOL(gen_kill_estimator); |
| 287 | 287 | ||
| @@ -320,9 +320,9 @@ bool gen_estimator_active(const struct gnet_stats_basic_packed *bstats, | |||
| 320 | 320 | ||
| 321 | ASSERT_RTNL(); | 321 | ASSERT_RTNL(); |
| 322 | 322 | ||
| 323 | spin_lock(&est_tree_lock); | 323 | spin_lock_bh(&est_tree_lock); |
| 324 | res = gen_find_node(bstats, rate_est) != NULL; | 324 | res = gen_find_node(bstats, rate_est) != NULL; |
| 325 | spin_unlock(&est_tree_lock); | 325 | spin_unlock_bh(&est_tree_lock); |
| 326 | 326 | ||
| 327 | return res; | 327 | return res; |
| 328 | } | 328 | } |
diff --git a/net/core/skbuff.c b/net/core/skbuff.c index 3a2513f0d0c3..26396ff67cf9 100644 --- a/net/core/skbuff.c +++ b/net/core/skbuff.c | |||
| @@ -2573,6 +2573,10 @@ struct sk_buff *skb_segment(struct sk_buff *skb, int features) | |||
| 2573 | __copy_skb_header(nskb, skb); | 2573 | __copy_skb_header(nskb, skb); |
| 2574 | nskb->mac_len = skb->mac_len; | 2574 | nskb->mac_len = skb->mac_len; |
| 2575 | 2575 | ||
| 2576 | /* nskb and skb might have different headroom */ | ||
| 2577 | if (nskb->ip_summed == CHECKSUM_PARTIAL) | ||
| 2578 | nskb->csum_start += skb_headroom(nskb) - headroom; | ||
| 2579 | |||
| 2576 | skb_reset_mac_header(nskb); | 2580 | skb_reset_mac_header(nskb); |
| 2577 | skb_set_network_header(nskb, skb->mac_len); | 2581 | skb_set_network_header(nskb, skb->mac_len); |
| 2578 | nskb->transport_header = (nskb->network_header + | 2582 | nskb->transport_header = (nskb->network_header + |
| @@ -2702,8 +2706,8 @@ int skb_gro_receive(struct sk_buff **head, struct sk_buff *skb) | |||
| 2702 | } else if (skb_gro_len(p) != pinfo->gso_size) | 2706 | } else if (skb_gro_len(p) != pinfo->gso_size) |
| 2703 | return -E2BIG; | 2707 | return -E2BIG; |
| 2704 | 2708 | ||
| 2705 | headroom = skb_headroom(p); | 2709 | headroom = NET_SKB_PAD + NET_IP_ALIGN; |
| 2706 | nskb = netdev_alloc_skb(p->dev, headroom + skb_gro_offset(p)); | 2710 | nskb = alloc_skb(headroom + skb_gro_offset(p), GFP_ATOMIC); |
| 2707 | if (unlikely(!nskb)) | 2711 | if (unlikely(!nskb)) |
| 2708 | return -ENOMEM; | 2712 | return -ENOMEM; |
| 2709 | 2713 | ||
