From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from out1-smtp.messagingengine.com (out1-smtp.messagingengine.com [66.111.4.25]) by dpdk.org (Postfix) with ESMTP id CCDEF23A for ; Sun, 27 May 2018 06:06:55 +0200 (CEST) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 439EC20E24; Sun, 27 May 2018 00:06:55 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Sun, 27 May 2018 00:06:55 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fridaylinux.org; h=cc:content-type:date:from:in-reply-to:message-id:mime-version :references:subject:to:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; bh=e7E9BS5bMFdTDzHE/gs3SGASbYAfBBJF+LzfPiTyNL8=; b=PfxA2wpf bnhpImbkCntZvXzLAi+JmQ28hRldIQjLPkgxbpEjn5uUGzcOEytxgppP4BgahFAF 3lDMisD82lSiTCcB9SmG+vZSozQiNc3fGeE94/6xfjneVWzFsTW5jt0rfMMP1iYP L8cqTs3iYyTQAB+q56HLdFR1isS3yKIlMKJvEvjWi+ndDk1BWjWvd5ZDr/g/D16l v8k3FXXO+yAnMbtpMzVeotwK7g9QNtJDD4E+xOnuJaT1G5YM/GVttROTEQIkw2cw JTU2W/jnINqSmvmhoixfShKAC0uzJSoEFrzxL4GuMYjx33kxqEmKav/GXjAaA/5i 41txbVJIhF7CgQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-sender :x-me-sender:x-sasl-enc; s=fm2; bh=e7E9BS5bMFdTDzHE/gs3SGASbYAfB BJF+LzfPiTyNL8=; b=I0WAwRlaUQJ1dmIthoCxQE/yUc+lSCrOZRTEn2HWMTuGl 0dMEir754xFW8xWV8/02zVC+UVQl5E5/lJDRrWuiZJaFGOrXqaA9n6gmMVQnfIn7 Mse4KJIj+A1C9gIiddqRjP6uFg2w1qYnlMAwbP3QqTRtYD5Aj5UbotqRPITYaOMp wOuRt1uWTU/bJmJ6vgbe704qH/wdWDPgBOjit/d3Nl6DhJDpTQFpPFCEhovCiqxc HtBiqkEHgWeXTKQC9gKx2ytKOFa+Ww7xNQ58NcxGhXWyKg/6mQmi3nLJDigPbf5z kWQxNrEHWLLAh0hmfpH6N/I30Ak2NLNT4xEUk77QQ== X-ME-Proxy: X-ME-Proxy: X-ME-Proxy: X-ME-Proxy: X-ME-Proxy: X-ME-Proxy: X-ME-Sender: Received: from yuanhanliu-NB0 (unknown [223.74.148.22]) by mail.messagingengine.com (Postfix) with ESMTPA id 265A7E4339; Sun, 27 May 2018 00:06:53 -0400 (EDT) Date: Sun, 27 May 2018 12:06:30 +0800 From: Yuanhan Liu To: Ferruh Yigit Cc: Wenzhuo Lu , Jingjing Wu , dev@dpdk.org, Zhiyong Yang , Bernard Iremonger , Thomas Monjalon , Maxime Coquelin Message-ID: <20180527040630.x3wrjsblyqbxk3bz@yuanhanliu-NB0.tencent.com> References: <20180522183509.66644-1-ferruh.yigit@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180522183509.66644-1-ferruh.yigit@intel.com> User-Agent: NeoMutt/20170113 (1.7.2) Subject: Re: [dpdk-dev] [PATCH] app/testpmd: fix failsafe PMD failure on exit 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: Sun, 27 May 2018 04:06:56 -0000 On Tue, May 22, 2018 at 07:35:08PM +0100, Ferruh Yigit wrote: > vdevs detach on testpmd exit implemented as workaround to fix > a virtio-user issue. The issue was virtio-user cleanup is not > called and existing socket file not cleaned up which will fail > next run. > > The vdev cleanup causing problems in failsafe PMD. > > Reduce the cleanup to only virtio-user and add a comment that this > workaround should be converted to a proper cleanup, not something > specific to virtio-user, and not something specific to vdev and > testpmd. > > Fixes: fe890955114d ("app/testpmd: fix exit for vdevs") > ... > pmd_test_exit(void) > { > - const struct rte_bus *bus; > struct rte_device *device; > portid_t pt_id; > int ret; > @@ -2025,13 +2024,21 @@ pmd_test_exit(void) > if (ports != NULL) { > no_link_check = 1; > RTE_ETH_FOREACH_DEV(pt_id) { > - device = rte_eth_devices[pt_id].device; > - bus = 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")) > + > + /* > + * 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. Any particular reason why the socket removal can not be done in virtio-user pmd, say at its close method? --yliu > + * 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); > } > } > -- > 2.14.3