ethdev: fix port data reset timing
authorMatan Azrad <matan@mellanox.com>
Mon, 22 Jan 2018 16:38:17 +0000 (16:38 +0000)
committerThomas Monjalon <thomas@monjalon.net>
Wed, 31 Jan 2018 19:46:43 +0000 (20:46 +0100)
commit133b54779aa1a0071e67d73b0963d28ef28b41a5
tree733d5f8e924be760de380fe4e1771c3befb63fb5
parente56447980ece8ea01717f41ff82cf8122635e7ec
ethdev: fix port data reset timing

rte_eth_dev_data structure is allocated per ethdev port and can be
used to get a data of the port internally.

rte_eth_dev_attach_secondary tries to find the port identifier using
rte_eth_dev_data name field comparison and may get an identifier of
invalid port in case of this port was released by the primary process
because the port release API doesn't reset the port data.

So, it will be better to reset the port data in release time instead of
allocation time.

Move the port data reset to the port release API.

Fixes: d948f596fee2 ("ethdev: fix port data mismatched in multiple process model")
Cc: stable@dpdk.org
Signed-off-by: Matan Azrad <matan@mellanox.com>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
lib/librte_ether/rte_ethdev.c