[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <AE90C24D6B3A694183C094C60CF0A2F6026B70E5@saturn3.aculab.com>
Date: Fri, 7 Dec 2012 10:46:22 -0000
From: "David Laight" <David.Laight@...LAB.COM>
To: "Rasesh Mody" <rmody@...cade.com>, <davem@...emloft.net>,
<netdev@...r.kernel.org>
Cc: <bhutchings@...arflare.com>,
<adapter_linux_open_src_team@...cade.com>
Subject: RE: [net-next 2/7] bna: Tx and Rx Optimizations
> #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)
David
--
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