net/mlx5e: Vxlan, replace ports radix-tree with hash table
authorGal Pressman <galp@mellanox.com>
Tue, 26 Dec 2017 16:27:08 +0000 (18:27 +0200)
committerSaeed Mahameed <saeedm@mellanox.com>
Fri, 27 Jul 2018 20:56:44 +0000 (13:56 -0700)
commitd30d8cde19726f177be7615f2e12700d994f6d7f
tree0aefde1251524d24070226b7d77cda03dce0ed4e
parent22a65aa8b1a84ca429c0fc8415dee5681ab36eb3
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>
drivers/net/ethernet/mellanox/mlx5/core/en.h
drivers/net/ethernet/mellanox/mlx5/core/vxlan.c
drivers/net/ethernet/mellanox/mlx5/core/vxlan.h