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 002DD106A; Tue, 17 Jan 2017 15:34:17 +0100 (CET) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga105.jf.intel.com with ESMTP; 17 Jan 2017 06:34:16 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.33,245,1477983600"; d="scan'208";a="31650629" Received: from fmsmsx105.amr.corp.intel.com ([10.18.124.203]) by orsmga002.jf.intel.com with ESMTP; 17 Jan 2017 06:34:16 -0800 Received: from fmsmsx151.amr.corp.intel.com (10.18.125.4) by FMSMSX105.amr.corp.intel.com (10.18.124.203) with Microsoft SMTP Server (TLS) id 14.3.248.2; Tue, 17 Jan 2017 06:34:16 -0800 Received: from shsmsx101.ccr.corp.intel.com (10.239.4.153) by FMSMSX151.amr.corp.intel.com (10.18.125.4) with Microsoft SMTP Server (TLS) id 14.3.248.2; Tue, 17 Jan 2017 06:34:15 -0800 Received: from shsmsx103.ccr.corp.intel.com ([169.254.4.20]) by SHSMSX101.ccr.corp.intel.com ([169.254.1.177]) with mapi id 14.03.0248.002; Tue, 17 Jan 2017 22:34:04 +0800 From: "Wu, Jingjing" To: "Iremonger, Bernard" , "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: AQHSbNv4WL03yJb5wky8BoXLVLgXtaE8wySw Date: Tue, 17 Jan 2017 14:34:04 +0000 Message-ID: <9BB6961774997848B5B42BEC655768F810CCA2B6@SHSMSX103.ccr.corp.intel.com> References: <1483979366-16914-1-git-send-email-bernard.iremonger@intel.com> <1484229492-18902-2-git-send-email-bernard.iremonger@intel.com> In-Reply-To: <1484229492-18902-2-git-send-email-bernard.iremonger@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-stable] [PATCH v3 1/2] net/i40e: fix segmentation fault in close X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Jan 2017 14:34:18 -0000 > -----Original Message----- > From: Iremonger, Bernard > Sent: Thursday, January 12, 2017 9:58 PM > To: dev@dpdk.org; Lu, Wenzhuo ; Wu, Jingjing > ; Zhang, Helin > Cc: Iremonger, Bernard ; stable@dpdk.org > Subject: [PATCH v3 1/2] net/i40e: fix segmentation fault in close >=20 > Change the order of releasing the vsi's. > Release the vmdq vsi's first, then release the main vsi. >=20 > Fixes: 4861cde46116 ("i40e: new poll mode driver") >=20 > CC: stable@dpdk.org >=20 > Signed-off-by: Bernard Iremonger > --- > drivers/net/i40e/i40e_ethdev.c | 12 +++++++----- > 1 file changed, 7 insertions(+), 5 deletions(-) >=20 > diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethde= v.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); >=20 > - /* 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; >=20 > + /* 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; >=20 > + if (!vsi->adapter) > + return I40E_ERR_BAD_PTR; > + 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 b= y=20 The error code defined in ethedev level.