From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id EACC02A5E for ; Wed, 22 Feb 2017 03:32:13 +0100 (CET) Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 21 Feb 2017 18:32:12 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.35,192,1484035200"; d="scan'208";a="228188968" Received: from yliu-dev.sh.intel.com (HELO yliu-dev) ([10.239.67.162]) by fmsmga004.fm.intel.com with ESMTP; 21 Feb 2017 18:32:11 -0800 Date: Wed, 22 Feb 2017 10:34:23 +0800 From: Yuanhan Liu To: hanxueluo@126.com Cc: dev@dpdk.org, Huanle Han , Thomas Monjalon , "Yigit, Ferruh" Message-ID: <20170222023423.GN18844@yliu-dev.sh.intel.com> References: <1487599487-12574-1-git-send-email-hanxueluo@126.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1487599487-12574-1-git-send-email-hanxueluo@126.com> User-Agent: Mutt/1.5.23 (2014-03-12) Subject: Re: [dpdk-dev] [PATCH 1/3] net/virtio: fix dev detachable flag 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: Wed, 22 Feb 2017 02:32:14 -0000 On Mon, Feb 20, 2017 at 10:04:45PM +0800, hanxueluo@126.com wrote: > From: Huanle Han > > The dev detachable flag was removed by > commit f229eb4 ("net/virtio: fix rewriting LSC flag"). > > Signed-off-by: Huanle Han > --- > drivers/net/virtio/virtio_ethdev.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/drivers/net/virtio/virtio_ethdev.c b/drivers/net/virtio/virtio_ethdev.c > index 4dc03b9..8465e1a 100644 > --- a/drivers/net/virtio/virtio_ethdev.c > +++ b/drivers/net/virtio/virtio_ethdev.c > @@ -1336,6 +1336,7 @@ virtio_init_device(struct rte_eth_dev *eth_dev, uint64_t req_features) > if (eth_dev->device) { > pci_dev = RTE_DEV_TO_PCI(eth_dev->device); > rte_eth_copy_pci_info(eth_dev, pci_dev); > + eth_dev->data->dev_flags |= RTE_ETH_DEV_DETACHABLE; This is a partial fix. The major issue here is rte_eth_copy_pci_info has an undocumented side effect: it resets the dev_flags unconditionally. Removing such reset should be able to fix it: it also looks like the right fix to me. Thomas, Ferruh? If not, we could at least call rte_eth_copy_pci_info() at eth_virtio_dev_init(), before we set any dev_flags bits. --yliu