summaryrefslogtreecommitdiff
path: root/include/net
diff options
context:
space:
mode:
authorIdo Schimmel <idosch@nvidia.com>2025-04-15 15:11:43 +0300
committerPaolo Abeni <pabeni@redhat.com>2025-04-22 11:11:16 +0200
commit1f763fa808e92a67feea8364ef80ca3065d74702 (patch)
treecd739f09b082838ac58856be1d4ae36818834163 /include/net
parentf13f3b4157dd9a05a5b651dfd15a4efa2df06f67 (diff)
vxlan: Convert FDB table to rhashtable
FDB entries are currently stored in a hash table with a fixed number of buckets (256), resulting in performance degradation as the number of entries grows. Solve this by converting the driver to use rhashtable which maintains more or less constant performance regardless of the number of entries. Measured transmitted packets per second using a single pktgen thread with varying number of entries when the transmitted packet always hits the default entry (worst case): Number of entries | Improvement ------------------|------------ 1k | +1.12% 4k | +9.22% 16k | +55% 64k | +585% 256k | +2460% In addition, the change reduces the size of the VXLAN device structure from 2584 bytes to 672 bytes. Reviewed-by: Petr Machata <petrm@nvidia.com> Signed-off-by: Ido Schimmel <idosch@nvidia.com> Link: https://patch.msgid.link/20250415121143.345227-16-idosch@nvidia.com Reviewed-by: Nikolay Aleksandrov <razor@blackwall.org> Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Diffstat (limited to 'include/net')
-rw-r--r--include/net/vxlan.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/include/net/vxlan.h b/include/net/vxlan.h
index 96a6c6f45c2e..e2f7ca045d3e 100644
--- a/include/net/vxlan.h
+++ b/include/net/vxlan.h
@@ -304,7 +304,7 @@ struct vxlan_dev {
struct vxlan_vni_group __rcu *vnigrp;
- struct hlist_head fdb_head[FDB_HASH_SIZE];
+ struct rhashtable fdb_hash_tbl;
struct rhashtable mdb_tbl;
struct hlist_head fdb_list;