From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas Monjalon Subject: Re: [PATCH] app/testpmd: fix failsafe PMD failure on exit Date: Sun, 27 May 2018 14:37:28 +0200 Message-ID: <6066559.Wi7eJV5HDK@xps> References: <20180522183509.66644-1-ferruh.yigit@intel.com> <20180527040630.x3wrjsblyqbxk3bz@yuanhanliu-NB0.tencent.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7Bit Cc: Ferruh Yigit , Wenzhuo Lu , Jingjing Wu , dev@dpdk.org, Zhiyong Yang , Bernard Iremonger , Maxime Coquelin To: Yuanhan Liu Return-path: Received: from out1-smtp.messagingengine.com (out1-smtp.messagingengine.com [66.111.4.25]) by dpdk.org (Postfix) with ESMTP id A6374B62 for ; Sun, 27 May 2018 14:37:38 +0200 (CEST) In-Reply-To: <20180527040630.x3wrjsblyqbxk3bz@yuanhanliu-NB0.tencent.com> List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 27/05/2018 06:06, Yuanhan Liu: > On Tue, May 22, 2018 at 07:35:08PM +0100, Ferruh Yigit wrote: > > + /* > > + * This is a workaround to fix a virtio-user issue that > > + * requires to call clean-up routine to remove existing > > + * socket. > > I came across this patch while I was cherry-picking patches to 17.11.4 > release. And this patch seems wrong to me. Yes it is far from perfect. > Any particular reason why the socket removal can not be done in virtio-user > pmd, say at its close method? The socket is removed in the remove function of the driver. The right fix is to call the remove functions of all driver from the EAL cleanup function. We have decided of this last minute workaround for testpmd because we need it for testing convenience, but do not want to take any risk with a proper fix as it is really late for that. > > + * This workaround valid only for testpmd, needs a fix > > + * valid for all applications. > > + * TODO: Implement proper resource cleanup > > + */ > > + device = rte_eth_devices[pt_id].device; > > + if (device && !strcmp(device->driver->name, "net_virtio_user")) > > detach_port(pt_id); > > } > > } >