DPDK patches and discussions
 help / color / mirror / Atom feed
From: Matan Azrad <matan@nvidia.com>
To: dev@dpdk.org
Cc: Viacheslav Ovsiienko <viacheslavo@nvidia.com>, stable@dpdk.org
Subject: [dpdk-dev] [PATCH 3/4] net/mlx5: fix event queue number query
Date: Thu, 15 Oct 2020 06:38:12 +0000	[thread overview]
Message-ID: <1602743893-345348-3-git-send-email-matan@nvidia.com> (raw)
In-Reply-To: <1602743893-345348-1-git-send-email-matan@nvidia.com>

When a Rx\Tx queue is created by DevX, its CQ configuration should
include the EQ number of the interrupts.
The EQ is managed by the kernel and there is a glue API in order to
query the EQ number from the kernel.
The EQ query API gets a vector number specifies the kernel vector of
the interrupt handling.

The vector number was wrongly detected according to the configuration
CPU instead of using the device attributes of the supported vectors.
The CPU was wrongly detected by the rte_lcore_to_cpu_id API without any
check, and in case of non-EAL thread context the value was 0xFFFFFFFF
which caused a failure in the EQ number query API.

Use vector 0 for each EQ number query which must be supported by the
kernel.

Fixes: 08d1838f645a ("net/mlx5: implement CQ for Rx using DevX API")
Fixes: d133f4cdb706 ("net/mlx5: create clock queue for packet pacing")
Cc: stable@dpdk.org

Signed-off-by: Matan Azrad <matan@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
---
 drivers/net/mlx5/mlx5.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/net/mlx5/mlx5.c b/drivers/net/mlx5/mlx5.c
index 44822ad..f1e3579 100644
--- a/drivers/net/mlx5/mlx5.c
+++ b/drivers/net/mlx5/mlx5.c
@@ -947,10 +947,8 @@ struct mlx5_dev_ctx_shared *
 		goto error;
 	}
 	if (sh->devx) {
-		uint32_t lcore = (uint32_t)rte_lcore_to_cpu_id(-1);
-
 		/* Query the EQN for this core. */
-		err = mlx5_glue->devx_query_eqn(sh->ctx, lcore, &sh->eqn);
+		err = mlx5_glue->devx_query_eqn(sh->ctx, 0, &sh->eqn);
 		if (err) {
 			rte_errno = errno;
 			DRV_LOG(ERR, "Failed to query event queue number %d.",
-- 
1.8.3.1


  parent reply	other threads:[~2020-10-15  6:39 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-15  6:38 [dpdk-dev] [PATCH 1/4] net/mlx5: fix Rx queue release Matan Azrad
2020-10-15  6:38 ` [dpdk-dev] [PATCH 2/4] net/mlx5: fix Tx " Matan Azrad
2020-10-15  6:38 ` Matan Azrad [this message]
2020-10-15  6:38 ` [dpdk-dev] [PATCH 4/4] net/mlx5/linux: fix Tx queue operations decision Matan Azrad
2020-10-18 11:58 ` [dpdk-dev] [PATCH 1/4] net/mlx5: fix Rx queue release 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=1602743893-345348-3-git-send-email-matan@nvidia.com \
    --to=matan@nvidia.com \
    --cc=dev@dpdk.org \
    --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).