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, 19 Oct 2015 15:07:46 -0700
From:	Michael Chan <mchan@...adcom.com>
To:	Stephen Hemminger <stephen@...workplumber.org>
CC:	<davem@...emloft.net>, <prashant@...adcom.com>,
	<eddie.wai@...adcom.com>, <huangjw@...adcom.com>,
	<netdev@...r.kernel.org>
Subject: Re: [PATCH net-next v3] bnxt_en: New Broadcom ethernet driver.

On Sun, 2015-10-18 at 22:21 -0700, Stephen Hemminger wrote: 
> On Sat, 17 Oct 2015 00:21:44 -0400
> Michael Chan <mchan@...adcom.com> wrote:
> 
> > +static inline u32 bnxt_tx_avail(struct bnxt *bp, struct bnxt_tx_ring_info *txr)
> > +{
> > +	/* Tell compiler to fetch tx indices from memory. */
> > +	barrier();
> 
> Actually, you are telling compiler not to reorder. Which may not
> be sufficient on some platforms. 

Only a compiler barrier is needed here to prevent the compiler from
optimizing out the memory access of tx_prod and tx_cons, in case it
thinks that it has those values in some registers.

> 
> 
> > +	return bp->tx_ring_size -
> > +		((txr->tx_prod - txr->tx_cons) & bp->tx_ring_mask);
> > +}


--
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