net/mlx5: optimize single counter pool search
authorSuanming Mou <suanmingm@mellanox.com>
Thu, 18 Jun 2020 07:24:44 +0000 (15:24 +0800)
committerFerruh Yigit <ferruh.yigit@intel.com>
Tue, 30 Jun 2020 12:52:29 +0000 (14:52 +0200)
commitb1cc226644f1dcfc0400835f6f97ee116c4b4feb
treeee0738a1b31b1658c8015b839d44cc4488330f45
parent632f0f19056fdccfcaf9a1881240a406f6747316
net/mlx5: optimize single counter pool search

For single counter, when allocate a new counter, it needs to find the pool
it belongs in order to do the query together.

Once there are millions of counters allocated, the pool array in the
counter container will become very large. In this case, the pool search
from the pool array will become extremely slow.

Save the minimum and maximum counter ID to have a quick check of current
counter ID range. And start searching the pool from the last pool in the
container will mostly get the needed pool since counter ID increases
sequentially.

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_dv.c