Re: [PATCH (net-next.git) 04/18] stmmac: remove modulo in stmmac_xmit()

2016-01-05 Thread Giuseppe CAVALLARO
Hi David On 1/5/2016 4:34 AM, David Miller wrote: From: Giuseppe Cavallaro 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

Re: [PATCH (net-next.git) 04/18] stmmac: remove modulo in stmmac_xmit()

2016-01-04 Thread David Miller
From: Giuseppe Cavallaro 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) > +

[PATCH (net-next.git) 04/18] stmmac: remove modulo in stmmac_xmit()

2016-01-04 Thread Giuseppe Cavallaro
The indexes into the ring buffer are always incremented, and the entry is accessed via doing a modulo to find the "real" index. I have changed this for 3 reasons: * It is inefficient, modulo is an expensive operation. * It is also broken when the counter wraps. * It makes my head hurt trying to c

[PATCH (net-next.git) 04/18] stmmac: remove modulo in stmmac_xmit()

2015-12-09 Thread Giuseppe Cavallaro
The indexes into the ring buffer are always incremented, and the entry is accessed via doing a modulo to find the "real" index. I have changed this for 3 reasons: * It is inefficient, modulo is an expensive operation. * It is also broken when the counter wraps. * It makes my head hurt trying to c