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: <52BEEBD5.1040301@gmail.com>
Date:	Sat, 28 Dec 2013 23:18:45 +0800
From:	Ding Tianhong <dthxman@...il.com>
To:	Sergei Shtylyov <sergei.shtylyov@...entembedded.com>,
	Ding Tianhong <dingtianhong@...wei.com>,
	"David S. Miller" <davem@...emloft.net>,
	Netdev <netdev@...r.kernel.org>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH net-next v2 11/20] net: packetengines: slight optimization
 of addr

于 2013/12/28 21:58, Sergei Shtylyov 写道:
> Hello.
> 
> On 28-12-2013 10:17, Ding Tianhong wrote:
> 
>> Use possibly more efficient ether_addr_equal
>> to instead of memcmp.
> 
>> Cc: "David S. Miller" <davem@...emloft.net>
>> Signed-off-by: Ding Tianhong <dingtianhong@...wei.com>
>> ---
>>   drivers/net/ethernet/packetengines/yellowfin.c |   12 ++++++------
>>   1 files changed, 6 insertions(+), 6 deletions(-)
> 
>> diff --git a/drivers/net/ethernet/packetengines/yellowfin.c b/drivers/net/ethernet/packetengines/yellowfin.c
>> index d28593b..b83ac0e 100644
>> --- a/drivers/net/ethernet/packetengines/yellowfin.c
>> +++ b/drivers/net/ethernet/packetengines/yellowfin.c
>> @@ -1097,12 +1097,12 @@ static int yellowfin_rx(struct net_device *dev)
>>               if (status2 & 0x80) dev->stats.rx_dropped++;
>>   #ifdef YF_PROTOTYPE        /* Support for prototype hardware errata. */
>>           } else if ((yp->flags & HasMACAddrBug)  &&
>> -            memcmp(le32_to_cpu(yp->rx_ring_dma +
>> -                entry*sizeof(struct yellowfin_desc)),
>> -                dev->dev_addr, 6) != 0 &&
>> -            memcmp(le32_to_cpu(yp->rx_ring_dma +
>> -                entry*sizeof(struct yellowfin_desc)),
>> -                "\377\377\377\377\377\377", 6) != 0) {
>> +            !ether_addr_equal(le32_to_cpu(yp->rx_ring_dma +
>> +                              entry * sizeof(struct yellowfin_desc)),
>> +                              dev->dev_addr) &&
> 
>    Previous line was aligned correctly, the above line should start under le32_to_cpu.
> 
>> +            !ether_addr_equal(le32_to_cpu(yp->rx_ring_dma +
>> +                              entry * sizeof(struct yellowfin_desc)),
> 
>    Start the continuation lines under 'yp', please.
> 
>> +                              "\377\377\377\377\377\377")) {
> 
>    This line should start under le32_to_cpu.
> 
> WBR, Sergei
> 

Hi sergei:
you mean this way?
	!ether_addr_equal(le32_to_cpu(yp->rx_ring_dma +
				      entry * sizeof(struct yellowfin_desc)),
			  dev->dev_addr) &&

	!ether_addr_equal(le32_to_cpu(yp->rx_ring_dma +
				      entry * sizeof(struct yellowfin_desc)),
			  "\377\377\377\377\377\377")) {

Regards
Ding

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

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