@@ -868,10 +868,12 @@ static void __bcmgenet_tx_reclaim(struct net_device *dev,
868868 struct bcmgenet_priv * priv = netdev_priv (dev );
869869 int last_tx_cn , last_c_index , num_tx_bds ;
870870 struct enet_cb * tx_cb_ptr ;
871+ struct netdev_queue * txq ;
871872 unsigned int c_index ;
872873
873874 /* Compute how many buffers are transmited since last xmit call */
874875 c_index = bcmgenet_tdma_ring_readl (priv , ring -> index , TDMA_CONS_INDEX );
876+ txq = netdev_get_tx_queue (dev , ring -> queue );
875877
876878 last_c_index = ring -> c_index ;
877879 num_tx_bds = ring -> size ;
@@ -917,8 +919,8 @@ static void __bcmgenet_tx_reclaim(struct net_device *dev,
917919 if (ring -> free_bds > (MAX_SKB_FRAGS + 1 ))
918920 ring -> int_disable (priv , ring );
919921
920- if (__netif_subqueue_stopped ( dev , ring -> queue ))
921- netif_wake_subqueue ( dev , ring -> queue );
922+ if (netif_tx_queue_stopped ( txq ))
923+ netif_tx_wake_queue ( txq );
922924
923925 ring -> c_index = c_index ;
924926}
@@ -1106,6 +1108,7 @@ static netdev_tx_t bcmgenet_xmit(struct sk_buff *skb, struct net_device *dev)
11061108{
11071109 struct bcmgenet_priv * priv = netdev_priv (dev );
11081110 struct bcmgenet_tx_ring * ring = NULL ;
1111+ struct netdev_queue * txq ;
11091112 unsigned long flags = 0 ;
11101113 int nr_frags , index ;
11111114 u16 dma_desc_flags ;
@@ -1125,20 +1128,13 @@ static netdev_tx_t bcmgenet_xmit(struct sk_buff *skb, struct net_device *dev)
11251128 else
11261129 index -= 1 ;
11271130
1128- if ((index != DESC_INDEX ) && (index > priv -> hw_params -> tx_queues - 1 )) {
1129- netdev_err (dev , "%s: queue_mapping %d is invalid\n" ,
1130- __func__ , skb_get_queue_mapping (skb ));
1131- dev -> stats .tx_errors ++ ;
1132- dev -> stats .tx_dropped ++ ;
1133- ret = NETDEV_TX_OK ;
1134- goto out ;
1135- }
11361131 nr_frags = skb_shinfo (skb )-> nr_frags ;
11371132 ring = & priv -> tx_rings [index ];
1133+ txq = netdev_get_tx_queue (dev , ring -> queue );
11381134
11391135 spin_lock_irqsave (& ring -> lock , flags );
11401136 if (ring -> free_bds <= nr_frags + 1 ) {
1141- netif_stop_subqueue ( dev , ring -> queue );
1137+ netif_tx_stop_queue ( txq );
11421138 netdev_err (dev , "%s: tx ring %d full when queue %d awake\n" ,
11431139 __func__ , index , ring -> queue );
11441140 ret = NETDEV_TX_BUSY ;
@@ -1176,14 +1172,16 @@ static netdev_tx_t bcmgenet_xmit(struct sk_buff *skb, struct net_device *dev)
11761172 }
11771173 }
11781174
1175+ skb_tx_timestamp (skb );
1176+
11791177 /* we kept a software copy of how much we should advance the TDMA
11801178 * producer index, now write it down to the hardware
11811179 */
11821180 bcmgenet_tdma_ring_writel (priv , ring -> index ,
11831181 ring -> prod_index , TDMA_PROD_INDEX );
11841182
11851183 if (ring -> free_bds <= (MAX_SKB_FRAGS + 1 )) {
1186- netif_stop_subqueue ( dev , ring -> queue );
1184+ netif_tx_stop_queue ( txq );
11871185 ring -> int_enable (priv , ring );
11881186 }
11891187
@@ -2498,7 +2496,6 @@ static int bcmgenet_probe(struct platform_device *pdev)
24982496
24992497 bcmgenet_set_hw_params (priv );
25002498
2501- spin_lock_init (& priv -> lock );
25022499 /* Mii wait queue */
25032500 init_waitqueue_head (& priv -> wq );
25042501 /* Always use RX_BUF_LENGTH (2KB) buffer for all chips */
0 commit comments