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]
Message-ID: <1377113895.1936.50.camel@joe-AO722>
Date:	Wed, 21 Aug 2013 12:38:15 -0700
From:	Joe Perches <joe@...ches.com>
To:	Sergei Shtylyov <sergei.shtylyov@...entembedded.com>
Cc:	Arvid Brodin <arvid.brodin@...n.com>,
	"netdev@...r.kernel.org" <netdev@...r.kernel.org>,
	Stephen Hemminger <shemminger@...tta.com>,
	Javier Boticario <jboticario@...il.com>,
	balferreira <balferreira@...glemail.com>,
	David Miller <davem@...emloft.net>
Subject: Re: [PATCH v3] net/hsr: Add support for the High-availability
 Seamless Redundancy protocol (HSRv0)

On Wed, 2013-08-21 at 23:05 +0400, Sergei Shtylyov wrote:
> On 08/21/2013 11:01 PM, Joe Perches wrote:
> >> High-availability Seamless Redundancy ("HSR") provides instant failover
> >> redundancy for Ethernet networks. It requires a special network topology where
> >> all nodes are connected in a ring (each node having two physical network
> >> interfaces). It is suited for applications that demand high availability and
> >> very short reaction time.

Hi back.

> >> +	if (likely(res1 == NET_XMIT_SUCCESS || res1 == NET_XMIT_CN ||
> >> +		   res2 == NET_XMIT_SUCCESS || res2 == NET_XMIT_CN)) {
> 
> > This might be faster using | instead of ||
> 
>     Doesn't || use shortcut evaluation in C? I.e. if the 1st == evaluates to 
> true, other comparisons are not even done.

Yes it does.

But if the 1st 3 comparisons are false and the
last comparison is true then those 3 tests and 
jumps are also done which takes additional
branch predictions paths.  Oring is fast.


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