Skip to content

Commit 9238419

Browse files
idoschgregkh
authored andcommitted
vxlan: Avoid unnecessary updates to FDB 'used' time
[ Upstream commit 9722f83 ] Now that the VXLAN driver ages out FDB entries based on their 'updated' time we can remove unnecessary updates of the 'used' time from the Rx path and the control path, so that the 'used' time is only updated by the Tx path. Reviewed-by: Petr Machata <[email protected]> Signed-off-by: Ido Schimmel <[email protected]> Reviewed-by: Nikolay Aleksandrov <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]> Stable-dep-of: 1f5d2fd ("vxlan: Fix NPD in {arp,neigh}_reduce() when using nexthop objects") Signed-off-by: Sasha Levin <[email protected]>
1 parent 300b4e8 commit 9238419

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

drivers/net/vxlan/vxlan_core.c

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1047,10 +1047,8 @@ static int vxlan_fdb_update_existing(struct vxlan_dev *vxlan,
10471047
notify |= rc;
10481048
}
10491049

1050-
if (ndm_flags & NTF_USE) {
1051-
WRITE_ONCE(f->used, jiffies);
1050+
if (ndm_flags & NTF_USE)
10521051
WRITE_ONCE(f->updated, jiffies);
1053-
}
10541052

10551053
if (notify) {
10561054
if (rd == NULL)
@@ -1294,7 +1292,7 @@ int __vxlan_fdb_delete(struct vxlan_dev *vxlan,
12941292
struct vxlan_fdb *f;
12951293
int err = -ENOENT;
12961294

1297-
f = vxlan_find_mac(vxlan, addr, src_vni);
1295+
f = __vxlan_find_mac(vxlan, addr, src_vni);
12981296
if (!f)
12991297
return err;
13001298

@@ -1458,7 +1456,7 @@ static enum skb_drop_reason vxlan_snoop(struct net_device *dev,
14581456
ifindex = src_ifindex;
14591457
#endif
14601458

1461-
f = vxlan_find_mac(vxlan, src_mac, vni);
1459+
f = __vxlan_find_mac(vxlan, src_mac, vni);
14621460
if (likely(f)) {
14631461
struct vxlan_rdst *rdst = first_remote_rcu(f);
14641462

@@ -4718,7 +4716,7 @@ vxlan_fdb_offloaded_set(struct net_device *dev,
47184716

47194717
spin_lock_bh(&vxlan->hash_lock[hash_index]);
47204718

4721-
f = vxlan_find_mac(vxlan, fdb_info->eth_addr, fdb_info->vni);
4719+
f = __vxlan_find_mac(vxlan, fdb_info->eth_addr, fdb_info->vni);
47224720
if (!f)
47234721
goto out;
47244722

@@ -4774,7 +4772,7 @@ vxlan_fdb_external_learn_del(struct net_device *dev,
47744772
hash_index = fdb_head_index(vxlan, fdb_info->eth_addr, fdb_info->vni);
47754773
spin_lock_bh(&vxlan->hash_lock[hash_index]);
47764774

4777-
f = vxlan_find_mac(vxlan, fdb_info->eth_addr, fdb_info->vni);
4775+
f = __vxlan_find_mac(vxlan, fdb_info->eth_addr, fdb_info->vni);
47784776
if (!f)
47794777
err = -ENOENT;
47804778
else if (f->flags & NTF_EXT_LEARNED)

0 commit comments

Comments
 (0)