Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Florian Westphal and committed by
David S. Miller
a6086a89 926f2730

+6 -26
+1 -2
drivers/net/ethernet/chelsio/cxgb/sge.c
··· 1664 1664 struct cmdQ *q = &sge->cmdQ[qid]; 1665 1665 unsigned int credits, pidx, genbit, count, use_sched_skb = 0; 1666 1666 1667 - if (!spin_trylock(&q->lock)) 1668 - return NETDEV_TX_LOCKED; 1667 + spin_lock(&q->lock); 1669 1668 1670 1669 reclaim_completed_tx(sge, q); 1671 1670
+1 -8
drivers/net/ethernet/neterion/s2io.c
··· 4021 4021 unsigned long flags = 0; 4022 4022 u16 vlan_tag = 0; 4023 4023 struct fifo_info *fifo = NULL; 4024 - int do_spin_lock = 1; 4025 4024 int offload_type; 4026 4025 int enable_per_list_interrupt = 0; 4027 4026 struct config_param *config = &sp->config; ··· 4073 4074 queue += sp->udp_fifo_idx; 4074 4075 if (skb->len > 1024) 4075 4076 enable_per_list_interrupt = 1; 4076 - do_spin_lock = 0; 4077 4077 } 4078 4078 } 4079 4079 } ··· 4082 4084 [skb->priority & (MAX_TX_FIFOS - 1)]; 4083 4085 fifo = &mac_control->fifos[queue]; 4084 4086 4085 - if (do_spin_lock) 4086 - spin_lock_irqsave(&fifo->tx_lock, flags); 4087 - else { 4088 - if (unlikely(!spin_trylock_irqsave(&fifo->tx_lock, flags))) 4089 - return NETDEV_TX_LOCKED; 4090 - } 4087 + spin_lock_irqsave(&fifo->tx_lock, flags); 4091 4088 4092 4089 if (sp->config.multiq) { 4093 4090 if (__netif_subqueue_stopped(dev, fifo->fifo_no)) {
+2 -4
drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c
··· 2137 2137 struct pch_gbe_tx_ring *tx_ring = adapter->tx_ring; 2138 2138 unsigned long flags; 2139 2139 2140 - if (!spin_trylock_irqsave(&tx_ring->tx_lock, flags)) { 2141 - /* Collision - tell upper layer to requeue */ 2142 - return NETDEV_TX_LOCKED; 2143 - } 2140 + spin_trylock_irqsave(&tx_ring->tx_lock, flags); 2141 + 2144 2142 if (unlikely(!PCH_GBE_DESC_UNUSED(tx_ring))) { 2145 2143 netif_stop_queue(netdev); 2146 2144 spin_unlock_irqrestore(&tx_ring->tx_lock, flags);
+1 -7
drivers/net/ethernet/tehuti/tehuti.c
··· 1610 1610 * o NETDEV_TX_BUSY Cannot transmit packet, try later 1611 1611 * Usually a bug, means queue start/stop flow control is broken in 1612 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 */ 1615 1614 static netdev_tx_t bdx_tx_transmit(struct sk_buff *skb, 1616 1615 struct net_device *ndev) ··· 1629 1630 1630 1631 ENTER; 1631 1632 local_irq_save(flags); 1632 - if (!spin_trylock(&priv->tx_lock)) { 1633 - local_irq_restore(flags); 1634 - DBG("%s[%s]: TX locked, returning NETDEV_TX_LOCKED\n", 1635 - BDX_DRV_NAME, ndev->name); 1636 - return NETDEV_TX_LOCKED; 1637 - } 1633 + spin_lock(&priv->tx_lock); 1638 1634 1639 1635 /* build tx descriptor */ 1640 1636 BDX_ASSERT(f->m.wptr >= f->m.memsz); /* started with valid wptr */
+1 -5
drivers/net/rionet.c
··· 179 179 unsigned long flags; 180 180 int add_num = 1; 181 181 182 - local_irq_save(flags); 183 - if (!spin_trylock(&rnet->tx_lock)) { 184 - local_irq_restore(flags); 185 - return NETDEV_TX_LOCKED; 186 - } 182 + spin_lock_irqsave(&rnet->tx_lock, flags); 187 183 188 184 if (is_multicast_ether_addr(eth->h_dest)) 189 185 add_num = nets[rnet->mport->id].nact;