common/mlx5: remove unused lcore check
authorSuanming Mou <suanmingm@nvidia.com>
Tue, 31 May 2022 01:25:48 +0000 (04:25 +0300)
committerRaslan Darawsheh <rasland@nvidia.com>
Sun, 5 Jun 2022 15:04:43 +0000 (17:04 +0200)
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

index 775fabd..58d744b 100644 (file)
@@ -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);