lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
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

Powered by Openwall GNU/*/Linux Powered by OpenVZ