]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
vlan: use use ether_addr_equal_64bits to instead of ether_addr_equal
authordingtianhong <dingtianhong@huawei.com>
Fri, 7 Mar 2014 10:45:31 +0000 (18:45 +0800)
committerDavid S. Miller <davem@davemloft.net>
Sun, 9 Mar 2014 23:03:51 +0000 (19:03 -0400)
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>
net/8021q/vlan_core.c

index 97815ec69161d43e61cea6e796e548346b70d576..35b3c192d7b90b97faaa684868b75fec47d200f7 100644 (file)
@@ -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;
        }