From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by dpdk.org (Postfix) with ESMTP id BA2531B2C9 for ; Fri, 22 Dec 2017 04:30:39 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga105.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 21 Dec 2017 19:30:38 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.45,438,1508828400"; d="scan'208";a="160898814" Received: from fmsmsx108.amr.corp.intel.com ([10.18.124.206]) by orsmga004.jf.intel.com with ESMTP; 21 Dec 2017 19:30:38 -0800 Received: from fmsmsx124.amr.corp.intel.com (10.18.125.39) by FMSMSX108.amr.corp.intel.com (10.18.124.206) with Microsoft SMTP Server (TLS) id 14.3.319.2; Thu, 21 Dec 2017 19:30:38 -0800 Received: from shsmsx151.ccr.corp.intel.com (10.239.6.50) by fmsmsx124.amr.corp.intel.com (10.18.125.39) with Microsoft SMTP Server (TLS) id 14.3.319.2; Thu, 21 Dec 2017 19:30:38 -0800 Received: from shsmsx103.ccr.corp.intel.com ([169.254.4.213]) by SHSMSX151.ccr.corp.intel.com ([169.254.3.218]) with mapi id 14.03.0319.002; Fri, 22 Dec 2017 11:30:36 +0800 From: "Zhang, Qi Z" To: "Zhao1, Wei" , "dev@dpdk.org" CC: "Zhao1, Wei" Thread-Topic: [dpdk-dev] [PATCH v2] net/i40e: fix port segmentation fault when restart Thread-Index: AQHTXdc8bda7hes31E+cqp4cXpkyYaNO4eZA Date: Fri, 22 Dec 2017 03:30:35 +0000 Message-ID: <039ED4275CED7440929022BC67E7061153123DC5@SHSMSX103.ccr.corp.intel.com> References: <20171115054630.126687-1-wei.zhao1@intel.com> <20171115055500.127356-1-wei.zhao1@intel.com> In-Reply-To: <20171115055500.127356-1-wei.zhao1@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-version: 11.0.0.116 dlp-reaction: no-action 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 v2] 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: Fri, 22 Dec 2017 03:30:40 -0000 > -----Original Message----- > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Wei Zhao > Sent: Wednesday, November 15, 2017 1:55 PM > To: dev@dpdk.org > Cc: Zhao1, Wei > Subject: [dpdk-dev] [PATCH v2] net/i40e: fix port segmentation fault when > restart >=20 > It will clear all queue region related configuration when dev stop even i= f threr s/threr/there > is no queue region config, so this may cause error. So add check when flu= sh > queue region config and delete it when device stop. >=20 > Fixes: 7cbecc2f742 ("net/i40e: support queue region set and flush") >=20 > Signed-off-by: Wei Zhao >=20 > --- >=20 > v2: > -fix patch check warning. > --- > drivers/net/i40e/i40e_ethdev.c | 3 --- > drivers/net/i40e/rte_pmd_i40e.c | 27 ++++++++++++++------------- > 2 files changed, 14 insertions(+), 16 deletions(-) >=20 > diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethde= v.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; >=20 > - /* Remove all the queue region configuration */ > - i40e_flush_queue_region_all_conf(dev, hw, pf, 0); > - >>From the commit log, the reason you remove above line is because the functi= on can't handle the situation when no queue region config,=20 but what about the case that queue region config does exist? Could you add = more message to explain why this not be impacted. > hw->adapter_stopped =3D 1; > } >=20 > 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; > } >=20 > - 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; >=20 > - 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."); WARNING: line over 80 characters Regards Qi >=20 > - 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; > + } >=20 > + i40e_init_queue_region_conf(dev); > + } > return 0; > } >=20 > -- > 2.7.4