[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <20121207.124608.444520170061639362.davem@davemloft.net>
Date: Fri, 07 Dec 2012 12:46:08 -0500 (EST)
From: David Miller <davem@...emloft.net>
To: David.Laight@...LAB.COM
Cc: rmody@...cade.com, netdev@...r.kernel.org,
bhutchings@...arflare.com, adapter_linux_open_src_team@...cade.com
Subject: Re: [net-next 2/7] bna: Tx and Rx Optimizations
From: "David Laight" <David.Laight@...LAB.COM>
Date: Fri, 7 Dec 2012 10:46:22 -0000
>> #define BNA_QE_INDX_ADD(_qe_idx, _qe_num, _q_depth) \
>> ((_qe_idx) = ((_qe_idx) + (_qe_num)) & ((_q_depth) - 1))
>>
>> +#define BNA_QE_INDX_INC(_idx, _q_depth) \
>> +do { \
>> + (_idx)++; \
>> + if ((_idx) == (_q_depth)) \
>> + (_idx) = 0; \
>> +} while (0)
>> +
>
> If q_depth has to be a power of 2 (implied by BNA_QE_IND_ADD())
> then you should mask in BNA_QE_INDX_INC() to save the conditional.
> Or just:
> #define BNA_QE_INDX_INC(_idx, _q_depth) BNA_QE_INDX_ADD(_idx, 1, _q_depth)
Agreed.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists