[v3] app/testpmd: fix quit testpmd with vfs and pf
Checks
Commit Message
A segmentation fault occurs when testpmd exit.
This is due to fetching the device name from PF
, PF is freed firstly and then VF representor
is called later.
This commit fixes the bug by fetching the device
name from vf representor not PF.
Fixes: e391a7b7f815 ("net/i40e: fix multi-process shared data")
Cc: stable@dpdk.org
Signed-off-by: Ke Zhang <ke1x.zhang@intel.com>
---
v3: Change the design and fix code in driver
v2: Change the testpmd code to fix this issue
---
---
drivers/net/i40e/i40e_vf_representor.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
Comments
13/07/2022 09:11, Ke Zhang:
> A segmentation fault occurs when testpmd exit.
The title talks about testpmd, but the change is in i40e.
Please update.
> This is due to fetching the device name from PF
> , PF is freed firstly and then VF representor
> is called later.
For info, a comma must follow the previous word without any space.
It is strange to see a comma at the beginning of a line.
> This commit fixes the bug by fetching the device
> name from vf representor not PF.
vf should be VF uppercase
> Fixes: e391a7b7f815 ("net/i40e: fix multi-process shared data")
> Cc: stable@dpdk.org
>
> Signed-off-by: Ke Zhang <ke1x.zhang@intel.com>
>
> ---
> v3: Change the design and fix code in driver
> v2: Change the testpmd code to fix this issue
> ---
> ---
> drivers/net/i40e/i40e_vf_representor.c | 4 +---
> 1 file changed, 1 insertion(+), 3 deletions(-)
@@ -29,8 +29,6 @@ i40e_vf_representor_dev_infos_get(struct rte_eth_dev *ethdev,
struct rte_eth_dev_info *dev_info)
{
struct i40e_vf_representor *representor = ethdev->data->dev_private;
- struct rte_eth_dev_data *pf_dev_data =
- representor->adapter->pf.dev_data;
/* get dev info for the vdev */
dev_info->device = ethdev->device;
@@ -104,7 +102,7 @@ i40e_vf_representor_dev_infos_get(struct rte_eth_dev *ethdev,
};
dev_info->switch_info.name =
- rte_eth_devices[pf_dev_data->port_id].device->name;
+ rte_eth_devices[ethdev->data->port_id].device->name;
dev_info->switch_info.domain_id = representor->switch_domain_id;
dev_info->switch_info.port_id = representor->vf_id;