net/mlx5: fix the needless reference count for table
PATCH 1/1 net/mlx5: fix the needless reference count for table
In the previous implementation, a count was used to record the number of the references to a table resource, including the creation of the table, the jumping to the table and the matchers created on the table. Before releasing the table resource via the driver, it needed to ensure that there is no reference to this table.
After the optimization of the resources management, the reference count now is in the hash list entry as a unified solution for all the resources management.
There is no need to keep the "refcnt" in the table resource structure. It is removed in case that there is some unnecessary memory overhead.
--- drivers/net/mlx5/mlx5.h | 1 - 1 file changed, 1 deletion(-)
drivers/net/mlx5/mlx5.h +0 -1
@@ -993,7 +993,6 @@ union mlx5_flow_tbl_key {/* Table structure. */ struct mlx5_flow_tbl_resource {void *obj;/**< Pointer to DR table object. */ -uint32_t refcnt;/**< Reference counter. */ };#define MLX5_MAX_TABLES UINT16_MAX
Signature · 1 line
2.25.1
Hi,
Quoted 22 lines
-----Original Message-----
From: Bing Zhao <[email protected]>
Sent: Wednesday, March 2, 2022 9:58 AM
To: Slava Ovsiienko <[email protected]>; Matan Azrad <[email protected]>
Cc: [email protected]; Raslan Darawsheh <[email protected]>; Xueming(Steven) Li <[email protected]>; [email protected]
Subject: [PATCH] net/mlx5: fix the needless reference count for tableIn the previous implementation, a count was used to record the number of the references to a table resource, including the creation of the table, the jumping to the table and the matchers created on the table. Before releasing the table resource via the driver, it needed to ensure that there is no reference to this table.
After the optimization of the resources management, the reference count now is in the hash list entry as a unified solution for all the resources management.
There is no need to keep the "refcnt" in the table resource structure. It is removed in case that there is some unnecessary memory overhead.
Quoted 6 lines
Fixes afd7a62514ad ("net/mlx5: make flow table cache thread safe")Signed-off-by Bing Zhao <[email protected]>Acked-by Matan Azrad <[email protected]>
Patch applied to next-net-mlx,
Kindest regards,
Raslan Darawsheh