net/mlx5: optimize free counter lookup
authorSuanming Mou <suanmingm@mellanox.com>
Thu, 18 Jun 2020 08:12:50 +0000 (16:12 +0800)
committerFerruh Yigit <ferruh.yigit@intel.com>
Tue, 30 Jun 2020 12:52:30 +0000 (14:52 +0200)
commitac79183dc6f721814ba66b6cf3e7092cdc507eb2
treee7d9db63d6f904d444877d9354e804f348b29d5e
parentb1cc226644f1dcfc0400835f6f97ee116c4b4feb
net/mlx5: optimize free counter lookup

Currently, when allocate a new counter, it needs loop the whole
container pool list to get a free counter.

In the case with millions of counters allocated, and all the pools
are empty, allocate the new counter will still need to loop the
whole container pool list first, then allocate a new pool to get a
free counter. It wastes the cycles during the pool list traversal.

Add a global free counter list in the container helps to get the free
counters more efficiently.

Signed-off-by: Suanming Mou <suanmingm@mellanox.com>
Acked-by: Matan Azrad <matan@mellanox.com>
drivers/net/mlx5/mlx5.c
drivers/net/mlx5/mlx5.h
drivers/net/mlx5/mlx5_flow.c
drivers/net/mlx5/mlx5_flow_dv.c
drivers/net/mlx5/mlx5_flow_verbs.c