DPDK patches and discussions
 help / color / mirror / Atom feed
From: Bing Zhao <bingz@nvidia.com>
To: <viacheslavo@nvidia.com>, <matan@nvidia.com>
Cc: <dev@dpdk.org>, <rasland@nvidia.com>, <xuemingl@nvidia.com>,
	<stable@dpdk.org>
Subject: [PATCH] net/mlx5: fix Rx queue private pointers array checking
Date: Thu, 3 Mar 2022 17:26:58 +0200	[thread overview]
Message-ID: <20220303152658.105403-1-bingz@nvidia.com> (raw)

None Rx queue configured in a DPDK application should be supported.
In this mode, the NIC can be used to generate packets without
receiving any ingress traffic.

In the current implementation, once there is no Rx queue specified,
the array to store the queues' pointers is NULL after allocation.
Then the checking of the array allocation prevents the application
from starting up.

By adding another condition checking of the Rx queue number, the
application with none Rx queue can start up successfully.

Fixes: 4cda06c3c35e ("net/mlx5: split Rx queue into shareable and private")
Cc: xuemingl@nvidia.com
Cc: stable@dpdk.org

Signed-off-by: Bing Zhao <bingz@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
---
 drivers/net/mlx5/mlx5_ethdev.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/mlx5/mlx5_ethdev.c b/drivers/net/mlx5/mlx5_ethdev.c
index de0ba2b1ff..05c919ed39 100644
--- a/drivers/net/mlx5/mlx5_ethdev.c
+++ b/drivers/net/mlx5/mlx5_ethdev.c
@@ -111,7 +111,7 @@ mlx5_dev_configure(struct rte_eth_dev *dev)
 				       MLX5_MEM_RTE | MLX5_MEM_ZERO,
 				       sizeof(void *) * rxqs_n, 0,
 				       SOCKET_ID_ANY);
-	if (priv->rxq_privs == NULL) {
+	if (rxqs_n && priv->rxq_privs == NULL) {
 		DRV_LOG(ERR, "port %u cannot allocate rxq private data",
 			dev->data->port_id);
 		rte_errno = ENOMEM;
-- 
2.25.1


             reply	other threads:[~2022-03-03 15:27 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-03 15:26 Bing Zhao [this message]
2022-03-07 20:56 ` 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=20220303152658.105403-1-bingz@nvidia.com \
    --to=bingz@nvidia.com \
    --cc=dev@dpdk.org \
    --cc=matan@nvidia.com \
    --cc=rasland@nvidia.com \
    --cc=stable@dpdk.org \
    --cc=viacheslavo@nvidia.com \
    --cc=xuemingl@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).