Commit 78e2045d authored by Govindarajulu Varadarajan's avatar Govindarajulu Varadarajan Committed by David S. Miller

enic: use spin_lock(wq_lock) instead of spin_lock_irqsave(wq_lock)

All the access to wq has been moved out of hardirq context. We no longer need to
use spin_lock_irqsave.
Signed-off-by: default avatarGovindarajulu Varadarajan <_govind@gmx.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent db40b3f5
...@@ -529,7 +529,6 @@ static netdev_tx_t enic_hard_start_xmit(struct sk_buff *skb, ...@@ -529,7 +529,6 @@ static netdev_tx_t enic_hard_start_xmit(struct sk_buff *skb,
{ {
struct enic *enic = netdev_priv(netdev); struct enic *enic = netdev_priv(netdev);
struct vnic_wq *wq; struct vnic_wq *wq;
unsigned long flags;
unsigned int txq_map; unsigned int txq_map;
struct netdev_queue *txq; struct netdev_queue *txq;
...@@ -554,14 +553,14 @@ static netdev_tx_t enic_hard_start_xmit(struct sk_buff *skb, ...@@ -554,14 +553,14 @@ static netdev_tx_t enic_hard_start_xmit(struct sk_buff *skb,
return NETDEV_TX_OK; return NETDEV_TX_OK;
} }
spin_lock_irqsave(&enic->wq_lock[txq_map], flags); spin_lock(&enic->wq_lock[txq_map]);
if (vnic_wq_desc_avail(wq) < if (vnic_wq_desc_avail(wq) <
skb_shinfo(skb)->nr_frags + ENIC_DESC_MAX_SPLITS) { skb_shinfo(skb)->nr_frags + ENIC_DESC_MAX_SPLITS) {
netif_tx_stop_queue(txq); netif_tx_stop_queue(txq);
/* This is a hard error, log it */ /* This is a hard error, log it */
netdev_err(netdev, "BUG! Tx ring full when queue awake!\n"); netdev_err(netdev, "BUG! Tx ring full when queue awake!\n");
spin_unlock_irqrestore(&enic->wq_lock[txq_map], flags); spin_unlock(&enic->wq_lock[txq_map]);
return NETDEV_TX_BUSY; return NETDEV_TX_BUSY;
} }
...@@ -572,7 +571,7 @@ static netdev_tx_t enic_hard_start_xmit(struct sk_buff *skb, ...@@ -572,7 +571,7 @@ static netdev_tx_t enic_hard_start_xmit(struct sk_buff *skb,
if (!skb->xmit_more || netif_xmit_stopped(txq)) if (!skb->xmit_more || netif_xmit_stopped(txq))
vnic_wq_doorbell(wq); vnic_wq_doorbell(wq);
spin_unlock_irqrestore(&enic->wq_lock[txq_map], flags); spin_unlock(&enic->wq_lock[txq_map]);
return NETDEV_TX_OK; return NETDEV_TX_OK;
} }
......
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