[dpdk-dev] [PATCH] net/i40e: fix wrong device flag setup

Yuanhan Liu yuanhan.liu at linux.intel.com
Wed Feb 8 02:49:51 CET 2017


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


More information about the dev mailing list