Author: nbd
Date: 2015-01-17 14:13:55 +0100 (Sat, 17 Jan 2015)
New Revision: 43995

Modified:
   trunk/target/linux/ramips/files/drivers/net/ethernet/ralink/ralink_soc_eth.c
Log:
ramips: fix tx bql related race condition in the ethernet driver

Signed-off-by: Felix Fietkau <[email protected]>

Modified: 
trunk/target/linux/ramips/files/drivers/net/ethernet/ralink/ralink_soc_eth.c
===================================================================
--- 
trunk/target/linux/ramips/files/drivers/net/ethernet/ralink/ralink_soc_eth.c    
    2015-01-17 12:52:28 UTC (rev 43994)
+++ 
trunk/target/linux/ramips/files/drivers/net/ethernet/ralink/ralink_soc_eth.c    
    2015-01-17 13:13:55 UTC (rev 43995)
@@ -568,6 +568,9 @@
        /* store skb to cleanup */
        priv->tx_skb[j] = skb;
 
+       netdev_sent_queue(dev, skb->len);
+       skb_tx_timestamp(skb);
+
        wmb();
        j = NEXT_TX_DESP_IDX(j);
        fe_reg_w32(j, FE_REG_TX_CTX_IDX0);
@@ -646,6 +649,7 @@
        struct net_device_stats *stats = &dev->stats;
        u32 tx;
        int tx_num;
+       int len = skb->len;
 
        if (fe_skb_padto(skb, priv)) {
                netif_warn(priv, tx_err, dev, "tx padding failed!\n");
@@ -669,11 +673,8 @@
 
                stats->tx_dropped++;
        } else {
-               netdev_sent_queue(dev, skb->len);
-               skb_tx_timestamp(skb);
-
                stats->tx_packets++;
-               stats->tx_bytes += skb->len;
+               stats->tx_bytes += len;
        }
 
        spin_unlock(&priv->page_lock);
_______________________________________________
openwrt-commits mailing list
[email protected]
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-commits

Reply via email to