DPDK patches and discussions
 help / color / mirror / Atom feed
From: Ke Zhang <ke1x.zhang@intel.com>
To: xiaoyun.li@intel.com, jingjing.wu@intel.com,
	beilei.xing@intel.com, dev@dpdk.org
Cc: Ke Zhang <ke1x.zhang@intel.com>
Subject: [PATCH v2] net/iavf: fix iavf crashed on dev_stop when running in multi-process mode
Date: Thu, 14 Apr 2022 09:29:02 +0000	[thread overview]
Message-ID: <20220414092902.176462-1-ke1x.zhang@intel.com> (raw)
In-Reply-To: <20220402095120.637740-1-ke1x.zhang@intel.com>

In the multi process environment, the sub process
operates on the shared memory and changes the
function pointer of the main process, resulting in
the failure to find the address of the function when
main process releasing, resulting in crash.

Signed-off-by: Ke Zhang <ke1x.zhang@intel.com>
---
 drivers/net/iavf/iavf_rxtx.c | 31 ++++++++++++++++---------------
 1 file changed, 16 insertions(+), 15 deletions(-)

diff --git a/drivers/net/iavf/iavf_rxtx.c b/drivers/net/iavf/iavf_rxtx.c
index 16e8d021f9..1cef985fcc 100644
--- a/drivers/net/iavf/iavf_rxtx.c
+++ b/drivers/net/iavf/iavf_rxtx.c
@@ -2822,12 +2822,12 @@ iavf_set_rx_function(struct rte_eth_dev *dev)
 		if (vf->vf_res->vf_cap_flags &
 			VIRTCHNL_VF_OFFLOAD_RX_FLEX_DESC)
 			use_flex = true;
-
-		for (i = 0; i < dev->data->nb_rx_queues; i++) {
-			rxq = dev->data->rx_queues[i];
-			(void)iavf_rxq_vec_setup(rxq);
+		if (rte_eal_process_type() == RTE_PROC_PRIMARY) {
+			for (i = 0; i < dev->data->nb_rx_queues; i++) {
+				rxq = dev->data->rx_queues[i];
+				(void)iavf_rxq_vec_setup(rxq);
+			}
 		}
-
 		if (dev->data->scattered_rx) {
 			if (!use_avx512) {
 				PMD_DRV_LOG(DEBUG,
@@ -3002,20 +3002,21 @@ iavf_set_tx_function(struct rte_eth_dev *dev)
 		}
 #endif
 
-		for (i = 0; i < dev->data->nb_tx_queues; i++) {
-			txq = dev->data->tx_queues[i];
-			if (!txq)
-				continue;
+		if (rte_eal_process_type() == RTE_PROC_PRIMARY) {
+			for (i = 0; i < dev->data->nb_tx_queues; i++) {
+				txq = dev->data->tx_queues[i];
+				if (!txq)
+					continue;
 #ifdef CC_AVX512_SUPPORT
-			if (use_avx512)
-				iavf_txq_vec_setup_avx512(txq);
-			else
-				iavf_txq_vec_setup(txq);
+				if (use_avx512)
+					iavf_txq_vec_setup_avx512(txq);
+				else
+					iavf_txq_vec_setup(txq);
 #else
-			iavf_txq_vec_setup(txq);
+				iavf_txq_vec_setup(txq);
 #endif
+			}
 		}
-
 		return;
 	}
 
-- 
2.25.1


  parent reply	other threads:[~2022-04-14  9:34 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-02  9:51 [PATCH] " Ke Zhang
2022-04-03  2:07 ` Zhang, Qi Z
2022-04-14  9:29 ` Ke Zhang [this message]
2022-04-18  6:41   ` [PATCH v2] " Zhang, Qi Z
2022-05-07  6:24   ` [PATCH v3] fix mbuf release function point corrupt in multi-process Ke Zhang
2022-05-09  1:16   ` Ke Zhang
2022-05-09  1:35     ` Zhang, Qi Z
2022-05-10  2:54     ` [PATCH v4] " Ke Zhang
2022-05-12  2:21       ` [PATCH v5] " Ke Zhang
2022-05-12  5:57       ` Ke Zhang
2022-05-12 17:26         ` Stephen Hemminger
2022-05-13  1:34           ` Zhang, Ke1X
2022-05-13  1:57             ` Stephen Hemminger
2022-05-12  7:44       ` Ke Zhang
2022-05-16  6:41         ` [PATCH v6] " Ke Zhang
2022-05-16  6:55         ` Ke Zhang
2022-05-17  7:27           ` Zhang, Qi Z
2022-05-19  7:36           ` [PATCH v7] net/iavf: " Ke Zhang
2022-05-19  9:25             ` Zhang, Qi Z

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=20220414092902.176462-1-ke1x.zhang@intel.com \
    --to=ke1x.zhang@intel.com \
    --cc=beilei.xing@intel.com \
    --cc=dev@dpdk.org \
    --cc=jingjing.wu@intel.com \
    --cc=xiaoyun.li@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).