diff options
author | Li RongQing <lirongqing@baidu.com> | 2018-11-13 02:34:31 +0100 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2018-11-16 00:10:59 +0100 |
commit | 45cf7959c30402d7c4ea43568a6f1bab0ba6ca63 (patch) | |
tree | 0c8672578e4d0a9f5c60ad6310ccb55dc47f668f /security/security.c | |
parent | net: remove BUG_ON from __pskb_pull_tail (diff) | |
download | linux-45cf7959c30402d7c4ea43568a6f1bab0ba6ca63.tar.xz linux-45cf7959c30402d7c4ea43568a6f1bab0ba6ca63.zip |
net: slightly optimize eth_type_trans
netperf udp stream shows that eth_type_trans takes certain cpu,
so adjust the mac address check order, and firstly check if it
is device address, and only check if it is multicast address
only if not the device address.
After this change:
To unicast, and skb dst mac is device mac, this is most of time
reduce a comparision
To unicast, and skb dst mac is not device mac, nothing change
To multicast, increase a comparision
Before:
1.03% [kernel] [k] eth_type_trans
After:
0.78% [kernel] [k] eth_type_trans
Signed-off-by: Zhang Yu <zhangyu31@baidu.com>
Signed-off-by: Li RongQing <lirongqing@baidu.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'security/security.c')
0 files changed, 0 insertions, 0 deletions