From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <zhiyong.yang@intel.com>
Received: from mga05.intel.com (mga05.intel.com [192.55.52.43])
 by dpdk.org (Postfix) with ESMTP id 7445811D4;
 Wed, 23 May 2018 03:52:11 +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 fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;
 22 May 2018 18:52:07 -0700
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="5.49,431,1520924400"; d="scan'208";a="43163122"
Received: from fmsmsx107.amr.corp.intel.com ([10.18.124.205])
 by orsmga007.jf.intel.com with ESMTP; 22 May 2018 18:52:06 -0700
Received: from fmsmsx117.amr.corp.intel.com (10.18.116.17) by
 fmsmsx107.amr.corp.intel.com (10.18.124.205) with Microsoft SMTP Server (TLS)
 id 14.3.319.2; Tue, 22 May 2018 18:52:06 -0700
Received: from bgsmsx151.gar.corp.intel.com (10.224.48.42) by
 fmsmsx117.amr.corp.intel.com (10.18.116.17) with Microsoft SMTP Server (TLS)
 id 14.3.319.2; Tue, 22 May 2018 18:52:05 -0700
Received: from bgsmsx101.gar.corp.intel.com ([169.254.1.244]) by
 BGSMSX151.gar.corp.intel.com ([169.254.3.7]) with mapi id 14.03.0319.002;
 Wed, 23 May 2018 07:22:03 +0530
From: "Yang, Zhiyong" <zhiyong.yang@intel.com>
To: Thomas Monjalon <thomas@monjalon.net>, "Yigit, Ferruh"
 <ferruh.yigit@intel.com>
CC: "dev@dpdk.org" <dev@dpdk.org>, Matan Azrad <matan@mellanox.com>,
 "Iremonger, Bernard" <bernard.iremonger@intel.com>, "Yao, Lei A"
 <lei.a.yao@intel.com>, "maxime.coquelin@redhat.com"
 <maxime.coquelin@redhat.com>, "Bie, Tiwei" <tiwei.bie@intel.com>,
 "stable@dpdk.org" <stable@dpdk.org>, "Van Haaren, Harry"
 <harry.van.haaren@intel.com>
Thread-Topic: [dpdk-dev] [PATCH v2] app/testpmd: fix pmd_test_exit function
 for vdevs
Thread-Index: AQHT7sVdX7BUqRGnxES6+eTFOwB8OKQ2vxKAgALreICAAF48gIAAAcgAgAFYxACAAFsuAIAAE4GAgAC+41A=
Date: Wed, 23 May 2018 01:52:02 +0000
Message-ID: <E182254E98A5DA4EB1E657AC7CB9BD2A8B0D739B@BGSMSX101.gar.corp.intel.com>
References: <20180518095937.28710-1-zhiyong.yang@intel.com>
 <9489790.cv73CZovxU@xps> <45bf17fa-fb43-7917-8cf6-63864f9d2c4c@intel.com>
 <3059388.qb94XYSleL@xps>
In-Reply-To: <3059388.qb94XYSleL@xps>
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-stable] [dpdk-dev] [PATCH v2] app/testpmd: fix
 pmd_test_exit function for vdevs
X-BeenThere: stable@dpdk.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: patches for DPDK stable branches <stable.dpdk.org>
List-Unsubscribe: <https://dpdk.org/ml/options/stable>,
 <mailto:stable-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://dpdk.org/ml/archives/stable/>
List-Post: <mailto:stable@dpdk.org>
List-Help: <mailto:stable-request@dpdk.org?subject=help>
List-Subscribe: <https://dpdk.org/ml/listinfo/stable>,
 <mailto:stable-request@dpdk.org?subject=subscribe>
X-List-Received-Date: Wed, 23 May 2018 01:52:13 -0000

Hi Thomas,=20

> -----Original Message-----
> From: Thomas Monjalon [mailto:thomas@monjalon.net]
> Sent: Wednesday, May 23, 2018 3:49 AM
> To: Yigit, Ferruh <ferruh.yigit@intel.com>
> Cc: Yang, Zhiyong <zhiyong.yang@intel.com>; dev@dpdk.org; Matan Azrad
> <matan@mellanox.com>; Iremonger, Bernard
> <bernard.iremonger@intel.com>; Yao, Lei A <lei.a.yao@intel.com>;
> maxime.coquelin@redhat.com; Bie, Tiwei <tiwei.bie@intel.com>;
> stable@dpdk.org; Van Haaren, Harry <harry.van.haaren@intel.com>
> Subject: Re: [dpdk-dev] [PATCH v2] app/testpmd: fix pmd_test_exit functio=
n for
> vdevs
>=20
> 22/05/2018 20:38, Ferruh Yigit:
> > On 5/22/2018 2:12 PM, Thomas Monjalon wrote:
> > > Any update to improve this workaround?
> > >
> > > 21/05/2018 18:38, Thomas Monjalon:
> > >> 21/05/2018 18:32, Ferruh Yigit:
> > >>> On 5/21/2018 11:54 AM, Thomas Monjalon wrote:
> > >>>> 19/05/2018 16:19, Thomas Monjalon:
> > >>>>> 18/05/2018 18:29, Ferruh Yigit:
> > >>>>>> On 5/18/2018 4:55 PM, Matan Azrad wrote:
> > >>>>>>> Hi all
> > >>>>>>>
> > >>>>>>> While this patch also applied I don't understand it.
> > >>>>>>> Is it mandatory for each PMD to free all its resources in dev_c=
lose()?
> > >>>>>>> Or it should be done by the rte_device remove function?
> > >>>>>>>
> > >>>>>>> If the resource cleanup should be done by the remove function
> > >>>>>>> I think it should be called for all the devices (pci, vdev, etc=
).
> > >>>>>>>
> > >>>>>>> Is there an exit function for EAL to clean rte_eal_init()? If n=
o, looks
> like we need it...
> > >>>>>>
> > >>>>>> Hi Matan,
> > >>>>>>
> > >>>>>> I believe there is a gap in resource cleanup.
> > >>>>>> dev_close() it not for resource cleanup, it should be in PMD
> > >>>>>> remove() functions, and PMDs have it. The problem is remove path=
 is
> not called in application exit.
> > >>>>>>
> > >>>>>> As far as I know there is no simple API to clean the resources,
> > >>>>>> having it may help application to do the cleanup.
> > >>>>>>
> > >>>>>> I have seen the rte_eal_cleanup() API by Harry, that can be
> > >>>>>> extended to cover PMD resource cleanup if there is enough
> motivation for it.
> > >>>>>
> > >>>>> Yes, EAL resources should be removed by the function
> rte_eal_cleanup().
> > >>>>> And ethdev ports must be removed by rte_eth_dev_close().
> > >>>>
> > >>>> This patch is relying on rte_eth_dev_detach() to remove the EAL de=
vice.
> > >>>> It should be done in rte_eal_cleanup().
> > >>>>
> > >>>> I am concerned that this patch is workarounding a miss in
> > >>>> rte_eal_cleanup, and takes a different action only for vdev. It is=
 a bad
> example.
> > >>>
> > >>> Indeed it does workaround, but it is needed to fix a defect in virt=
io-user.
> > >>
> > >> The defect is still in virtio-user after this patch.
> > >> To make this workaround acceptable, you need:
> > >> 	1/ add the virtio-user known issue in release notes

I don't think it is a bug for virtio-user. Just no proper implemented API c=
an free the virtio-user resources  allocated by probe method.
Socket file is just one example,  other resources are freed in the remove m=
ethod.  Testpmd was always missing the functionality.

> > >> 	2/ add a FIXME comment in testpmd code explaining the workaround
> > >> 	3/ commit to work on rte_eal_cleanup() in 18.08
> >
> > I have submitted following patch [1], can it cover 2/ for the v18.05-rc=
5?
> >
> > [1]
> > https://dpdk.org/dev/patchwork/patch/40350/
>=20
> Yes, it covers item 2/. Thanks
>=20
>=20

rte_eal_cleanup() is a proper API,  which is needed to clean up resources.

Thanks
Zhiyong