summaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/mellanox/mlx5/core/en.h
diff options
context:
space:
mode:
authorGal Pressman2017-12-26 17:27:08 +0100
committerSaeed Mahameed2018-07-27 22:56:44 +0200
commitd30d8cde19726f177be7615f2e12700d994f6d7f (patch)
tree0aefde1251524d24070226b7d77cda03dce0ed4e /drivers/net/ethernet/mellanox/mlx5/core/en.h
parentnet/mlx5e: Vxlan, check maximum number of UDP ports (diff)
downloadkernel-qcow2-linux-d30d8cde19726f177be7615f2e12700d994f6d7f.tar.gz
kernel-qcow2-linux-d30d8cde19726f177be7615f2e12700d994f6d7f.tar.xz
kernel-qcow2-linux-d30d8cde19726f177be7615f2e12700d994f6d7f.zip
net/mlx5e: Vxlan, replace ports radix-tree with hash table
The VXLAN database is accessed in the data path for each VXLAN TX skb in order to check whether the UDP port is being offloaded or not. The number of elements in the database is relatively small, we can simplify the radix-tree to a hash table and speedup the lookup process. Measuring mlx5e_vxlan_lookup_port execution time: Radix Tree Hash Table --------------- ------------ ------------ Single Stream 161 ns 79 ns (51% improvement) Multi Stream 259 ns 136 ns (47% improvement) Measuring UDP stream packet rate, single fully utilized TX core: Radix Tree: 498,300 PPS Hash Table: 555,468 PPS (11% improvement) Signed-off-by: Gal Pressman <galp@mellanox.com> Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
Diffstat (limited to 'drivers/net/ethernet/mellanox/mlx5/core/en.h')
-rw-r--r--drivers/net/ethernet/mellanox/mlx5/core/en.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en.h b/drivers/net/ethernet/mellanox/mlx5/core/en.h
index c4d4db8722f5..6878925c3abf 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en.h
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en.h
@@ -656,7 +656,8 @@ enum {
struct mlx5e_vxlan_db {
spinlock_t lock; /* protect vxlan table */
- struct radix_tree_root tree;
+ /* max_num_ports is usuallly 4, 16 buckets is more than enough */
+ DECLARE_HASHTABLE(htable, 4);
int num_ports;
};