From mboxrd@z Thu Jan 1 00:00:00 1970 From: Yuanhan Liu Subject: Re: [PATCH] net/i40e: fix wrong device flag setup Date: Wed, 8 Feb 2017 09:49:51 +0800 Message-ID: <20170208014951.GM20916@yliu-dev.sh.intel.com> References: <1486164969-2566-1-git-send-email-qi.z.zhang@intel.com> <736135ef-b9cf-cd6e-1dfc-ecba9d63e114@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Qi Zhang , jingjing.wu@intel.com, helin.zhang@intel.com, dev@dpdk.org, Thomas Monjalon To: Ferruh Yigit Return-path: Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by dpdk.org (Postfix) with ESMTP id B76E1591E for ; Wed, 8 Feb 2017 02:47:26 +0100 (CET) Content-Disposition: inline In-Reply-To: List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On Tue, Feb 07, 2017 at 10:32:32AM +0000, Ferruh Yigit wrote: > On 2/7/2017 10:24 AM, Ferruh Yigit wrote: > > On 2/3/2017 11:36 PM, Qi Zhang wrote: > >> dev_flags is wrong overwritten by RTE_ETH_DEV_DETACHABLE after > >> rte_eth_copy_pci_info. > >> ... > Hi Yuanhan, > > I saw while checking for this, there can be an issue in virtio for this > path, can you please check: > > eth_virtio_dev_init() > set-some-eth_dev-dev_flags > virtio_init_device() > rte_eth_copy_pci_info() > eth_dev->data->dev_flags = 0; <---- Reset previous flags Hi Ferruh, Nice catch! And yes, it's buggy. It may be trivially fixed by setting the orders correctly. But my question is why "rte_eth_copy_pci_info" does a reset on "dev_flags"? It's an *un-documented* side-effect of this function, which could be very error-prone, like this one. --yliu