]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - drivers/net/ethernet/marvell/mvneta.c
net: mvneta: fix race condition in mvneta_tx()
[karo-tx-linux.git] / drivers / net / ethernet / marvell / mvneta.c
index ade067de168959b30c9e7eafc07ed40df0967ee0..67a84cfaefa19420a984f55f7d5d621452458ef2 100644 (file)
 /* Various constants */
 
 /* Coalescing */
-#define MVNETA_TXDONE_COAL_PKTS                16
+#define MVNETA_TXDONE_COAL_PKTS                1
 #define MVNETA_RX_COAL_PKTS            32
 #define MVNETA_RX_COAL_USEC            100
 
@@ -1721,6 +1721,7 @@ static int mvneta_tx(struct sk_buff *skb, struct net_device *dev)
        u16 txq_id = skb_get_queue_mapping(skb);
        struct mvneta_tx_queue *txq = &pp->txqs[txq_id];
        struct mvneta_tx_desc *tx_desc;
+       int len = skb->len;
        int frags = 0;
        u32 tx_cmd;
 
@@ -1788,7 +1789,7 @@ out:
 
                u64_stats_update_begin(&stats->syncp);
                stats->tx_packets++;
-               stats->tx_bytes  += skb->len;
+               stats->tx_bytes  += len;
                u64_stats_update_end(&stats->syncp);
        } else {
                dev->stats.tx_dropped++;