From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id 7D9A01094; Tue, 17 Jan 2017 17:30:28 +0100 (CET) Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga102.fm.intel.com with ESMTP; 17 Jan 2017 08:30:27 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.33,245,1477983600"; d="scan'208";a="809969807" Received: from irsmsx103.ger.corp.intel.com ([163.33.3.157]) by FMSMGA003.fm.intel.com with ESMTP; 17 Jan 2017 08:30:25 -0800 Received: from irsmsx108.ger.corp.intel.com ([169.254.11.173]) by IRSMSX103.ger.corp.intel.com ([163.33.3.157]) with mapi id 14.03.0248.002; Tue, 17 Jan 2017 16:30:24 +0000 From: "Iremonger, Bernard" To: "Wu, Jingjing" , "dev@dpdk.org" , "Lu, Wenzhuo" , "Zhang, Helin" CC: "stable@dpdk.org" Thread-Topic: [PATCH v3 1/2] net/i40e: fix segmentation fault in close Thread-Index: AQHSbNv4nM+NlW4+2E2dniWspuVs5KE8w8gAgAAf6RA= Date: Tue, 17 Jan 2017 16:30:23 +0000 Message-ID: <8CEF83825BEC744B83065625E567D7C224D1F3E9@IRSMSX108.ger.corp.intel.com> References: <1483979366-16914-1-git-send-email-bernard.iremonger@intel.com> <1484229492-18902-2-git-send-email-bernard.iremonger@intel.com> <9BB6961774997848B5B42BEC655768F810CCA2B6@SHSMSX103.ccr.corp.intel.com> In-Reply-To: <9BB6961774997848B5B42BEC655768F810CCA2B6@SHSMSX103.ccr.corp.intel.com> Accept-Language: en-GB, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiY2ZkNTFkNzQtNjQzNi00NThiLTg1MWUtMThiMjEwNDlkYzI3IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX0lDIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE2LjIuMTEuMCIsIlRydXN0ZWRMYWJlbEhhc2giOiJGaGJndnlkTnhQRWJUXC9sUTJjajd2eloyUEZ4Q08ycmNvVzc3c3J4eEwxTT0ifQ== x-ctpclassification: CTP_IC x-originating-ip: [163.33.239.180] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH v3 1/2] net/i40e: fix segmentation fault in close 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: Tue, 17 Jan 2017 16:30:29 -0000 Hi Jingjing, > > Subject: [PATCH v3 1/2] net/i40e: fix segmentation fault in close > > > > Change the order of releasing the vsi's. > > Release the vmdq vsi's first, then release the main vsi. > > > > Fixes: 4861cde46116 ("i40e: new poll mode driver") > > > > CC: stable@dpdk.org > > > > Signed-off-by: Bernard Iremonger > > --- > > drivers/net/i40e/i40e_ethdev.c | 12 +++++++----- > > 1 file changed, 7 insertions(+), 5 deletions(-) > > > > diff --git a/drivers/net/i40e/i40e_ethdev.c > > b/drivers/net/i40e/i40e_ethdev.c index f13e61b..e8cfec8 100644 > > --- a/drivers/net/i40e/i40e_ethdev.c > > +++ b/drivers/net/i40e/i40e_ethdev.c > > @@ -2068,18 +2068,17 @@ i40e_dev_close(struct rte_eth_dev *dev) > > /* shutdown and destroy the HMC */ > > i40e_shutdown_lan_hmc(hw); > > > > - /* release all the existing VSIs and VEBs */ > > - i40e_fdir_teardown(pf); > > - i40e_vsi_release(pf->main_vsi); > > - > > for (i =3D 0; i < pf->nb_cfg_vmdq_vsi; i++) { > > i40e_vsi_release(pf->vmdq[i].vsi); > > pf->vmdq[i].vsi =3D NULL; > > } > > - > > rte_free(pf->vmdq); > > pf->vmdq =3D NULL; > > > > + /* release all the existing VSIs and VEBs */ > > + i40e_fdir_teardown(pf); > > + i40e_vsi_release(pf->main_vsi); > > + > > /* shutdown the adminq */ > > i40e_aq_queue_shutdown(hw, true); > > i40e_shutdown_adminq(hw); > > @@ -4342,6 +4341,9 @@ i40e_vsi_release(struct i40e_vsi *vsi) > > if (!vsi) > > return I40E_SUCCESS; > > > > + if (!vsi->adapter) > > + return I40E_ERR_BAD_PTR; > > + >=20 > The change looks fine to me. > Only minor comments like: > The dev_close is ethdev level ops, I40E_XX error code need to be replaced > by The error code defined in ethedev level. I will replace I40E_ERR_BAD_PTR with -EFAULT in v4. Regards, Bernard.