summaryrefslogtreecommitdiff
path: root/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
diff options
context:
space:
mode:
authorGiuseppe Cavallaro <peppe.cavallaro@st.com>2016-02-29 13:27:32 (GMT)
committerDavid S. Miller <davem@davemloft.net>2016-03-02 19:21:31 (GMT)
commit2a6d8e172639b49a81afc76140dd7ee7c9a24da1 (patch)
treee6a4c565ea3239542bf26a7c0206095fdce2124e /drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
parent553e2ab3130e9c3d234bee0c80a2a1e5057c8f9a (diff)
downloadlinux-2a6d8e172639b49a81afc76140dd7ee7c9a24da1.tar.xz
stmmac: add last_segment field to dma data
last_segment field is read twice from dma descriptors in stmmac_clean(). Add last_segment to dma data so that this flag is from priv structure in cache instead of memory. It avoids reading twice from memory for each loop in stmmac_clean(). Signed-off-by: Fabrice Gasnier <fabrice.gasnier@st.com> Signed-off-by: Giuseppe Cavallaro <peppe.cavallaro@st.com> Signed-off-by: Alexandre TORGUE <alexandre.torgue@st.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/stmicro/stmmac/stmmac_main.c')
-rw-r--r--drivers/net/ethernet/stmicro/stmmac/stmmac_main.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
index 90a946f..feae0de 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
@@ -1094,6 +1094,7 @@ static int init_dma_desc_rings(struct net_device *dev, gfp_t flags)
priv->tx_skbuff_dma[i].buf = 0;
priv->tx_skbuff_dma[i].map_as_page = false;
priv->tx_skbuff_dma[i].len = 0;
+ priv->tx_skbuff_dma[i].last_segment = false;
priv->tx_skbuff[i] = NULL;
}
@@ -1326,7 +1327,7 @@ static void stmmac_tx_clean(struct stmmac_priv *priv)
break;
/* Verify tx error by looking at the last segment. */
- last = priv->hw->desc->get_tx_ls(p);
+ last = priv->tx_skbuff_dma[entry].last_segment;
if (likely(last)) {
int tx_error =
priv->hw->desc->tx_status(&priv->dev->stats,
@@ -1359,6 +1360,7 @@ static void stmmac_tx_clean(struct stmmac_priv *priv)
priv->tx_skbuff_dma[entry].map_as_page = false;
}
priv->hw->mode->clean_desc3(priv, p);
+ priv->tx_skbuff_dma[entry].last_segment = false;
if (likely(skb != NULL)) {
pkts_compl++;
@@ -2028,6 +2030,7 @@ static netdev_tx_t stmmac_xmit(struct sk_buff *skb, struct net_device *dev)
/* Finalize the latest segment. */
priv->hw->desc->close_tx_desc(desc);
+ priv->tx_skbuff_dma[entry].last_segment = true;
wmb();
/* According to the coalesce parameter the IC bit for the latest