[dpdk-stable] [ PATCH 17.11 1/2] ethdev: clear ethdev data upon detach
Yongseok Koh
yskoh at mellanox.com
Mon Mar 4 20:57:16 CET 2019
> On Mar 1, 2019, at 3:53 AM, Reshma Pattan <reshma.pattan at intel.com> wrote:
>
> When port is detached its relevant rte_eth_dev_data[port_id]
> has to be zeroed, otherwise the next port creations
> could get wrong port_id.
>
> Fixes: 92d94d3744 ("ethdev: attach or detach port")
> Signed-off-by: Reshma Pattan <reshma.pattan at intel.com>
> ---
> lib/librte_ether/rte_ethdev.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/lib/librte_ether/rte_ethdev.c b/lib/librte_ether/rte_ethdev.c
> index 096b35faf..7ba9bc564 100644
> --- a/lib/librte_ether/rte_ethdev.c
> +++ b/lib/librte_ether/rte_ethdev.c
> @@ -443,6 +443,7 @@ rte_eth_dev_detach(uint16_t port_id, char *name)
> goto err;
>
> rte_eth_devices[port_id].state = RTE_ETH_DEV_UNUSED;
> + memset(&rte_eth_dev_data[port_id], 0, sizeof(struct rte_eth_dev_data));
Hi,
I believe such code is good to have. Before I merge it, I have a question.
I wonder what the problem of the current code is.
If the state turns into RTE_ETH_DEV_UNUSED,
then will the eth_dev be re-initialized next time anyway?
Thanks,
Yongseok
> return 0;
>
> err:
> --
> 2.17.1
>
More information about the stable
mailing list