From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by dpdk.org (Postfix) with ESMTP id 7C2E55A44 for ; Thu, 17 May 2018 13:22:35 +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 orsmga106.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 17 May 2018 04:22:34 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.49,410,1520924400"; d="scan'208";a="41709602" Received: from irsmsx152.ger.corp.intel.com ([163.33.192.66]) by orsmga007.jf.intel.com with ESMTP; 17 May 2018 04:22:33 -0700 Received: from irsmsx111.ger.corp.intel.com (10.108.20.4) by IRSMSX152.ger.corp.intel.com (163.33.192.66) with Microsoft SMTP Server (TLS) id 14.3.319.2; Thu, 17 May 2018 12:22:32 +0100 Received: from irsmsx108.ger.corp.intel.com ([169.254.11.150]) by irsmsx111.ger.corp.intel.com ([169.254.2.47]) with mapi id 14.03.0319.002; Thu, 17 May 2018 12:22:32 +0100 From: "Iremonger, Bernard" To: "Yang, Zhiyong" , "dev@dpdk.org" CC: "maxime.coquelin@redhat.com" , "Yigit, Ferruh" , "Bie, Tiwei" , "Yao, Lei A" , "Yang, Zhiyong" Thread-Topic: [dpdk-dev] [PATCH] app/testpmd: add to call detach for vdev when quitting Thread-Index: AQHT7Z9qjRvZX8w1iUuijWoPeqjNoKQzxf2A Date: Thu, 17 May 2018 11:22:31 +0000 Message-ID: <8CEF83825BEC744B83065625E567D7C24E0CD907@IRSMSX108.ger.corp.intel.com> References: <20180517125954.26675-1-zhiyong.yang@intel.com> In-Reply-To: <20180517125954.26675-1-zhiyong.yang@intel.com> Accept-Language: en-GB, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiNTc1ODg3Y2ItZjBiOC00ZmVlLWExODEtMWE5YjFkM2M5NWNkIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiVU5xcmlKbGRENjVvYWtLcm81SFFRdk5ndmp5M1RVdmI1UFFMeklDUnFpUXhSYzlzeVpPY3FBalwvOEs0WVB0cncifQ== x-ctpclassification: CTP_NT dlp-product: dlpe-windows dlp-version: 11.0.200.100 dlp-reaction: no-action 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] 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 11:22:35 -0000 Hi Zhiyong, > -----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 ; B= ie, > Tiwei ; Yao, Lei A ; Yang, Zhiy= ong > > Subject: [dpdk-dev] [PATCH] app/testpmd: add to call detach for vdev when > quitting >=20 > For vdev, just calling rte_eth_dev_close() isn't enough to free all the r= esources > allocated during device probe, e.g. for virtio-user, virtio_user_pmd_remo= ve(), > i.e. the remove() method of a vdev driver, needs to be called to unlink t= he socket > file created during device probe. So this patch calls the rte_eth_dev_det= ach() for > vdev when quitting testpmd. >=20 > Cc: maxime.coquelin@redhat.com > Cc: ferruh.yigit@intel.com > Cc: tiwei.bie@intel.com > Cc: lei.a.yao@intel.com >=20 > Signed-off-by: Zhiyong Yang > --- > app/test-pmd/testpmd.c | 6 ++++++ > 1 file changed, 6 insertions(+) >=20 > 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; >=20 > @@ -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); > } > } >=20 > -- > 2.14.3 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" Regards, Bernard.