DPDK patches and discussions
 help / color / mirror / Atom feed
From: Suanming Mou <suanmingm@nvidia.com>
To: <viacheslavo@nvidia.com>, <matan@nvidia.com>
Cc: <rasland@nvidia.com>, <dev@dpdk.org>, <stable@dpdk.org>
Subject: [PATCH] common/mlx5: fix list unused lcore check
Date: Tue, 31 May 2022 04:25:48 +0300	[thread overview]
Message-ID: <20220531012548.11156-1-suanmingm@nvidia.com> (raw)

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(-)

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);
-- 
2.25.1


             reply	other threads:[~2022-05-31  1:26 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-31  1:25 Suanming Mou [this message]
2022-06-05 15:06 ` Raslan Darawsheh

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220531012548.11156-1-suanmingm@nvidia.com \
    --to=suanmingm@nvidia.com \
    --cc=dev@dpdk.org \
    --cc=matan@nvidia.com \
    --cc=rasland@nvidia.com \
    --cc=stable@dpdk.org \
    --cc=viacheslavo@nvidia.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).