Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

stmmac: prefetch all dma_erx when use extend_desc

This patch is to prefetch, in the stmmac_rx, the whole
dma_erx descriptor in case of using the extended descriptors.

Signed-off-by: Giuseppe Cavallaro <peppe.cavallaro@st.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Giuseppe CAVALLARO and committed by
David S. Miller
9401bb5c 1bb6dea8

+3 -6
+3 -6
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
··· 2006 2006 #endif 2007 2007 while (count < limit) { 2008 2008 int status; 2009 - struct dma_desc *p, *p_next; 2009 + struct dma_desc *p; 2010 2010 2011 2011 if (priv->extend_desc) 2012 2012 p = (struct dma_desc *)(priv->dma_erx + entry); ··· 2020 2020 2021 2021 next_entry = (++priv->cur_rx) % rxsize; 2022 2022 if (priv->extend_desc) 2023 - p_next = (struct dma_desc *)(priv->dma_erx + 2024 - next_entry); 2023 + prefetch(priv->dma_erx + next_entry); 2025 2024 else 2026 - p_next = priv->dma_rx + next_entry; 2027 - 2028 - prefetch(p_next); 2025 + prefetch(priv->dma_rx + next_entry); 2029 2026 2030 2027 /* read the status of the incoming frame */ 2031 2028 status = priv->hw->desc->rx_status(&priv->dev->stats,