net: stmmac: do not clear tx_skbuff entries in stmmac_xmit()/stmmac_tso_xmit()
authorNiklas Cassel <niklas.cassel@axis.com>
Mon, 19 Feb 2018 17:11:10 +0000 (18:11 +0100)
committerDavid S. Miller <davem@davemloft.net>
Tue, 20 Feb 2018 19:13:18 +0000 (14:13 -0500)
tx_skbuff is initialized to NULL in init_dma_tx_desc_rings(), which is
called from ndo_open().

stmmac_tx_clean() frees any non-NULL skb, and sets the tx_skbuff
entry to NULL. Hence, there is no need to set skbuff entries to NULL
in stmmac_xmit()/stmmac_tso_xmit(), and doing so falsely gives the
reader the impression that it is needed.
Do not clear tx_skbuff entries in stmmac_xmit()/stmmac_tso_xmit().

Signed-off-by: Niklas Cassel <niklas.cassel@axis.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c

index d38bf38..24afe77 100644 (file)
@@ -2927,7 +2927,6 @@ static netdev_tx_t stmmac_tso_xmit(struct sk_buff *skb, struct net_device *dev)
 
                tx_q->tx_skbuff_dma[tx_q->cur_tx].buf = des;
                tx_q->tx_skbuff_dma[tx_q->cur_tx].len = skb_frag_size(frag);
-               tx_q->tx_skbuff[tx_q->cur_tx] = NULL;
                tx_q->tx_skbuff_dma[tx_q->cur_tx].map_as_page = true;
        }
 
@@ -3102,8 +3101,6 @@ static netdev_tx_t stmmac_xmit(struct sk_buff *skb, struct net_device *dev)
                if (dma_mapping_error(priv->device, des))
                        goto dma_map_err; /* should reuse desc w/o issues */
 
-               tx_q->tx_skbuff[entry] = NULL;
-
                tx_q->tx_skbuff_dma[entry].buf = des;
                if (unlikely(priv->synopsys_id >= DWMAC_CORE_4_00))
                        desc->des0 = cpu_to_le32(des);