DPDK patches and discussions
 help / color / mirror / Atom feed
From: beilei.xing@intel.com
To: jingjing.wu@intel.com
Cc: dev@dpdk.org, yuan.peng@intel.com, Beilei Xing <beilei.xing@intel.com>
Subject: [PATCH v2] net/idpf: fix crash when launching l3fwd
Date: Thu, 17 Nov 2022 10:15:09 +0000	[thread overview]
Message-ID: <20221117101509.14472-1-beilei.xing@intel.com> (raw)
In-Reply-To: <20221117100054.13836-1-beilei.xing@intel.com>

From: Beilei Xing <beilei.xing@intel.com>

There's core dump when launching l3fwd with 1 queue 1 core. It's
because NULL pointer is used if fail to configure device.
This patch removes incorrect check during device configuration,
and checks NULL pointer when executing VIRTCHNL2_OP_DEALLOC_VECTORS.

Fixes: 549343c25db8 ("net/idpf: support device initialization")
Fixes: 70675bcc3a57 ("net/idpf: support RSS")
Fixes: 37291a68fd78 ("net/idpf: support write back based on ITR expire")

Signed-off-by: Beilei Xing <beilei.xing@intel.com>
---
v2 change: Fix typo.

 drivers/net/idpf/idpf_ethdev.c | 7 -------
 drivers/net/idpf/idpf_vchnl.c  | 3 +++
 2 files changed, 3 insertions(+), 7 deletions(-)

diff --git a/drivers/net/idpf/idpf_ethdev.c b/drivers/net/idpf/idpf_ethdev.c
index 20f088eb80..51fc97bf7b 100644
--- a/drivers/net/idpf/idpf_ethdev.c
+++ b/drivers/net/idpf/idpf_ethdev.c
@@ -372,13 +372,6 @@ idpf_dev_configure(struct rte_eth_dev *dev)
 		return -ENOTSUP;
 	}
 
-	if ((dev->data->nb_rx_queues == 1 && conf->rxmode.mq_mode != RTE_ETH_MQ_RX_NONE) ||
-	    (dev->data->nb_rx_queues > 1 && conf->rxmode.mq_mode != RTE_ETH_MQ_RX_RSS)) {
-		PMD_INIT_LOG(ERR, "Multi-queue packet distribution mode %d is not supported",
-			     conf->rxmode.mq_mode);
-		return -ENOTSUP;
-	}
-
 	if (conf->txmode.mq_mode != RTE_ETH_MQ_TX_NONE) {
 		PMD_INIT_LOG(ERR, "Multi-queue TX mode %d is not supported",
 			     conf->txmode.mq_mode);
diff --git a/drivers/net/idpf/idpf_vchnl.c b/drivers/net/idpf/idpf_vchnl.c
index ac6486d4ef..88770447f8 100644
--- a/drivers/net/idpf/idpf_vchnl.c
+++ b/drivers/net/idpf/idpf_vchnl.c
@@ -1197,6 +1197,9 @@ idpf_vc_dealloc_vectors(struct idpf_vport *vport)
 	int err, len;
 
 	alloc_vec = vport->recv_vectors;
+	if (alloc_vec == NULL)
+		return -EINVAL;
+
 	vcs = &alloc_vec->vchunks;
 
 	len = sizeof(struct virtchnl2_vector_chunks) +
-- 
2.26.2


  reply	other threads:[~2022-11-17 10:15 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-17 10:00 [PATCH] " beilei.xing
2022-11-17 10:15 ` beilei.xing [this message]
2022-11-18  6:24   ` [PATCH v2] " Wu, Jingjing
2022-11-18  7:05     ` Xing, Beilei
2022-11-18  7:02   ` [PATCH v3] " beilei.xing
2022-11-18  9:57     ` Zhang, Qi Z
2022-11-18  9:59     ` Peng, Yuan

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=20221117101509.14472-1-beilei.xing@intel.com \
    --to=beilei.xing@intel.com \
    --cc=dev@dpdk.org \
    --cc=jingjing.wu@intel.com \
    --cc=yuan.peng@intel.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).