[dpdk-dev] [dpdk-stable] [PATCH v3 1/7] ethdev: fix port data reset timing

Ori Kam orika at mellanox.com
Wed Apr 25 14:30:57 CEST 2018


Hi

I vote for 2.3.

Ori

> -----Original Message-----
> From: dev [mailto:dev-bounces at dpdk.org] On Behalf Of Matan Azrad
> Sent: Wednesday, April 25, 2018 3:16 PM
> To: Ferruh Yigit <ferruh.yigit at intel.com>; Thomas Monjalon
> <thomas at monjalon.net>; Gaetan Rivet <gaetan.rivet at 6wind.com>; Jingjing
> Wu <jingjing.wu at intel.com>
> Cc: dev at dpdk.org; Neil Horman <nhorman at tuxdriver.com>; Bruce
> Richardson <bruce.richardson at intel.com>; Konstantin Ananyev
> <konstantin.ananyev at intel.com>; stable at dpdk.org; Olga Shern
> <olgas at mellanox.com>
> Subject: Re: [dpdk-dev] [dpdk-stable] [PATCH v3 1/7] ethdev: fix port data
> reset timing
> 
> Hi all
> 
> From: Ferruh Yigit, Thursday, April 19, 2018 2:08 PM
> > > But rte_eth_dev_release_port() is still broken because of this
> > >change,  please check _rte_eth_dev_callback_process() which uses
> > >dev->data- port_id.
> 
> The issue is that a DESTROY callback gets port_id=0 all the time, regardless
> the destroyed port id.
> 
> Let's discuss about the fix:
> 
> There are 2 options for the DESTROY event meaning:
> 
> 1. The device is going to be destroyed in the future (a bit after the callbacks
> calling).
> 	The user may think that there is a valid data in the device structure in
> the callback time,
> 	Thus, he may use it.
> 	The fix here is to move the callback to the start of the function,
> 	In this time the data field is still valid.
> 
> 2. The device was already destroyed in the past (a bit before the callbacks
> calling).
> 	The user should think that there is no any valid data in the device
> structure in the callback time,
> 	Thus, he doesn't use it.
> 	The issue here:
> 	_rte_eth_dev_callback_process() assumes there is a valid data in the
> data field  all the time,
> 	But in this case the data field is not valid because the device was
> already destroyed.
> 	Optional fixes:
> 	1. Always keep the data->port_id valid.
> 	2. keep the data->port_id valid only for the
> _rte_eth_dev_callback_process() call.
> 	3. Change _rte_eth_dev_callback_process() arg from "struct
> rte_eth_dev *dev" to "uint16_t port_id"
> 		a. Need to change all the calls for this internal API.
> 
> I vote to 2.1.
> 
> 
> What do you think?
> 
> Matan.
> 
> 
> 



More information about the dev mailing list