Commit 016f3d18 authored by Li RongQing's avatar Li RongQing Committed by David S. Miller

vxlan: reduce dirty cache line in vxlan_find_mac

vxlan_find_mac() unconditionally set f->used for every packet,
this causes a cache miss for every packet, since remote, hlist
and used of vxlan_fdb share the same cache line, which are
accessed when send every packets.

so f->used is set only if not equal to jiffies, to reduce dirty
cache line times, this gives 3% speed-up with small packets.
Signed-off-by: default avatarZhang Yu <zhangyu31@baidu.com>
Signed-off-by: default avatarLi RongQing <lirongqing@baidu.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 920767a9
...@@ -464,7 +464,7 @@ static struct vxlan_fdb *vxlan_find_mac(struct vxlan_dev *vxlan, ...@@ -464,7 +464,7 @@ static struct vxlan_fdb *vxlan_find_mac(struct vxlan_dev *vxlan,
struct vxlan_fdb *f; struct vxlan_fdb *f;
f = __vxlan_find_mac(vxlan, mac, vni); f = __vxlan_find_mac(vxlan, mac, vni);
if (f) if (f && f->used != jiffies)
f->used = jiffies; f->used = jiffies;
return f; return f;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment