net/mlx5: fix the needless reference count for table

Message ID 20220302075735.53985-1-bingz@nvidia.com (mailing list archive)
State Accepted, archived
Delegated to: Raslan Darawsheh
Headers
Series net/mlx5: fix the needless reference count for table |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK
ci/intel-Testing success Testing PASS
ci/iol-broadcom-Functional success Functional Testing PASS
ci/iol-mellanox-Performance success Performance Testing PASS
ci/github-robot: build success github build: passed
ci/iol-broadcom-Performance success Performance Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-aarch64-unit-testing success Testing PASS
ci/iol-x86_64-compile-testing success Testing PASS
ci/iol-x86_64-unit-testing success Testing PASS
ci/iol-aarch64-compile-testing success Testing PASS
ci/iol-abi-testing success Testing PASS

Commit Message

Bing Zhao March 2, 2022, 7:57 a.m. UTC
  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.

Fixes: afd7a62514ad ("net/mlx5: make flow table cache thread safe")
Cc: xuemingl@nvidia.com
Cc: stable@dpdk.org

Signed-off-by: Bing Zhao <bingz@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
---
 drivers/net/mlx5/mlx5.h | 1 -
 1 file changed, 1 deletion(-)
  

Comments

Raslan Darawsheh March 7, 2022, 10:32 a.m. UTC | #1
Hi,

> -----Original Message-----
> From: Bing Zhao <bingz@nvidia.com>
> Sent: Wednesday, March 2, 2022 9:58 AM
> To: Slava Ovsiienko <viacheslavo@nvidia.com>; Matan Azrad
> <matan@nvidia.com>
> Cc: dev@dpdk.org; Raslan Darawsheh <rasland@nvidia.com>;
> Xueming(Steven) Li <xuemingl@nvidia.com>; stable@dpdk.org
> Subject: [PATCH] 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.
> 
> Fixes: afd7a62514ad ("net/mlx5: make flow table cache thread safe")
> Cc: xuemingl@nvidia.com
> Cc: stable@dpdk.org
> 
> Signed-off-by: Bing Zhao <bingz@nvidia.com>
> Acked-by: Matan Azrad <matan@nvidia.com>

Patch applied to next-net-mlx,

Kindest regards,
Raslan Darawsheh
  

Patch

diff --git a/drivers/net/mlx5/mlx5.h b/drivers/net/mlx5/mlx5.h
index 0f0045a2b5..dd5cd9209f 100644
--- a/drivers/net/mlx5/mlx5.h
+++ b/drivers/net/mlx5/mlx5.h
@@ -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