stmmac: review RX/TX ring management
This patch is to rework the ring management now optimized. The indexes into the ring buffer are always incremented, and the entry is accessed via doing a modulo to find the "real" position in the ring. It is inefficient, modulo is an expensive operation. The formula [(entry + 1) & (size - 1)] is now adopted on a ring that is power-of-2 in size. Then, the number of elements cannot be set by command line but it is fixed. 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>
Showing
- drivers/net/ethernet/stmicro/stmmac/chain_mode.c 9 additions, 8 deletionsdrivers/net/ethernet/stmicro/stmmac/chain_mode.c
- drivers/net/ethernet/stmicro/stmmac/common.h 4 additions, 0 deletionsdrivers/net/ethernet/stmicro/stmmac/common.h
- drivers/net/ethernet/stmicro/stmmac/ring_mode.c 4 additions, 3 deletionsdrivers/net/ethernet/stmicro/stmmac/ring_mode.c
- drivers/net/ethernet/stmicro/stmmac/stmmac.h 0 additions, 2 deletionsdrivers/net/ethernet/stmicro/stmmac/stmmac.h
- drivers/net/ethernet/stmicro/stmmac/stmmac_main.c 94 additions, 104 deletionsdrivers/net/ethernet/stmicro/stmmac/stmmac_main.c
Loading
Please register or sign in to comment