common/mlx5: fix list unused lcore check

Message ID 20220531012548.11156-1-suanmingm@nvidia.com (mailing list archive)
State Accepted, archived
Delegated to: Raslan Darawsheh
Headers
Series common/mlx5: fix list unused lcore check |

Checks

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

Commit Message

Suanming Mou May 31, 2022, 1:25 a.m. UTC
  While non-lcore list operations were supported, non-lcore index will
be converted to MLX5_LIST_NLCORE. In that case, no need to check the
lcore index be -1 or not anymore.

This commit removes the unused lcore check in list.

Fixes: 7e1cf892711b ("common/mlx5: support list non-lcore operations")
Cc: stable@dpdk.org

Signed-off-by: Suanming Mou <suanmingm@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
---
 drivers/common/mlx5/mlx5_common_utils.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
  

Comments

Raslan Darawsheh June 5, 2022, 3:06 p.m. UTC | #1
Hi,

> -----Original Message-----
> From: Suanming Mou <suanmingm@nvidia.com>
> Sent: Tuesday, May 31, 2022 4:26 AM
> To: Slava Ovsiienko <viacheslavo@nvidia.com>; Matan Azrad
> <matan@nvidia.com>
> Cc: Raslan Darawsheh <rasland@nvidia.com>; dev@dpdk.org;
> stable@dpdk.org
> Subject: [PATCH] common/mlx5: fix list unused lcore check
> 
> While non-lcore list operations were supported, non-lcore index will be
> converted to MLX5_LIST_NLCORE. In that case, no need to check the lcore
> index be -1 or not anymore.
> 
> This commit removes the unused lcore check in list.
> 
> Fixes: 7e1cf892711b ("common/mlx5: support list non-lcore operations")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Suanming Mou <suanmingm@nvidia.com>
> Acked-by: Matan Azrad <matan@nvidia.com>

Patch applied to next-net-mlx,

Kindest regards,
Raslan Darawsheh
  

Patch

diff --git a/drivers/common/mlx5/mlx5_common_utils.c b/drivers/common/mlx5/mlx5_common_utils.c
index 775fabd478..58d744b4d4 100644
--- a/drivers/common/mlx5/mlx5_common_utils.c
+++ b/drivers/common/mlx5/mlx5_common_utils.c
@@ -293,11 +293,9 @@  _mlx5_list_unregister(struct mlx5_list_inconst *l_inconst,
 			l_const->cb_clone_free(l_const->ctx, entry);
 		else
 			l_const->cb_remove(l_const->ctx, entry);
-	} else if (likely(lcore_idx != -1)) {
+	} else {
 		__atomic_add_fetch(&l_inconst->cache[entry->lcore_idx]->inv_cnt,
 				   1, __ATOMIC_RELAXED);
-	} else {
-		return 0;
 	}
 	if (!l_const->lcores_share) {
 		__atomic_sub_fetch(&l_inconst->count, 1, __ATOMIC_RELAXED);