aboutsummaryrefslogtreecommitdiffstats
path: root/net/8021q
diff options
context:
space:
mode:
authordingtianhong <dingtianhong@huawei.com>2014-03-07 05:45:30 -0500
committerDavid S. Miller <davem@davemloft.net>2014-03-09 19:03:51 -0400
commit375f67df2811aafbb68f5d4f3bd27396023b36dd (patch)
tree8fe865bafa30f6302f4d6a3e9f81aaaaba35a933 /net/8021q
parent2d8d40afd187bced0a3d056366fb58d66fe845e3 (diff)
vlan: slight optimization for vlan_do_receive()
According Joe's suggestion, maybe it'd be faster to add an unlikely to the test for PCKET_OTHERHOST, so I add it and see whether the performance could be better, although the differences is so small and negligible, but it is hard to catch that any lower device would set the skb type to PACKET_OTHERHOST, so most of time, I think it make sense to add unlikely for the test. 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>
Diffstat (limited to 'net/8021q')
-rw-r--r--net/8021q/vlan_core.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/8021q/vlan_core.c b/net/8021q/vlan_core.c
index 6ee48aac776f..97815ec69161 100644
--- a/net/8021q/vlan_core.c
+++ b/net/8021q/vlan_core.c
@@ -22,7 +22,7 @@ bool vlan_do_receive(struct sk_buff **skbp)
22 return false; 22 return false;
23 23
24 skb->dev = vlan_dev; 24 skb->dev = vlan_dev;
25 if (skb->pkt_type == PACKET_OTHERHOST) { 25 if (unlikely(skb->pkt_type == PACKET_OTHERHOST)) {
26 /* Our lower layer thinks this is not local, let's make sure. 26 /* Our lower layer thinks this is not local, let's make sure.
27 * This allows the VLAN to have a different MAC than the 27 * This allows the VLAN to have a different MAC than the
28 * underlying device, and still route correctly. */ 28 * underlying device, and still route correctly. */