summaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
authorLi RongQing <lirongqing@baidu.com>2018-11-13 09:34:31 +0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2024-05-17 11:42:37 +0200
commita82fcda87f9ba6ca65d8c0020de72237d5462766 (patch)
tree6f764bea75055bc04d6f5cd5f3aefdaacdd03c2f /include/linux
parentb0b59d1e86b7997fa625585432220c796064df64 (diff)
downloadlinux-stable-a82fcda87f9ba6ca65d8c0020de72237d5462766.tar.gz
linux-stable-a82fcda87f9ba6ca65d8c0020de72237d5462766.tar.bz2
linux-stable-a82fcda87f9ba6ca65d8c0020de72237d5462766.zip
net: slightly optimize eth_type_trans
[ Upstream commit 45cf7959c30402d7c4ea43568a6f1bab0ba6ca63 ] 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> Stable-dep-of: 6e159fd653d7 ("ethernet: Add helper for assigning packet type when dest address does not match device address") Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'include/linux')
0 files changed, 0 insertions, 0 deletions