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] [thread-next>] [day] [month] [year] [list]
Date:	Mon, 22 Feb 2016 10:54:32 +0000
From:	David Laight <David.Laight@...LAB.COM>
To:	'Joe Perches' <joe@...ches.com>,
	Jeff Kirsher <jeffrey.t.kirsher@...el.com>,
	"davem@...emloft.net" <davem@...emloft.net>
CC:	Mitch Williams <mitch.a.williams@...el.com>,
	"netdev@...r.kernel.org" <netdev@...r.kernel.org>,
	"nhorman@...hat.com" <nhorman@...hat.com>,
	"sassmann@...hat.com" <sassmann@...hat.com>,
	"jogreene@...hat.com" <jogreene@...hat.com>
Subject: RE: [net-next 13/15] i40e/i40evf: use logical operators, not bitwise

From: Joe Perches
> Sent: 18 February 2016 04:59
> On Wed, 2016-02-17 at 19:38 -0800, Jeff Kirsher wrote:
> > From: Mitch Williams <mitch.a.williams@...el.com>
> >
> > Mr. Spock would certainly raise an eyebrow to see us using bitwise
> > operators, when we should clearly be relying on logic. Fascinating.
> 
> I think it read better before this change.
> 
> Spock might have looked at the type of the
> variable before raising that eyebrow.
> 
> clean_complete is bool so it's not actually a
> bitwise operation,

Except that, of course, you may well want a bitwise operation
in order to remove slow conditional instructions.

Hopefully gcc generates a bit-wise 'and' provided that i40e_clean_tx_irq()
returns a 'bool'.

	David

> > diff --git a/drivers/net/ethernet/intel/i40e/i40e_txrx.c
> b/drivers/net/ethernet/intel/i40e/i40e_txrx.c
> []
> > @@ -1996,7 +1996,8 @@ int i40e_napi_poll(struct napi_struct *napi, int budget)
> >  	 * budget and be more aggressive about cleaning up the Tx descriptors.
> >  	 */
> >  	i40e_for_each_ring(ring, q_vector->tx) {
> > -		clean_complete &= i40e_clean_tx_irq(ring, vsi->work_limit);
> > +		clean_complete = clean_complete &&
> > +				 i40e_clean_tx_irq(ring, vsi->work_limit);
> 
> etc...

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ