net/mlx5: manage shared counters in three-level table
authorSuanming Mou <suanmingm@mellanox.com>
Thu, 18 Jun 2020 07:24:43 +0000 (15:24 +0800)
committerFerruh Yigit <ferruh.yigit@intel.com>
Tue, 30 Jun 2020 12:52:29 +0000 (14:52 +0200)
commit632f0f19056fdccfcaf9a1881240a406f6747316
treeef64b71c7305a9ac61bd962be0a38e4da995c7f7
parentbd81eaebd97ce33df3e23290f190e8dba1814f28
net/mlx5: manage shared counters in three-level table

Currently, to check if any shared counter with same ID existing, it will
have to loop the counter pools to search for the counter. Even add the
counter to the list will also not so helpful while there are thousands
of shared counters in the list.

Change Three-Level table to look up the counter index saved in the
relevant table entry will be more efficient.

This patch introduces the Three-level table to save the ID relevant
counter index in the table. Then the next while the same ID comes, just
check the table entry of this ID will get the counter index directly.
No search will be needed.

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