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, 28 Jan 2011 11:59:39 -0800 (PST)
From:	David Miller <davem@...emloft.net>
To:	scottwood@...escale.com
Cc:	David.Laight@...LAB.COM, netdev@...r.kernel.org,
	linuxppc-dev@...ts.ozlabs.org
Subject: Re: [PATCH v2] gianfar: Fall back to software tcp/udp checksum on
 oldercontrollers

From: Scott Wood <scottwood@...escale.com>
Date: Fri, 28 Jan 2011 10:56:10 -0600

> On Fri, 28 Jan 2011 09:10:46 +0000
> David Laight <David.Laight@...LAB.COM> wrote:
> 
>>  
>> > +		if (unlikely(gfar_has_errata(priv, GFAR_ERRATA_12)
>> > +			     && ((unsigned long)fcb % 0x20) > 0x18)) {
>> 
>> You need to check the generated code, but I think you need:
>> 
>>     if (unlikely(gfar_has_errata(priv, GFAR_ERRATA_12))
>> 	     && unlikely(((unsigned long)fcb % 0x20) > 0x18))
>> 
>> ie unlikely() around both the primitive comparisons.
> 
> Is the first condition actually unlikely?  If you've got affected
> hardware, you'll hit it every time.
> 
> If packets with the problematic alignment are rare, seems like it'd be
> better to check that first.

In cases like this gfar_has_errata() case, better to leave it's
likelyhood unmarked.

And yes, since it's cheaper, checking the alignment should be done
first.
--
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