Skip to content

Commit

Permalink
vxlan: reduce dirty cache line in vxlan_find_mac
Browse files Browse the repository at this point in the history
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: Zhang Yu <zhangyu31@baidu.com>
Signed-off-by: Li RongQing <lirongqing@baidu.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Li RongQing authored and David S. Miller committed Aug 30, 2018
1 parent 920767a commit 016f3d1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/net/vxlan.c
Original file line number Diff line number Diff line change
Expand Up @@ -464,7 +464,7 @@ static struct vxlan_fdb *vxlan_find_mac(struct vxlan_dev *vxlan,
struct vxlan_fdb *f;

f = __vxlan_find_mac(vxlan, mac, vni);
if (f)
if (f && f->used != jiffies)
f->used = jiffies;

return f;
Expand Down

0 comments on commit 016f3d1

Please sign in to comment.