From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id C09DFA00C2; Sun, 3 Apr 2022 04:07:04 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 57F264068A; Sun, 3 Apr 2022 04:07:04 +0200 (CEST) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by mails.dpdk.org (Postfix) with ESMTP id 8AEA240041 for ; Sun, 3 Apr 2022 04:07:02 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1648951622; x=1680487622; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=AoZJn0avJmkq118riWxY+AJQ7B29vMXyXQwR8mE9SEg=; b=fUL40y4C9dEdSjKjrQKldWnYKK7QK83RrHDgYW5FB5uNwCqwREPcMhMd hUHENaVFzVyeUF+UXGJCfTn/vZFDYnjqfsJsi2YGlJ77iCsERTTb6ZZIE niUp8BIk2gGzLdk/cp4CM6JAmagRHJOvePPQ9zSGPf1rIxTUOEcF645wL u/JfCQ2AcSQkhwszaBIFJHZAfdqidnuF5ZRzNC4OJ1RAjVmbZOYfVcy8a ZWcvKa0D3VQocJxL01gllSiYC2iqmjfgxFX+XiR20CbC63o3NlgAvfVE7 sx28dCZ5qIdzPxQ+Vo0P2FjdN+NQUGMmhChX4IPSHTh3TOMabzS70zfaI g==; X-IronPort-AV: E=McAfee;i="6200,9189,10305"; a="285291464" X-IronPort-AV: E=Sophos;i="5.90,231,1643702400"; d="scan'208";a="285291464" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Apr 2022 19:07:01 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.90,231,1643702400"; d="scan'208";a="568615969" Received: from fmsmsx605.amr.corp.intel.com ([10.18.126.85]) by orsmga008.jf.intel.com with ESMTP; 02 Apr 2022 19:07:00 -0700 Received: from fmsmsx605.amr.corp.intel.com (10.18.126.85) by fmsmsx605.amr.corp.intel.com (10.18.126.85) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.27; Sat, 2 Apr 2022 19:07:00 -0700 Received: from fmsmsx605.amr.corp.intel.com ([10.18.126.85]) by fmsmsx605.amr.corp.intel.com ([10.18.126.85]) with mapi id 15.01.2308.027; Sat, 2 Apr 2022 19:07:00 -0700 From: "Zhang, Qi Z" To: "Zhang, Ke1X" , "Li, Xiaoyun" , "Wu, Jingjing" , "Xing, Beilei" , "dev@dpdk.org" CC: "Zhang, Ke1X" Subject: RE: [PATCH] net/iavf: fix iavf crashed on dev_stop when running in multi-process mode Thread-Topic: [PATCH] net/iavf: fix iavf crashed on dev_stop when running in multi-process mode Thread-Index: AQHYRngUSiXACHqG7UicjzJHC1Aj9qzdanEA Date: Sun, 3 Apr 2022 02:07:00 +0000 Message-ID: References: <20220402095120.637740-1-ke1x.zhang@intel.com> In-Reply-To: <20220402095120.637740-1-ke1x.zhang@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-reaction: no-action dlp-version: 11.6.401.20 dlp-product: dlpe-windows x-originating-ip: [10.239.127.36] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org > -----Original Message----- > From: Ke Zhang > Sent: Saturday, April 2, 2022 5:51 PM > To: Li, Xiaoyun ; Wu, Jingjing ; > Xing, Beilei ; dev@dpdk.org > Cc: Zhang, Ke1X > Subject: [PATCH] net/iavf: fix iavf crashed on dev_stop when running in > multi-process mode >=20 > 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 releasi= ng, > resulting in crash. >=20 > similar with commit<20b631efe785819eb77aabbf500b3352e5731bdb> >=20 > Signed-off-by: Ke Zhang > --- > drivers/net/iavf/iavf_rxtx.c | 27 ++++++++++++++----------- > drivers/net/iavf/iavf_rxtx.h | 6 +++--- > drivers/net/iavf/iavf_rxtx_vec_avx512.c | 4 ++-- > drivers/net/iavf/iavf_rxtx_vec_sse.c | 8 ++++---- > 4 files changed, 24 insertions(+), 21 deletions(-) >=20 > diff --git a/drivers/net/iavf/iavf_rxtx.c b/drivers/net/iavf/iavf_rxtx.c = index > 16e8d021f9..197c03cd31 100644 > --- a/drivers/net/iavf/iavf_rxtx.c > +++ b/drivers/net/iavf/iavf_rxtx.c > @@ -362,6 +362,9 @@ release_txq_mbufs(struct iavf_tx_queue *txq) > } > } >=20 > +const struct iavf_rxq_ops *iavf_rxq_release_mbufs_ops; const struct > +iavf_txq_ops *iavf_txq_release_mbufs_ops; > + > static const struct iavf_rxq_ops def_rxq_ops =3D { > .release_mbufs =3D release_rxq_mbufs, > }; > @@ -674,7 +677,7 @@ iavf_dev_rx_queue_setup(struct rte_eth_dev *dev, > uint16_t queue_idx, > rxq->q_set =3D true; > dev->data->rx_queues[queue_idx] =3D rxq; > rxq->qrx_tail =3D hw->hw_addr + IAVF_QRX_TAIL1(rxq->queue_id); > - rxq->ops =3D &def_rxq_ops; > + iavf_rxq_release_mbufs_ops =3D &def_rxq_ops; This is not correct.=20 Now we replace per-queue ops with a global ops which is not expected. Please reference method of below patch commit 0ed16e01313e1f8930dc6a52b22159b20269d4e0 Author: Steve Yang Date: Mon Feb 28 09:48:59 2022 +0000 net/iavf: fix function pointer in multi-process ... >=20 > diff --git a/drivers/net/iavf/iavf_rxtx_vec_sse.c > b/drivers/net/iavf/iavf_rxtx_vec_sse.c > index 717a227b2c..a782bed2e0 100644 > --- a/drivers/net/iavf/iavf_rxtx_vec_sse.c > +++ b/drivers/net/iavf/iavf_rxtx_vec_sse.c > @@ -1219,16 +1219,16 @@ static const struct iavf_txq_ops sse_vec_txq_ops > =3D { }; >=20 > int __rte_cold > -iavf_txq_vec_setup(struct iavf_tx_queue *txq) > +iavf_txq_vec_setup(const struct iavf_txq_ops **txq_ops) > { > - txq->ops =3D &sse_vec_txq_ops; > + *txq_ops =3D &sse_vec_txq_ops; > return 0; > } >=20 > int __rte_cold > -iavf_rxq_vec_setup(struct iavf_rx_queue *rxq) > +iavf_rxq_vec_setup(struct iavf_rx_queue *rxq, const struct iavf_rxq_ops > +**rxq_ops) > { > - rxq->ops =3D &sse_vec_rxq_ops; > + *rxq_ops =3D &sse_vec_rxq_ops; > return iavf_rxq_vec_setup_default(rxq); } seems lots of redundant in iavf_rxtx_vec.sse.c=20 Can we move iavf_r(t)xq_vec_setup | sse_vec_r(t)xq_ops into iavf_rxtx.c and= delete iavf_r(t)x_queue_release_mbufs_sse)? Btw, We can keep this patch unchanged, a separated patch to refact the code= is expected. >=20 > -- > 2.25.1