Subject: Re: [PATCH v3] net/hsr: Add support for the High-availability Seamless Redundancy protocol (HSRv0)

From: Sergei Shtylyov <[email-masked]>
Date: Wed, 21 Aug 2013 23:05:57 +0400

Hello.

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

> just trivia:

>> diff --git a/net/hsr/hsr_device.c b/net/hsr/hsr_device.c
> []
>> +static int hsr_dev_xmit(struct sk_buff *skb, struct net_device *dev)
> []
>> +	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.

WBR, Sergei