diff options
author | David S. Miller <davem@davemloft.net> | 2008-11-07 01:43:03 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-11-07 01:43:03 -0500 |
commit | 9eeda9abd1faf489f3df9a1f557975f4c8650363 (patch) | |
tree | 3e0a58e25b776cfbee193195460324dccb1886c7 /net/core | |
parent | 61c9eaf90081cbe6dc4f389e0056bff76eca19ec (diff) | |
parent | 4bab0ea1d42dd1927af9df6fbf0003fc00617c50 (diff) |
Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
Conflicts:
drivers/net/wireless/ath5k/base.c
net/8021q/vlan_core.c
Diffstat (limited to 'net/core')
-rw-r--r-- | net/core/dev.c | 3 | ||||
-rw-r--r-- | net/core/scm.c | 24 | ||||
-rw-r--r-- | net/core/skbuff.c | 12 |
3 files changed, 36 insertions, 3 deletions
diff --git a/net/core/dev.c b/net/core/dev.c index a0c60607f1a7..e0dc67a789b7 100644 --- a/net/core/dev.c +++ b/net/core/dev.c | |||
@@ -2223,6 +2223,9 @@ int netif_receive_skb(struct sk_buff *skb) | |||
2223 | int ret = NET_RX_DROP; | 2223 | int ret = NET_RX_DROP; |
2224 | __be16 type; | 2224 | __be16 type; |
2225 | 2225 | ||
2226 | if (skb->vlan_tci && vlan_hwaccel_do_receive(skb)) | ||
2227 | return NET_RX_SUCCESS; | ||
2228 | |||
2226 | /* if we've gotten here through NAPI, check netpoll */ | 2229 | /* if we've gotten here through NAPI, check netpoll */ |
2227 | if (netpoll_receive_skb(skb)) | 2230 | if (netpoll_receive_skb(skb)) |
2228 | return NET_RX_DROP; | 2231 | return NET_RX_DROP; |
diff --git a/net/core/scm.c b/net/core/scm.c index 10f5c65f6a47..ab242cc1acca 100644 --- a/net/core/scm.c +++ b/net/core/scm.c | |||
@@ -75,6 +75,7 @@ static int scm_fp_copy(struct cmsghdr *cmsg, struct scm_fp_list **fplp) | |||
75 | if (!fpl) | 75 | if (!fpl) |
76 | return -ENOMEM; | 76 | return -ENOMEM; |
77 | *fplp = fpl; | 77 | *fplp = fpl; |
78 | INIT_LIST_HEAD(&fpl->list); | ||
78 | fpl->count = 0; | 79 | fpl->count = 0; |
79 | } | 80 | } |
80 | fpp = &fpl->fp[fpl->count]; | 81 | fpp = &fpl->fp[fpl->count]; |
@@ -106,9 +107,25 @@ void __scm_destroy(struct scm_cookie *scm) | |||
106 | 107 | ||
107 | if (fpl) { | 108 | if (fpl) { |
108 | scm->fp = NULL; | 109 | scm->fp = NULL; |
109 | for (i=fpl->count-1; i>=0; i--) | 110 | if (current->scm_work_list) { |
110 | fput(fpl->fp[i]); | 111 | list_add_tail(&fpl->list, current->scm_work_list); |
111 | kfree(fpl); | 112 | } else { |
113 | LIST_HEAD(work_list); | ||
114 | |||
115 | current->scm_work_list = &work_list; | ||
116 | |||
117 | list_add(&fpl->list, &work_list); | ||
118 | while (!list_empty(&work_list)) { | ||
119 | fpl = list_first_entry(&work_list, struct scm_fp_list, list); | ||
120 | |||
121 | list_del(&fpl->list); | ||
122 | for (i=fpl->count-1; i>=0; i--) | ||
123 | fput(fpl->fp[i]); | ||
124 | kfree(fpl); | ||
125 | } | ||
126 | |||
127 | current->scm_work_list = NULL; | ||
128 | } | ||
112 | } | 129 | } |
113 | } | 130 | } |
114 | 131 | ||
@@ -284,6 +301,7 @@ struct scm_fp_list *scm_fp_dup(struct scm_fp_list *fpl) | |||
284 | 301 | ||
285 | new_fpl = kmalloc(sizeof(*fpl), GFP_KERNEL); | 302 | new_fpl = kmalloc(sizeof(*fpl), GFP_KERNEL); |
286 | if (new_fpl) { | 303 | if (new_fpl) { |
304 | INIT_LIST_HEAD(&new_fpl->list); | ||
287 | for (i=fpl->count-1; i>=0; i--) | 305 | for (i=fpl->count-1; i>=0; i--) |
288 | get_file(fpl->fp[i]); | 306 | get_file(fpl->fp[i]); |
289 | memcpy(new_fpl, fpl, sizeof(*fpl)); | 307 | memcpy(new_fpl, fpl, sizeof(*fpl)); |
diff --git a/net/core/skbuff.c b/net/core/skbuff.c index c4c8a33f3418..f24a4951008b 100644 --- a/net/core/skbuff.c +++ b/net/core/skbuff.c | |||
@@ -449,6 +449,18 @@ void kfree_skb(struct sk_buff *skb) | |||
449 | __kfree_skb(skb); | 449 | __kfree_skb(skb); |
450 | } | 450 | } |
451 | 451 | ||
452 | /** | ||
453 | * skb_recycle_check - check if skb can be reused for receive | ||
454 | * @skb: buffer | ||
455 | * @skb_size: minimum receive buffer size | ||
456 | * | ||
457 | * Checks that the skb passed in is not shared or cloned, and | ||
458 | * that it is linear and its head portion at least as large as | ||
459 | * skb_size so that it can be recycled as a receive buffer. | ||
460 | * If these conditions are met, this function does any necessary | ||
461 | * reference count dropping and cleans up the skbuff as if it | ||
462 | * just came from __alloc_skb(). | ||
463 | */ | ||
452 | int skb_recycle_check(struct sk_buff *skb, int skb_size) | 464 | int skb_recycle_check(struct sk_buff *skb, int skb_size) |
453 | { | 465 | { |
454 | struct skb_shared_info *shinfo; | 466 | struct skb_shared_info *shinfo; |