]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
vxlan: Avoid unnecessary updates to FDB 'used' time
authorIdo Schimmel <idosch@nvidia.com>
Tue, 4 Feb 2025 14:55:48 +0000 (16:55 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 9 Sep 2025 16:58:11 +0000 (18:58 +0200)
[ Upstream commit 9722f834fe9a7c583591defa2cab3f652f50a5f0 ]

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 <petrm@nvidia.com>
Signed-off-by: Ido Schimmel <idosch@nvidia.com>
Reviewed-by: Nikolay Aleksandrov <razor@blackwall.org>
Link: https://patch.msgid.link/20250204145549.1216254-8-idosch@nvidia.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Stable-dep-of: 1f5d2fd1ca04 ("vxlan: Fix NPD in {arp,neigh}_reduce() when using nexthop objects")
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/vxlan/vxlan_core.c

index ce9c979080bb49bd41a951b1a2e3473a8e7c5dbc..8853fcb7eb7f2df814c1234311567123690bbc8f 100644 (file)
@@ -1047,10 +1047,8 @@ static int vxlan_fdb_update_existing(struct vxlan_dev *vxlan,
                notify |= rc;
        }
 
-       if (ndm_flags & NTF_USE) {
-               WRITE_ONCE(f->used, jiffies);
+       if (ndm_flags & NTF_USE)
                WRITE_ONCE(f->updated, jiffies);
-       }
 
        if (notify) {
                if (rd == NULL)
@@ -1294,7 +1292,7 @@ int __vxlan_fdb_delete(struct vxlan_dev *vxlan,
        struct vxlan_fdb *f;
        int err = -ENOENT;
 
-       f = vxlan_find_mac(vxlan, addr, src_vni);
+       f = __vxlan_find_mac(vxlan, addr, src_vni);
        if (!f)
                return err;
 
@@ -1458,7 +1456,7 @@ static enum skb_drop_reason vxlan_snoop(struct net_device *dev,
                ifindex = src_ifindex;
 #endif
 
-       f = vxlan_find_mac(vxlan, src_mac, vni);
+       f = __vxlan_find_mac(vxlan, src_mac, vni);
        if (likely(f)) {
                struct vxlan_rdst *rdst = first_remote_rcu(f);
 
@@ -4718,7 +4716,7 @@ vxlan_fdb_offloaded_set(struct net_device *dev,
 
        spin_lock_bh(&vxlan->hash_lock[hash_index]);
 
-       f = vxlan_find_mac(vxlan, fdb_info->eth_addr, fdb_info->vni);
+       f = __vxlan_find_mac(vxlan, fdb_info->eth_addr, fdb_info->vni);
        if (!f)
                goto out;
 
@@ -4774,7 +4772,7 @@ vxlan_fdb_external_learn_del(struct net_device *dev,
        hash_index = fdb_head_index(vxlan, fdb_info->eth_addr, fdb_info->vni);
        spin_lock_bh(&vxlan->hash_lock[hash_index]);
 
-       f = vxlan_find_mac(vxlan, fdb_info->eth_addr, fdb_info->vni);
+       f = __vxlan_find_mac(vxlan, fdb_info->eth_addr, fdb_info->vni);
        if (!f)
                err = -ENOENT;
        else if (f->flags & NTF_EXT_LEARNED)