Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

vlan: use use ether_addr_equal_64bits to instead of ether_addr_equal

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, and make sense for fast path.

Cc: Joe Perches <joe@perches.com>
Cc: Patrick McHardy <kaber@trash.net>
Cc: David S. Miller <davem@davemloft.net>
Signed-off-by: Ding Tianhong <dingtianhong@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

dingtianhong and committed by
David S. Miller
be14cc98 375f67df

+1 -1
+1 -1
net/8021q/vlan_core.c
··· 26 26 /* Our lower layer thinks this is not local, let's make sure. 27 27 * This allows the VLAN to have a different MAC than the 28 28 * underlying device, and still route correctly. */ 29 - if (ether_addr_equal(eth_hdr(skb)->h_dest, vlan_dev->dev_addr)) 29 + if (ether_addr_equal_64bits(eth_hdr(skb)->h_dest, vlan_dev->dev_addr)) 30 30 skb->pkt_type = PACKET_HOST; 31 31 } 32 32