]> rtime.felk.cvut.cz Git - zynq/linux.git/commitdiff
net: ethernet: xilinx: Fix race condition in the tx path
authorKedareswara rao Appana <appana.durga.rao@xilinx.com>
Fri, 21 Jul 2017 09:51:40 +0000 (15:21 +0530)
committerMichal Simek <michal.simek@xilinx.com>
Thu, 15 Mar 2018 14:18:15 +0000 (15:18 +0100)
In the _xmit driver is checking for the buffer descriptor
availabilty, If the buffer descriptors are not available
it is stopping all the device queues,
It should stop only that particular queue as
other queues still may have free buffer descriptors
for servicing the data.

This patch fixes this issue.

Signed-off-by: Kedareswara rao Appana <appanad@xilinx.com>
Acked-by: Harini Katakam <harinik@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
drivers/net/ethernet/xilinx/xilinx_axienet_main.c

index 216eec0948bde7990048080ca2e3154b52d4ddea..375b52c4ae14d9e18ce041e3226d8355a62fb015 100644 (file)
@@ -1215,7 +1215,12 @@ static void axienet_start_xmit_done(struct net_device *ndev,
 
        ndev->stats.tx_packets += packets;
        ndev->stats.tx_bytes += size;
-       netif_wake_queue(ndev);
+       /* Fixme: With the existing multiqueue implementation
+        * in the driver it is difficult to get the exact queue info.
+        * We should wake only the particular queue
+        * instead of waking all ndev queues.
+        */
+       netif_tx_wake_all_queues(ndev);
 }
 
 /**
@@ -1392,8 +1397,8 @@ static int axienet_start_xmit(struct sk_buff *skb, struct net_device *ndev)
 
        spin_lock_irqsave(&q->tx_lock, flags);
        if (axienet_check_tx_bd_space(q, num_frag)) {
-               if (!netif_queue_stopped(ndev))
-                       netif_stop_queue(ndev);
+               if (!__netif_subqueue_stopped(ndev, map))
+                       netif_stop_subqueue(ndev, map);
                spin_unlock_irqrestore(&q->tx_lock, flags);
                return NETDEV_TX_BUSY;
        }