net/idpf: stop before closing device

This patch stops device at the beginning of idpf_dev_close.

Fixes: 14aa6ed8f2ec ("net/idpf: support device start and stop")

Signed-off-by: Beilei Xing <beilei.xing@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
This commit is contained in:
Beilei Xing 2022-11-14 10:39:44 +00:00 committed by Qi Zhang
parent 5583abf6a3
commit e9ff6df15b
2 changed files with 9 additions and 0 deletions

View File

@ -609,6 +609,9 @@ idpf_dev_stop(struct rte_eth_dev *dev)
{
struct idpf_vport *vport = dev->data->dev_private;
if (vport->stopped == 1)
return 0;
idpf_vc_ena_dis_vport(vport, false);
idpf_stop_queues(dev);
@ -617,6 +620,8 @@ idpf_dev_stop(struct rte_eth_dev *dev)
idpf_vc_dealloc_vectors(vport);
vport->stopped = 1;
return 0;
}
@ -626,6 +631,8 @@ idpf_dev_close(struct rte_eth_dev *dev)
struct idpf_vport *vport = dev->data->dev_private;
struct idpf_adapter *adapter = vport->adapter;
idpf_dev_stop(dev);
idpf_vc_destroy_vport(vport);
rte_free(vport->rss_lut);

View File

@ -127,6 +127,8 @@ struct idpf_vport {
struct idpf_chunks_info chunks_info;
uint16_t devarg_id;
bool stopped;
};
struct idpf_adapter {