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:	Sun, 02 Mar 2014 17:49:44 -0800
From:	Joe Perches <joe@...ches.com>
To:	Ding Tianhong <dingtianhong@...wei.com>
Cc:	Patrick McHardy <kaber@...sh.net>,
	"David S. Miller" <davem@...emloft.net>,
	Julia Lawall <julia.lawall@...6.fr>,
	Netdev <netdev@...r.kernel.org>
Subject: Re: [PATCH net-next] vlan: use ether_addr_equal_64bits to instead
 of ether_addr_equal

On Mon, 2014-03-03 at 09:14 +0800, Ding Tianhong wrote:
> Ether_addr_equal_64bits is more efficient than ether_addr_equal, and
> can be used when each argument is an array within a structure that
> contains at least two bytes of data beyond the array, so it is safe
> to use it for vlan.
[]
> diff --git a/net/8021q/vlan_core.c b/net/8021q/vlan_core.c
[]
> @@ -26,7 +26,7 @@ bool vlan_do_receive(struct sk_buff **skbp)
>  		/* Our lower layer thinks this is not local, let's make sure.
>  		 * This allows the VLAN to have a different MAC than the
>  		 * underlying device, and still route correctly. */
> -		if (ether_addr_equal(eth_hdr(skb)->h_dest, vlan_dev->dev_addr))
> +		if (ether_addr_equal_64bits(eth_hdr(skb)->h_dest, vlan_dev->dev_addr))
>  			skb->pkt_type = PACKET_HOST;
>  	}

Hi again Ding

If you do have performance numbers:

The lines above this ether_addr_equal_64 are:

	if (skb->pkt_type == PACKET_OTHERHOST) {
		/* Our lower layer thinks this is not local, let's make sure.
		 * This allows the VLAN to have a different MAC than the
		 * underlying device, and still route correctly. */
		if (ether_addr_equal(eth_hdr(skb)->h_dest, vlan_dev->dev_addr))
			skb->pkt_type = PACKET_HOST;
	}

Maybe it'd be faster overall to add an unlikely
to the == test

	if (unlikely(skb->pkt_type == PACKET_OTHERHOST)) {


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