diff options
author | Joe Eykholt <jeykholt@cisco.com> | 2009-11-03 14:48:22 -0500 |
---|---|---|
committer | James Bottomley <James.Bottomley@suse.de> | 2009-12-04 13:01:12 -0500 |
commit | 1f4aed818d26eb9ed54520fbeb85d5ee691baa94 (patch) | |
tree | 986d728fb5d4550cf35bff4f9629633b667e5f13 /drivers/scsi/fcoe/libfcoe.c | |
parent | 0f51c2e54c0bfdb6b02c53f6d7dd9b35f91821b6 (diff) |
[SCSI] libfcoe: fip: allow FIP receive to be called from IRQ.
FIP's fcoe_ctlr_recv() function was previously only called from
the soft IRQ in FCoE. It's not performance critical and is more
convenient for some drivers to call it from the IRQ level. Just
Change to use skb_queue()/dequeue() which uses spinlock_irqsave
instead of separate locking with _bh locks.
Signed-off-by: Joe Eykholt <jeykholt@cisco.com>
Signed-off-by: Robert Love <robert.w.love@intel.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Diffstat (limited to 'drivers/scsi/fcoe/libfcoe.c')
-rw-r--r-- | drivers/scsi/fcoe/libfcoe.c | 17 |
1 files changed, 4 insertions, 13 deletions
diff --git a/drivers/scsi/fcoe/libfcoe.c b/drivers/scsi/fcoe/libfcoe.c index 99f583f40df3..787e7225ddde 100644 --- a/drivers/scsi/fcoe/libfcoe.c +++ b/drivers/scsi/fcoe/libfcoe.c | |||
@@ -156,9 +156,7 @@ static void fcoe_ctlr_reset_fcfs(struct fcoe_ctlr *fip) | |||
156 | void fcoe_ctlr_destroy(struct fcoe_ctlr *fip) | 156 | void fcoe_ctlr_destroy(struct fcoe_ctlr *fip) |
157 | { | 157 | { |
158 | cancel_work_sync(&fip->recv_work); | 158 | cancel_work_sync(&fip->recv_work); |
159 | spin_lock_bh(&fip->fip_recv_list.lock); | 159 | skb_queue_purge(&fip->fip_recv_list); |
160 | __skb_queue_purge(&fip->fip_recv_list); | ||
161 | spin_unlock_bh(&fip->fip_recv_list.lock); | ||
162 | 160 | ||
163 | spin_lock_bh(&fip->lock); | 161 | spin_lock_bh(&fip->lock); |
164 | fip->state = FIP_ST_DISABLED; | 162 | fip->state = FIP_ST_DISABLED; |
@@ -1005,13 +1003,11 @@ static void fcoe_ctlr_recv_clr_vlink(struct fcoe_ctlr *fip, | |||
1005 | * @fip: The FCoE controller that received the packet | 1003 | * @fip: The FCoE controller that received the packet |
1006 | * @skb: The received FIP packet | 1004 | * @skb: The received FIP packet |
1007 | * | 1005 | * |
1008 | * This is called from NET_RX_SOFTIRQ. | 1006 | * This may be called from either NET_RX_SOFTIRQ or IRQ. |
1009 | */ | 1007 | */ |
1010 | void fcoe_ctlr_recv(struct fcoe_ctlr *fip, struct sk_buff *skb) | 1008 | void fcoe_ctlr_recv(struct fcoe_ctlr *fip, struct sk_buff *skb) |
1011 | { | 1009 | { |
1012 | spin_lock_bh(&fip->fip_recv_list.lock); | 1010 | skb_queue_tail(&fip->fip_recv_list, skb); |
1013 | __skb_queue_tail(&fip->fip_recv_list, skb); | ||
1014 | spin_unlock_bh(&fip->fip_recv_list.lock); | ||
1015 | schedule_work(&fip->recv_work); | 1011 | schedule_work(&fip->recv_work); |
1016 | } | 1012 | } |
1017 | EXPORT_SYMBOL(fcoe_ctlr_recv); | 1013 | EXPORT_SYMBOL(fcoe_ctlr_recv); |
@@ -1251,13 +1247,8 @@ static void fcoe_ctlr_recv_work(struct work_struct *recv_work) | |||
1251 | struct sk_buff *skb; | 1247 | struct sk_buff *skb; |
1252 | 1248 | ||
1253 | fip = container_of(recv_work, struct fcoe_ctlr, recv_work); | 1249 | fip = container_of(recv_work, struct fcoe_ctlr, recv_work); |
1254 | spin_lock_bh(&fip->fip_recv_list.lock); | 1250 | while ((skb = skb_dequeue(&fip->fip_recv_list))) |
1255 | while ((skb = __skb_dequeue(&fip->fip_recv_list))) { | ||
1256 | spin_unlock_bh(&fip->fip_recv_list.lock); | ||
1257 | fcoe_ctlr_recv_handler(fip, skb); | 1251 | fcoe_ctlr_recv_handler(fip, skb); |
1258 | spin_lock_bh(&fip->fip_recv_list.lock); | ||
1259 | } | ||
1260 | spin_unlock_bh(&fip->fip_recv_list.lock); | ||
1261 | } | 1252 | } |
1262 | 1253 | ||
1263 | /** | 1254 | /** |