diff options
author | Neil Horman <nhorman@tuxdriver.com> | 2012-03-09 17:50:19 -0500 |
---|---|---|
committer | James Bottomley <JBottomley@Parallels.com> | 2012-03-28 04:17:01 -0400 |
commit | dd060e74fb4c2513420d8af7371cda2f3eea4fa9 (patch) | |
tree | e5d66bec0ea7f4de3eb708d1452ba2da10776ac4 /drivers/scsi | |
parent | fc05ab74b78a9e16b0faa9f0dc3c87f3f30d3231 (diff) |
[SCSI] fcoe: remove frame dropping code from fcoe_percpu_clean
commit e7a51997dad4e17395be1209970e18d2e9305b24 ([SCSI] fcoe: flush per-cpu
thread work when destroying interface) added a skb flush to the fcoe_rx_list,
which ensures that we push any pending frames on the list through the per-cpu
receive thread. Because of this, its redundant to lock and scan the list
first, dropping any arriving frames.
Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
Acked-by: Vasu Dev <vasu.dev@intel.com>
Signed-off-by: Robert Love <robert.w.love@intel.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Diffstat (limited to 'drivers/scsi')
-rw-r--r-- | drivers/scsi/fcoe/fcoe.c | 22 |
1 files changed, 3 insertions, 19 deletions
diff --git a/drivers/scsi/fcoe/fcoe.c b/drivers/scsi/fcoe/fcoe.c index 961bf364429a..d86ca37b3787 100644 --- a/drivers/scsi/fcoe/fcoe.c +++ b/drivers/scsi/fcoe/fcoe.c | |||
@@ -2254,31 +2254,14 @@ static int fcoe_link_ok(struct fc_lport *lport) | |||
2254 | static void fcoe_percpu_clean(struct fc_lport *lport) | 2254 | static void fcoe_percpu_clean(struct fc_lport *lport) |
2255 | { | 2255 | { |
2256 | struct fcoe_percpu_s *pp; | 2256 | struct fcoe_percpu_s *pp; |
2257 | struct fcoe_rcv_info *fr; | 2257 | struct sk_buff *skb; |
2258 | struct sk_buff_head *list; | ||
2259 | struct sk_buff *skb, *next; | ||
2260 | struct sk_buff *head; | ||
2261 | unsigned int cpu; | 2258 | unsigned int cpu; |
2262 | 2259 | ||
2263 | for_each_possible_cpu(cpu) { | 2260 | for_each_possible_cpu(cpu) { |
2264 | pp = &per_cpu(fcoe_percpu, cpu); | 2261 | pp = &per_cpu(fcoe_percpu, cpu); |
2265 | spin_lock_bh(&pp->fcoe_rx_list.lock); | ||
2266 | list = &pp->fcoe_rx_list; | ||
2267 | head = list->next; | ||
2268 | for (skb = head; skb != (struct sk_buff *)list; | ||
2269 | skb = next) { | ||
2270 | next = skb->next; | ||
2271 | fr = fcoe_dev_from_skb(skb); | ||
2272 | if (fr->fr_dev == lport) { | ||
2273 | __skb_unlink(skb, list); | ||
2274 | kfree_skb(skb); | ||
2275 | } | ||
2276 | } | ||
2277 | 2262 | ||
2278 | if (!pp->thread || !cpu_online(cpu)) { | 2263 | if (!pp->thread || !cpu_online(cpu)) |
2279 | spin_unlock_bh(&pp->fcoe_rx_list.lock); | ||
2280 | continue; | 2264 | continue; |
2281 | } | ||
2282 | 2265 | ||
2283 | skb = dev_alloc_skb(0); | 2266 | skb = dev_alloc_skb(0); |
2284 | if (!skb) { | 2267 | if (!skb) { |
@@ -2287,6 +2270,7 @@ static void fcoe_percpu_clean(struct fc_lport *lport) | |||
2287 | } | 2270 | } |
2288 | skb->destructor = fcoe_percpu_flush_done; | 2271 | skb->destructor = fcoe_percpu_flush_done; |
2289 | 2272 | ||
2273 | spin_lock_bh(&pp->fcoe_rx_list.lock); | ||
2290 | __skb_queue_tail(&pp->fcoe_rx_list, skb); | 2274 | __skb_queue_tail(&pp->fcoe_rx_list, skb); |
2291 | if (pp->fcoe_rx_list.qlen == 1) | 2275 | if (pp->fcoe_rx_list.qlen == 1) |
2292 | wake_up_process(pp->thread); | 2276 | wake_up_process(pp->thread); |