From: Giuseppe Cavallaro <peppe.cavall...@st.com> Date: Mon, 4 Jan 2016 14:06:49 +0100
> @@ -2056,7 +2068,10 @@ static netdev_tx_t stmmac_xmit(struct sk_buff *skb, > struct net_device *dev) > priv->hw->desc->set_tx_owner(first); > wmb(); > > - priv->cur_tx++; > + if (++entry >= txsize) > + entry = 0; You are doing this over and over again, encapsulate it into a helper like "NEXT_TX(x)" or similar. Also, this is just fundamentally completely stupid. Enforce the ring size to be a power-of-2, then you can just go "x + 1 & (size - 1)" and not even have the conditional statement. Thanks. -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html