aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFlorian Westphal <fw@strlen.de>2016-04-24 15:38:13 -0400
committerDavid S. Miller <davem@davemloft.net>2016-04-26 15:53:05 -0400
commita6086a893718db07ef9e7af5624ec27cb376ef0a (patch)
treed79f3678a33c11fa2613cd1f3c4fc393e37222f4
parent926f27300100f4233c7665649f68fcf615f58d68 (diff)
drivers: net: remove NETDEV_TX_LOCKED
replace the trylock by a full spin_lock and remove TX_LOCKED return value. Followup patch will remove TX_LOCKED from the kernel. Cc: Jon Mason <jdmason@kudzu.us> Cc: Andy Gospodarek <andy@greyhouse.net> Signed-off-by: Florian Westphal <fw@strlen.de> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/net/ethernet/chelsio/cxgb/sge.c3
-rw-r--r--drivers/net/ethernet/neterion/s2io.c9
-rw-r--r--drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c6
-rw-r--r--drivers/net/ethernet/tehuti/tehuti.c8
-rw-r--r--drivers/net/rionet.c6
5 files changed, 6 insertions, 26 deletions
diff --git a/drivers/net/ethernet/chelsio/cxgb/sge.c b/drivers/net/ethernet/chelsio/cxgb/sge.c
index 526ea74e82d9..86f467a2c485 100644
--- a/drivers/net/ethernet/chelsio/cxgb/sge.c
+++ b/drivers/net/ethernet/chelsio/cxgb/sge.c
@@ -1664,8 +1664,7 @@ static int t1_sge_tx(struct sk_buff *skb, struct adapter *adapter,
1664 struct cmdQ *q = &sge->cmdQ[qid]; 1664 struct cmdQ *q = &sge->cmdQ[qid];
1665 unsigned int credits, pidx, genbit, count, use_sched_skb = 0; 1665 unsigned int credits, pidx, genbit, count, use_sched_skb = 0;
1666 1666
1667 if (!spin_trylock(&q->lock)) 1667 spin_lock(&q->lock);
1668 return NETDEV_TX_LOCKED;
1669 1668
1670 reclaim_completed_tx(sge, q); 1669 reclaim_completed_tx(sge, q);
1671 1670
diff --git a/drivers/net/ethernet/neterion/s2io.c b/drivers/net/ethernet/neterion/s2io.c
index 9ba975853ec6..2874dffe77de 100644
--- a/drivers/net/ethernet/neterion/s2io.c
+++ b/drivers/net/ethernet/neterion/s2io.c
@@ -4021,7 +4021,6 @@ static netdev_tx_t s2io_xmit(struct sk_buff *skb, struct net_device *dev)
4021 unsigned long flags = 0; 4021 unsigned long flags = 0;
4022 u16 vlan_tag = 0; 4022 u16 vlan_tag = 0;
4023 struct fifo_info *fifo = NULL; 4023 struct fifo_info *fifo = NULL;
4024 int do_spin_lock = 1;
4025 int offload_type; 4024 int offload_type;
4026 int enable_per_list_interrupt = 0; 4025 int enable_per_list_interrupt = 0;
4027 struct config_param *config = &sp->config; 4026 struct config_param *config = &sp->config;
@@ -4074,7 +4073,6 @@ static netdev_tx_t s2io_xmit(struct sk_buff *skb, struct net_device *dev)
4074 queue += sp->udp_fifo_idx; 4073 queue += sp->udp_fifo_idx;
4075 if (skb->len > 1024) 4074 if (skb->len > 1024)
4076 enable_per_list_interrupt = 1; 4075 enable_per_list_interrupt = 1;
4077 do_spin_lock = 0;
4078 } 4076 }
4079 } 4077 }
4080 } 4078 }
@@ -4084,12 +4082,7 @@ static netdev_tx_t s2io_xmit(struct sk_buff *skb, struct net_device *dev)
4084 [skb->priority & (MAX_TX_FIFOS - 1)]; 4082 [skb->priority & (MAX_TX_FIFOS - 1)];
4085 fifo = &mac_control->fifos[queue]; 4083 fifo = &mac_control->fifos[queue];
4086 4084
4087 if (do_spin_lock) 4085 spin_lock_irqsave(&fifo->tx_lock, flags);
4088 spin_lock_irqsave(&fifo->tx_lock, flags);
4089 else {
4090 if (unlikely(!spin_trylock_irqsave(&fifo->tx_lock, flags)))
4091 return NETDEV_TX_LOCKED;
4092 }
4093 4086
4094 if (sp->config.multiq) { 4087 if (sp->config.multiq) {
4095 if (__netif_subqueue_stopped(dev, fifo->fifo_no)) { 4088 if (__netif_subqueue_stopped(dev, fifo->fifo_no)) {
diff --git a/drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c b/drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c
index 3b98b263bad0..4475dcc687a2 100644
--- a/drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c
+++ b/drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c
@@ -2137,10 +2137,8 @@ static int pch_gbe_xmit_frame(struct sk_buff *skb, struct net_device *netdev)
2137 struct pch_gbe_tx_ring *tx_ring = adapter->tx_ring; 2137 struct pch_gbe_tx_ring *tx_ring = adapter->tx_ring;
2138 unsigned long flags; 2138 unsigned long flags;
2139 2139
2140 if (!spin_trylock_irqsave(&tx_ring->tx_lock, flags)) { 2140 spin_trylock_irqsave(&tx_ring->tx_lock, flags);
2141 /* Collision - tell upper layer to requeue */ 2141
2142 return NETDEV_TX_LOCKED;
2143 }
2144 if (unlikely(!PCH_GBE_DESC_UNUSED(tx_ring))) { 2142 if (unlikely(!PCH_GBE_DESC_UNUSED(tx_ring))) {
2145 netif_stop_queue(netdev); 2143 netif_stop_queue(netdev);
2146 spin_unlock_irqrestore(&tx_ring->tx_lock, flags); 2144 spin_unlock_irqrestore(&tx_ring->tx_lock, flags);
diff --git a/drivers/net/ethernet/tehuti/tehuti.c b/drivers/net/ethernet/tehuti/tehuti.c
index 14c9d1baa85c..2524a69db318 100644
--- a/drivers/net/ethernet/tehuti/tehuti.c
+++ b/drivers/net/ethernet/tehuti/tehuti.c
@@ -1610,7 +1610,6 @@ static inline int bdx_tx_space(struct bdx_priv *priv)
1610 * o NETDEV_TX_BUSY Cannot transmit packet, try later 1610 * o NETDEV_TX_BUSY Cannot transmit packet, try later
1611 * Usually a bug, means queue start/stop flow control is broken in 1611 * Usually a bug, means queue start/stop flow control is broken in
1612 * the driver. Note: the driver must NOT put the skb in its DMA ring. 1612 * the driver. Note: the driver must NOT put the skb in its DMA ring.
1613 * o NETDEV_TX_LOCKED Locking failed, please retry quickly.
1614 */ 1613 */
1615static netdev_tx_t bdx_tx_transmit(struct sk_buff *skb, 1614static netdev_tx_t bdx_tx_transmit(struct sk_buff *skb,
1616 struct net_device *ndev) 1615 struct net_device *ndev)
@@ -1630,12 +1629,7 @@ static netdev_tx_t bdx_tx_transmit(struct sk_buff *skb,
1630 1629
1631 ENTER; 1630 ENTER;
1632 local_irq_save(flags); 1631 local_irq_save(flags);
1633 if (!spin_trylock(&priv->tx_lock)) { 1632 spin_lock(&priv->tx_lock);
1634 local_irq_restore(flags);
1635 DBG("%s[%s]: TX locked, returning NETDEV_TX_LOCKED\n",
1636 BDX_DRV_NAME, ndev->name);
1637 return NETDEV_TX_LOCKED;
1638 }
1639 1633
1640 /* build tx descriptor */ 1634 /* build tx descriptor */
1641 BDX_ASSERT(f->m.wptr >= f->m.memsz); /* started with valid wptr */ 1635 BDX_ASSERT(f->m.wptr >= f->m.memsz); /* started with valid wptr */
diff --git a/drivers/net/rionet.c b/drivers/net/rionet.c
index 9cfe6aeac84e..a31f4610b493 100644
--- a/drivers/net/rionet.c
+++ b/drivers/net/rionet.c
@@ -179,11 +179,7 @@ static int rionet_start_xmit(struct sk_buff *skb, struct net_device *ndev)
179 unsigned long flags; 179 unsigned long flags;
180 int add_num = 1; 180 int add_num = 1;
181 181
182 local_irq_save(flags); 182 spin_lock_irqsave(&rnet->tx_lock, flags);
183 if (!spin_trylock(&rnet->tx_lock)) {
184 local_irq_restore(flags);
185 return NETDEV_TX_LOCKED;
186 }
187 183
188 if (is_multicast_ether_addr(eth->h_dest)) 184 if (is_multicast_ether_addr(eth->h_dest))
189 add_num = nets[rnet->mport->id].nact; 185 add_num = nets[rnet->mport->id].nact;