From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <dev-bounces@dpdk.org>
Received: from dpdk.org (dpdk.org [92.243.14.124])
	by inbox.dpdk.org (Postfix) with ESMTP id 5DA93A04AB;
	Thu,  7 Nov 2019 06:45:27 +0100 (CET)
Received: from [92.243.14.124] (localhost [127.0.0.1])
	by dpdk.org (Postfix) with ESMTP id 32F1D1E887;
	Thu,  7 Nov 2019 06:45:27 +0100 (CET)
Received: from mga06.intel.com (mga06.intel.com [134.134.136.31])
 by dpdk.org (Postfix) with ESMTP id 851AE1E887
 for <dev@dpdk.org>; Thu,  7 Nov 2019 06:45:24 +0100 (CET)
X-Amp-Result: SKIPPED(no attachment in message)
X-Amp-File-Uploaded: False
Received: from fmsmga002.fm.intel.com ([10.253.24.26])
 by orsmga104.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;
 06 Nov 2019 21:45:23 -0800
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="5.68,276,1569308400"; d="scan'208";a="233143271"
Received: from fmsmsx105.amr.corp.intel.com ([10.18.124.203])
 by fmsmga002.fm.intel.com with ESMTP; 06 Nov 2019 21:45:23 -0800
Received: from fmsmsx603.amr.corp.intel.com (10.18.126.83) by
 FMSMSX105.amr.corp.intel.com (10.18.124.203) with Microsoft SMTP Server (TLS)
 id 14.3.439.0; Wed, 6 Nov 2019 21:45:23 -0800
Received: from fmsmsx603.amr.corp.intel.com (10.18.126.83) by
 fmsmsx603.amr.corp.intel.com (10.18.126.83) with Microsoft SMTP Server
 (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id
 15.1.1713.5; Wed, 6 Nov 2019 21:45:22 -0800
Received: from shsmsx102.ccr.corp.intel.com (10.239.4.154) by
 fmsmsx603.amr.corp.intel.com (10.18.126.83) with Microsoft SMTP Server
 (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.1.1713.5
 via Frontend Transport; Wed, 6 Nov 2019 21:45:22 -0800
Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.213]) by
 shsmsx102.ccr.corp.intel.com ([169.254.2.108]) with mapi id 14.03.0439.000;
 Thu, 7 Nov 2019 13:45:21 +0800
From: "Di, ChenxuX" <chenxux.di@intel.com>
To: "Ye, Xiaolong" <xiaolong.ye@intel.com>
CC: "dev@dpdk.org" <dev@dpdk.org>, "Lu, Wenzhuo" <wenzhuo.lu@intel.com>,
 "Yang, Qiming" <qiming.yang@intel.com>, "Yigit, Ferruh"
 <ferruh.yigit@intel.com>
Thread-Topic: [dpdk-dev] [PATCH v2] net/i40e: fix device hotplug remove
Thread-Index: AQHVlGbRa+55F7LhvkKe63If1TDjkKd+fVCAgACHk+D//34/gIAArUTw
Date: Thu, 7 Nov 2019 05:45:20 +0000
Message-ID: <3B926E44943CB04AA3A39AC16328CE39B6B4AF@SHSMSX101.ccr.corp.intel.com>
References: <20191024010310.35882-1-chenxux.di@intel.com>
 <20191106050847.82673-1-chenxux.di@intel.com>
 <20191107025029.GB68021@intel.com>
 <3B926E44943CB04AA3A39AC16328CE39B6B1F8@SHSMSX101.ccr.corp.intel.com>
 <20191107031119.GC68021@intel.com>
In-Reply-To: <20191107031119.GC68021@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 v2] net/i40e: fix device hotplug remove
X-BeenThere: dev@dpdk.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: DPDK patches and discussions <dev.dpdk.org>
List-Unsubscribe: <https://mails.dpdk.org/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://mails.dpdk.org/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <https://mails.dpdk.org/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
Errors-To: dev-bounces@dpdk.org
Sender: "dev" <dev-bounces@dpdk.org>

Hi,

> -----Original Message-----
> From: Ye, Xiaolong
> Sent: Thursday, November 7, 2019 11:11 AM
> To: Di, ChenxuX <chenxux.di@intel.com>
> Cc: dev@dpdk.org; Lu, Wenzhuo <wenzhuo.lu@intel.com>; Yang, Qiming
> <qiming.yang@intel.com>; Yigit, Ferruh <ferruh.yigit@intel.com>
> Subject: Re: [dpdk-dev] [PATCH v2] net/i40e: fix device hotplug remove
>=20
> Hi,
>=20
> On 11/07, Di, ChenxuX wrote:
> >Hi, Xiaolong
> >
> >About pf and vf for fm10k, e1000, igb, ixgbe, ice, i40e; only i40e pf
> >and ixgbe vf use
>=20
> For fm10k, e1000, igb, ice, please check whether they have called
> rte_eth_dev_release_port in the remove ops.
>=20

The function rte_eth_dev_pci_generic_remove will call rte_eth_dev_release_p=
ort
After the uninit function of drivers.

> >Rte_eth_dev_destory() in their remove function, others have already use =
the
> generic remove function.
> >
> >I have send another patch about ixgbe because they fix different commits=
.
>=20
> For i40e and ixgbe, please address the comments I raised in previous mail=
.
>=20

When app detach a port without a close, it will call the remove function,
What will uninit the port and rte_eth_dev_release_port.

Thx
Di Chenxu

> Thanks,
> Xiaolong
>=20
> >
> >Thanks
> >Di Chenxu
> >
> >> -----Original Message-----
> >> From: Ye, Xiaolong
> >> Sent: Thursday, November 7, 2019 10:50 AM
> >> To: Di, ChenxuX <chenxux.di@intel.com>
> >> Cc: dev@dpdk.org; Lu, Wenzhuo <wenzhuo.lu@intel.com>; Yang, Qiming
> >> <qiming.yang@intel.com>; Yigit, Ferruh <ferruh.yigit@intel.com>
> >> Subject: Re: [dpdk-dev] [PATCH v2] net/i40e: fix device hotplug
> >> remove
> >>
> >> On 11/06, Di ChenxuX wrote:
> >> >testpmd will occur infinite loops when device hotplug remove.
> >> >We can fix the issue by using the pci generic remove function
> >> >
> >> >Fixes: ac89d46096d5 ("net/i40e: release port upon close")
> >> >
> >> >Signed-off-by: Di ChenxuX <chenxux.di@intel.com>
> >> >
> >> >v2:
> >> >change the code in driver.
> >> >---
> >> > drivers/net/i40e/i40e_ethdev.c | 12 +-----------
> >> > 1 file changed, 1 insertion(+), 11 deletions(-)
> >> >
> >> >diff --git a/drivers/net/i40e/i40e_ethdev.c
> >> >b/drivers/net/i40e/i40e_ethdev.c index 77a46832c..64842867d 100644
> >> >--- a/drivers/net/i40e/i40e_ethdev.c
> >> >+++ b/drivers/net/i40e/i40e_ethdev.c
> >> >@@ -694,17 +694,7 @@ eth_i40e_pci_probe(struct rte_pci_driver
> >> >*pci_drv __rte_unused,
> >> >
> >> > static int eth_i40e_pci_remove(struct rte_pci_device *pci_dev)  {
> >> >-	struct rte_eth_dev *ethdev;
> >> >-
> >> >-	ethdev =3D rte_eth_dev_allocated(pci_dev->device.name);
> >> >-	if (!ethdev)
> >> >-		return -ENODEV;
> >> >-
> >> >-
> >> >-	if (ethdev->data->dev_flags & RTE_ETH_DEV_REPRESENTOR)
> >> >-		return rte_eth_dev_destroy(ethdev,
> >> i40e_vf_representor_uninit);
> >> >-	else
> >> >-		return rte_eth_dev_destroy(ethdev, eth_i40e_dev_uninit);
> >> >+	return rte_eth_dev_pci_generic_remove(pci_dev,
> >> >+eth_i40e_dev_uninit);
> >>
> >> What about i40e_vf_representor_uninit, you also need to take it into
> >> consideration.
> >>
> >> And you should also call rte_eth_dev_release_port in remove ops in
> >> case user detach a port directly without closing it first.
> >>
> >> This comment also applies your ixgbe fix.
> >>
> >>
> >> Thanks,
> >> Xiaolong
> >>
> >>
> >> > }
> >> >
> >> > static struct rte_pci_driver rte_i40e_pmd =3D {
> >> >--
> >> >2.17.1
> >> >