Skip to content

Commit

Permalink
net/i40e: fix VF representor release
Browse files Browse the repository at this point in the history
[ upstream commit ba10df5 ]

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 instead of PF.

Fixes: e391a7b ("net/i40e: fix multi-process shared data")

Signed-off-by: Ke Zhang <ke1x.zhang@intel.com>
Acked-by: Yuying Zhang <yuying.zhang@intel.com>
  • Loading branch information
ke1zhang authored and kevintraynor committed Oct 11, 2022
1 parent 2780547 commit 85821d6
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions drivers/net/i40e/i40e_vf_representor.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;

Expand Down

0 comments on commit 85821d6

Please sign in to comment.