From mboxrd@z Thu Jan 1 00:00:00 1970 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) Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga105.jf.intel.com with ESMTP; 07 Feb 2017 17:47:25 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.33,346,1477983600"; d="scan'208";a="56398138" Received: from yliu-dev.sh.intel.com (HELO yliu-dev) ([10.239.67.162]) by orsmga004.jf.intel.com with ESMTP; 07 Feb 2017 17:47:24 -0800 Date: Wed, 8 Feb 2017 09:49:51 +0800 From: Yuanhan Liu To: Ferruh Yigit Cc: Qi Zhang , jingjing.wu@intel.com, helin.zhang@intel.com, dev@dpdk.org, Thomas Monjalon 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 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) Subject: Re: [dpdk-dev] [PATCH] net/i40e: fix wrong device flag setup 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, 08 Feb 2017 01:47:27 -0000 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