Skip to content

Commit 9722f83

Browse files
idoschkuba-moo
authored andcommitted
vxlan: Avoid unnecessary updates to FDB 'used' time
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]>
1 parent b4a1d98 commit 9722f83

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
@@ -1049,10 +1049,8 @@ static int vxlan_fdb_update_existing(struct vxlan_dev *vxlan,
10491049
notify |= rc;
10501050
}
10511051

1052-
if (ndm_flags & NTF_USE) {
1053-
WRITE_ONCE(f->used, jiffies);
1052+
if (ndm_flags & NTF_USE)
10541053
WRITE_ONCE(f->updated, jiffies);
1055-
}
10561054

10571055
if (notify) {
10581056
if (rd == NULL)
@@ -1297,7 +1295,7 @@ int __vxlan_fdb_delete(struct vxlan_dev *vxlan,
12971295
struct vxlan_fdb *f;
12981296
int err = -ENOENT;
12991297

1300-
f = vxlan_find_mac(vxlan, addr, src_vni);
1298+
f = __vxlan_find_mac(vxlan, addr, src_vni);
13011299
if (!f)
13021300
return err;
13031301

@@ -1464,7 +1462,7 @@ static enum skb_drop_reason vxlan_snoop(struct net_device *dev,
14641462
ifindex = src_ifindex;
14651463
#endif
14661464

1467-
f = vxlan_find_mac(vxlan, src_mac, vni);
1465+
f = __vxlan_find_mac(vxlan, src_mac, vni);
14681466
if (likely(f)) {
14691467
struct vxlan_rdst *rdst = first_remote_rcu(f);
14701468
unsigned long now = jiffies;
@@ -4773,7 +4771,7 @@ vxlan_fdb_offloaded_set(struct net_device *dev,
47734771

47744772
spin_lock_bh(&vxlan->hash_lock[hash_index]);
47754773

4776-
f = vxlan_find_mac(vxlan, fdb_info->eth_addr, fdb_info->vni);
4774+
f = __vxlan_find_mac(vxlan, fdb_info->eth_addr, fdb_info->vni);
47774775
if (!f)
47784776
goto out;
47794777

@@ -4829,7 +4827,7 @@ vxlan_fdb_external_learn_del(struct net_device *dev,
48294827
hash_index = fdb_head_index(vxlan, fdb_info->eth_addr, fdb_info->vni);
48304828
spin_lock_bh(&vxlan->hash_lock[hash_index]);
48314829

4832-
f = vxlan_find_mac(vxlan, fdb_info->eth_addr, fdb_info->vni);
4830+
f = __vxlan_find_mac(vxlan, fdb_info->eth_addr, fdb_info->vni);
48334831
if (!f)
48344832
err = -ENOENT;
48354833
else if (f->flags & NTF_EXT_LEARNED)

0 commit comments

Comments
 (0)