diff options
author | Ingo Molnar <mingo@elte.hu> | 2009-01-21 04:39:51 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-01-21 04:39:51 -0500 |
commit | 198030782cedf25391e67e7c88b04f87a5eb6563 (patch) | |
tree | 5b7368c6bf052bcb4bb273497a57900720d36f51 /net/core/dev.c | |
parent | 4ec71fa2d2c3f1040348f2604f4b8ccc833d1c2e (diff) | |
parent | 92181f190b649f7ef2b79cbf5c00f26ccc66da2a (diff) |
Merge branch 'x86/mm' into core/percpu
Conflicts:
arch/x86/mm/fault.c
Diffstat (limited to 'net/core/dev.c')
-rw-r--r-- | net/core/dev.c | 48 |
1 files changed, 42 insertions, 6 deletions
diff --git a/net/core/dev.c b/net/core/dev.c index b715a55cccc..8d675975d85 100644 --- a/net/core/dev.c +++ b/net/core/dev.c | |||
@@ -2392,6 +2392,9 @@ int dev_gro_receive(struct napi_struct *napi, struct sk_buff *skb) | |||
2392 | if (!(skb->dev->features & NETIF_F_GRO)) | 2392 | if (!(skb->dev->features & NETIF_F_GRO)) |
2393 | goto normal; | 2393 | goto normal; |
2394 | 2394 | ||
2395 | if (skb_is_gso(skb) || skb_shinfo(skb)->frag_list) | ||
2396 | goto normal; | ||
2397 | |||
2395 | rcu_read_lock(); | 2398 | rcu_read_lock(); |
2396 | list_for_each_entry_rcu(ptype, head, list) { | 2399 | list_for_each_entry_rcu(ptype, head, list) { |
2397 | struct sk_buff *p; | 2400 | struct sk_buff *p; |
@@ -2488,12 +2491,6 @@ EXPORT_SYMBOL(napi_gro_receive); | |||
2488 | 2491 | ||
2489 | void napi_reuse_skb(struct napi_struct *napi, struct sk_buff *skb) | 2492 | void napi_reuse_skb(struct napi_struct *napi, struct sk_buff *skb) |
2490 | { | 2493 | { |
2491 | skb_shinfo(skb)->nr_frags = 0; | ||
2492 | |||
2493 | skb->len -= skb->data_len; | ||
2494 | skb->truesize -= skb->data_len; | ||
2495 | skb->data_len = 0; | ||
2496 | |||
2497 | __skb_pull(skb, skb_headlen(skb)); | 2494 | __skb_pull(skb, skb_headlen(skb)); |
2498 | skb_reserve(skb, NET_IP_ALIGN - skb_headroom(skb)); | 2495 | skb_reserve(skb, NET_IP_ALIGN - skb_headroom(skb)); |
2499 | 2496 | ||
@@ -4434,6 +4431,45 @@ err_uninit: | |||
4434 | } | 4431 | } |
4435 | 4432 | ||
4436 | /** | 4433 | /** |
4434 | * init_dummy_netdev - init a dummy network device for NAPI | ||
4435 | * @dev: device to init | ||
4436 | * | ||
4437 | * This takes a network device structure and initialize the minimum | ||
4438 | * amount of fields so it can be used to schedule NAPI polls without | ||
4439 | * registering a full blown interface. This is to be used by drivers | ||
4440 | * that need to tie several hardware interfaces to a single NAPI | ||
4441 | * poll scheduler due to HW limitations. | ||
4442 | */ | ||
4443 | int init_dummy_netdev(struct net_device *dev) | ||
4444 | { | ||
4445 | /* Clear everything. Note we don't initialize spinlocks | ||
4446 | * are they aren't supposed to be taken by any of the | ||
4447 | * NAPI code and this dummy netdev is supposed to be | ||
4448 | * only ever used for NAPI polls | ||
4449 | */ | ||
4450 | memset(dev, 0, sizeof(struct net_device)); | ||
4451 | |||
4452 | /* make sure we BUG if trying to hit standard | ||
4453 | * register/unregister code path | ||
4454 | */ | ||
4455 | dev->reg_state = NETREG_DUMMY; | ||
4456 | |||
4457 | /* initialize the ref count */ | ||
4458 | atomic_set(&dev->refcnt, 1); | ||
4459 | |||
4460 | /* NAPI wants this */ | ||
4461 | INIT_LIST_HEAD(&dev->napi_list); | ||
4462 | |||
4463 | /* a dummy interface is started by default */ | ||
4464 | set_bit(__LINK_STATE_PRESENT, &dev->state); | ||
4465 | set_bit(__LINK_STATE_START, &dev->state); | ||
4466 | |||
4467 | return 0; | ||
4468 | } | ||
4469 | EXPORT_SYMBOL_GPL(init_dummy_netdev); | ||
4470 | |||
4471 | |||
4472 | /** | ||
4437 | * register_netdev - register a network device | 4473 | * register_netdev - register a network device |
4438 | * @dev: device to register | 4474 | * @dev: device to register |
4439 | * | 4475 | * |