From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by dpdk.org (Postfix) with ESMTP id 767BB4D3A for ; Sat, 13 Jan 2018 07:04:55 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 12 Jan 2018 22:04:53 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.46,351,1511856000"; d="scan'208";a="9305032" Received: from fmsmsx104.amr.corp.intel.com ([10.18.124.202]) by fmsmga007.fm.intel.com with ESMTP; 12 Jan 2018 22:04:53 -0800 Received: from fmsmsx111.amr.corp.intel.com (10.18.116.5) by fmsmsx104.amr.corp.intel.com (10.18.124.202) with Microsoft SMTP Server (TLS) id 14.3.319.2; Fri, 12 Jan 2018 22:04:53 -0800 Received: from shsmsx102.ccr.corp.intel.com (10.239.4.154) by fmsmsx111.amr.corp.intel.com (10.18.116.5) with Microsoft SMTP Server (TLS) id 14.3.319.2; Fri, 12 Jan 2018 22:04:52 -0800 Received: from shsmsx103.ccr.corp.intel.com ([169.254.4.213]) by shsmsx102.ccr.corp.intel.com ([169.254.2.189]) with mapi id 14.03.0319.002; Sat, 13 Jan 2018 14:04:50 +0800 From: "Zhang, Helin" To: "Zhang, Qi Z" , "Zhao1, Wei" , "dev@dpdk.org" Thread-Topic: [dpdk-dev] [PATCH v3] net/i40e: fix port segmentation fault when restart Thread-Index: AQHThGurboDYMG8PjUq1LBOYqgtnaqNxX+EA Date: Sat, 13 Jan 2018 06:04:50 +0000 Message-ID: References: <20171115055500.127356-1-wei.zhao1@intel.com> <20180103071721.51986-1-wei.zhao1@intel.com> <039ED4275CED7440929022BC67E706115312740C@SHSMSX103.ccr.corp.intel.com> In-Reply-To: <039ED4275CED7440929022BC67E706115312740C@SHSMSX103.ccr.corp.intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH v3] net/i40e: fix port segmentation fault when restart X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Jan 2018 06:04:55 -0000 > -----Original Message----- > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Zhang, Qi Z > Sent: Wednesday, January 3, 2018 4:20 PM > To: Zhao1, Wei; dev@dpdk.org > Subject: Re: [dpdk-dev] [PATCH v3] net/i40e: fix port segmentation fault = when > restart >=20 >=20 >=20 > > -----Original Message----- > > From: Zhao1, Wei > > Sent: Wednesday, January 3, 2018 3:17 PM > > To: dev@dpdk.org > > Cc: Zhang, Qi Z ; Zhao1, Wei > > > > Subject: [PATCH v3] net/i40e: fix port segmentation fault when restart > > > > This patch will clear all queue region related configuration when dev > > stop even if threr is no queue region config, so this may cause error. > > So add check if there is queue configuration exist when flush queue > > region config and remove this process when device stop. Queue region > > clear only do when device initialization or PMD get flush command. > > > > Fixes: 7cbecc2f742 ("net/i40e: support queue region set and flush") > > > > Signed-off-by: Wei Zhao > > > > --- > > > > v2: > > -fix patch check warning. > > > > v3: > > -add more log message. > > --- > > drivers/net/i40e/i40e_ethdev.c | 3 --- > > drivers/net/i40e/rte_pmd_i40e.c > > | 27 ++++++++++++++------------- > > 2 files changed, 14 insertions(+), 16 deletions(-) > > > > diff --git a/drivers/net/i40e/i40e_ethdev.c > > b/drivers/net/i40e/i40e_ethdev.c index 811cc9f..7a1290b 100644 > > --- a/drivers/net/i40e/i40e_ethdev.c > > +++ b/drivers/net/i40e/i40e_ethdev.c > > @@ -2154,9 +2154,6 @@ i40e_dev_stop(struct rte_eth_dev *dev) > > /* reset hierarchy commit */ > > pf->tm_conf.committed =3D false; > > > > - /* Remove all the queue region configuration */ > > - i40e_flush_queue_region_all_conf(dev, hw, pf, 0); > > - > > hw->adapter_stopped =3D 1; > > } > > > > diff --git a/drivers/net/i40e/rte_pmd_i40e.c > > b/drivers/net/i40e/rte_pmd_i40e.c index aeb92af..c2e2466 100644 > > --- a/drivers/net/i40e/rte_pmd_i40e.c > > +++ b/drivers/net/i40e/rte_pmd_i40e.c > > @@ -2845,22 +2845,23 @@ i40e_flush_queue_region_all_conf(struct > > rte_eth_dev *dev, > > return 0; > > } > > > > - info->queue_region_number =3D 1; > > - info->region[0].queue_num =3D main_vsi->nb_used_qps; > > - info->region[0].queue_start_index =3D 0; > > + if (info->queue_region_number) { > > + info->queue_region_number =3D 1; > > + info->region[0].queue_num =3D main_vsi->nb_used_qps; > > + info->region[0].queue_start_index =3D 0; > > > > - ret =3D i40e_vsi_update_queue_region_mapping(hw, pf); > > - if (ret !=3D I40E_SUCCESS) > > - PMD_DRV_LOG(INFO, "Failed to flush queue region mapping."); > > - > > - ret =3D i40e_dcb_init_configure(dev, TRUE); > > - if (ret !=3D I40E_SUCCESS) { > > - PMD_DRV_LOG(INFO, "Failed to flush dcb."); > > - pf->flags &=3D ~I40E_FLAG_DCB; > > - } > > + ret =3D i40e_vsi_update_queue_region_mapping(hw, pf); > > + if (ret !=3D I40E_SUCCESS) > > + PMD_DRV_LOG(INFO, "Failed to flush queue region > mapping."); > > > > - i40e_init_queue_region_conf(dev); > > + ret =3D i40e_dcb_init_configure(dev, TRUE); > > + if (ret !=3D I40E_SUCCESS) { > > + PMD_DRV_LOG(INFO, "Failed to flush dcb."); > > + pf->flags &=3D ~I40E_FLAG_DCB; > > + } > > > > + i40e_init_queue_region_conf(dev); > > + } > > return 0; > > } > > > > -- > > 2.9.3 >=20 > Acked-by: Qi Zhang Applied to dpdk-next-net-intel, with minor commit log changes, thanks! /Helin >=20