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 B65707CEF for ; Thu, 17 May 2018 16:36:20 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 17 May 2018 07:36:19 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.49,390,1520924400"; d="scan'208";a="41755340" Received: from fmsmsx103.amr.corp.intel.com ([10.18.124.201]) by orsmga007.jf.intel.com with ESMTP; 17 May 2018 07:36:19 -0700 Received: from bgsmsx105.gar.corp.intel.com (10.223.43.197) by FMSMSX103.amr.corp.intel.com (10.18.124.201) with Microsoft SMTP Server (TLS) id 14.3.319.2; Thu, 17 May 2018 07:36:18 -0700 Received: from bgsmsx101.gar.corp.intel.com ([169.254.1.242]) by BGSMSX105.gar.corp.intel.com ([169.254.3.165]) with mapi id 14.03.0319.002; Thu, 17 May 2018 20:06:16 +0530 From: "Yang, Zhiyong" To: "Iremonger, Bernard" , "dev@dpdk.org" CC: "maxime.coquelin@redhat.com" , "Yigit, Ferruh" , "Bie, Tiwei" , "Yao, Lei A" Thread-Topic: [dpdk-dev] [PATCH] app/testpmd: add to call detach for vdev when quitting Thread-Index: AQHT7dFcxssGk9i41kaD07z9T18ae6Qz/Jrw Date: Thu, 17 May 2018 14:36:14 +0000 Message-ID: References: <20180517125954.26675-1-zhiyong.yang@intel.com> <8CEF83825BEC744B83065625E567D7C24E0CD907@IRSMSX108.ger.corp.intel.com> In-Reply-To: <8CEF83825BEC744B83065625E567D7C24E0CD907@IRSMSX108.ger.corp.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.200.100 dlp-reaction: no-action x-originating-ip: [10.223.10.10] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH] app/testpmd: add to call detach for vdev when quitting 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: Thu, 17 May 2018 14:36:21 -0000 Bernard, Thanks for your review. > -----Original Message----- > From: Iremonger, Bernard > Sent: Thursday, May 17, 2018 7:23 PM > To: Yang, Zhiyong ; dev@dpdk.org > Cc: maxime.coquelin@redhat.com; Yigit, Ferruh ; B= ie, > Tiwei ; Yao, Lei A ; Yang, Zhiy= ong > > Subject: RE: [dpdk-dev] [PATCH] app/testpmd: add to call detach for vdev = when > quitting >=20 > Hi Zhiyong, >=20 > > -----Original Message----- > > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of > > zhiyong.yang@intel.com > > Sent: Thursday, May 17, 2018 2:00 PM > > To: dev@dpdk.org > > Cc: maxime.coquelin@redhat.com; Yigit, Ferruh > > ; Bie, Tiwei ; Yao, Lei A > > ; Yang, Zhiyong > > Subject: [dpdk-dev] [PATCH] app/testpmd: add to call detach for vdev > > when quitting > > > > For vdev, just calling rte_eth_dev_close() isn't enough to free all > > the resources allocated during device probe, e.g. for virtio-user, > > virtio_user_pmd_remove(), i.e. the remove() method of a vdev driver, > > needs to be called to unlink the socket file created during device > > probe. So this patch calls the rte_eth_dev_detach() for vdev when quitt= ing > testpmd. > > > > Cc: maxime.coquelin@redhat.com > > Cc: ferruh.yigit@intel.com > > Cc: tiwei.bie@intel.com > > Cc: lei.a.yao@intel.com > > > > Signed-off-by: Zhiyong Yang > > --- > > app/test-pmd/testpmd.c | 6 ++++++ > > 1 file changed, 6 insertions(+) > > > > diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c index > > 134401603..1d308f056 100644 > > --- a/app/test-pmd/testpmd.c > > +++ b/app/test-pmd/testpmd.c > > @@ -2011,6 +2011,8 @@ detach_port(portid_t port_id) void > > pmd_test_exit(void) > > { > > + const struct rte_bus *bus; > > + struct rte_device *device; > > portid_t pt_id; > > int ret; > > > > @@ -2020,10 +2022,14 @@ pmd_test_exit(void) > > if (ports !=3D NULL) { > > no_link_check =3D 1; > > RTE_ETH_FOREACH_DEV(pt_id) { > > + device =3D rte_eth_devices[pt_id].device; > > + bus =3D rte_bus_find_by_device(device); > > printf("\nShutting down port %d...\n", pt_id); > > fflush(stdout); > > stop_port(pt_id); > > close_port(pt_id); > > + if (bus && !strcmp(bus->name, "vdev")) > > + detach_port(pt_id); > > } > > } > > > > -- > > 2.14.3 >=20 > This appears to be a bug fix patch, if so it should have a fixes line. > Also the commit line should include "fix", for example: > "app/testpmd: fix pmd_test_exit function for vdevs" >=20 Ok, fix it in next version.=20 Thanks Zhiyong