Commit 1f4aed81 authored by Joe Eykholt's avatar Joe Eykholt Committed by James Bottomley

[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: default avatarJoe Eykholt <jeykholt@cisco.com>
Signed-off-by: default avatarRobert Love <robert.w.love@intel.com>
Signed-off-by: default avatarJames Bottomley <James.Bottomley@suse.de>
parent 0f51c2e5
...@@ -156,9 +156,7 @@ static void fcoe_ctlr_reset_fcfs(struct fcoe_ctlr *fip) ...@@ -156,9 +156,7 @@ static void fcoe_ctlr_reset_fcfs(struct fcoe_ctlr *fip)
void fcoe_ctlr_destroy(struct fcoe_ctlr *fip) void fcoe_ctlr_destroy(struct fcoe_ctlr *fip)
{ {
cancel_work_sync(&fip->recv_work); cancel_work_sync(&fip->recv_work);
spin_lock_bh(&fip->fip_recv_list.lock); skb_queue_purge(&fip->fip_recv_list);
__skb_queue_purge(&fip->fip_recv_list);
spin_unlock_bh(&fip->fip_recv_list.lock);
spin_lock_bh(&fip->lock); spin_lock_bh(&fip->lock);
fip->state = FIP_ST_DISABLED; fip->state = FIP_ST_DISABLED;
...@@ -1005,13 +1003,11 @@ static void fcoe_ctlr_recv_clr_vlink(struct fcoe_ctlr *fip, ...@@ -1005,13 +1003,11 @@ static void fcoe_ctlr_recv_clr_vlink(struct fcoe_ctlr *fip,
* @fip: The FCoE controller that received the packet * @fip: The FCoE controller that received the packet
* @skb: The received FIP packet * @skb: The received FIP packet
* *
* This is called from NET_RX_SOFTIRQ. * This may be called from either NET_RX_SOFTIRQ or IRQ.
*/ */
void fcoe_ctlr_recv(struct fcoe_ctlr *fip, struct sk_buff *skb) void fcoe_ctlr_recv(struct fcoe_ctlr *fip, struct sk_buff *skb)
{ {
spin_lock_bh(&fip->fip_recv_list.lock); skb_queue_tail(&fip->fip_recv_list, skb);
__skb_queue_tail(&fip->fip_recv_list, skb);
spin_unlock_bh(&fip->fip_recv_list.lock);
schedule_work(&fip->recv_work); schedule_work(&fip->recv_work);
} }
EXPORT_SYMBOL(fcoe_ctlr_recv); EXPORT_SYMBOL(fcoe_ctlr_recv);
...@@ -1251,13 +1247,8 @@ static void fcoe_ctlr_recv_work(struct work_struct *recv_work) ...@@ -1251,13 +1247,8 @@ static void fcoe_ctlr_recv_work(struct work_struct *recv_work)
struct sk_buff *skb; struct sk_buff *skb;
fip = container_of(recv_work, struct fcoe_ctlr, recv_work); fip = container_of(recv_work, struct fcoe_ctlr, recv_work);
spin_lock_bh(&fip->fip_recv_list.lock); while ((skb = skb_dequeue(&fip->fip_recv_list)))
while ((skb = __skb_dequeue(&fip->fip_recv_list))) {
spin_unlock_bh(&fip->fip_recv_list.lock);
fcoe_ctlr_recv_handler(fip, skb); fcoe_ctlr_recv_handler(fip, skb);
spin_lock_bh(&fip->fip_recv_list.lock);
}
spin_unlock_bh(&fip->fip_recv_list.lock);
} }
/** /**
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment