Skip to contentSkip to conversation

net/idpf: need to stop device when closing device

PATCH Applied [email protected] 2 participants 2 messages Nov 14, 2022 – Nov 15, 2022 Network drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net/idpf: need to stop device when closing device

From: Beilei Xing <[email protected]>

This patch stops device at the beginning of idpf_dev_close.

Fixes 14aa6ed8f2ec ("net/idpf: support device start and stop")
---
 drivers/net/idpf/idpf_ethdev.c | 7 +++++++
 drivers/net/idpf/idpf_ethdev.h | 2 ++
 2 files changed, 9 insertions(+)
drivers/net/idpf/idpf_ethdev.c +7 -0
index 50aac65daf..5a141ba035 100644
@@ -605,6 +605,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);
@@ -613,6 +616,8 @@ idpf_dev_stop(struct rte_eth_dev *dev)
 
 	idpf_vc_dealloc_vectors(vport);
 
+	vport->stopped = 1;
+
 	return 0;
 }
 
@@ -622,6 +627,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);
drivers/net/idpf/idpf_ethdev.h +2 -0
index ccdf4abe40..bfe27a5267 100644
@@ -127,6 +127,8 @@ struct idpf_vport {
 	struct idpf_chunks_info chunks_info;
 
 	uint16_t devarg_id;
+
+	bool stopped;
 };
 
 struct idpf_adapter {
Signature · 1 line
2.26.2
Acked-by on v1 1/1 Applied
#1 lore raw
Quoted 9 lines

-----Original Message-----
From: Xing, Beilei <[email protected]>
Sent: Monday, November 14, 2022 6:40 PM
To: Wu, Jingjing <[email protected]>; Zhang, Qi Z <[email protected]>
Cc: [email protected]; Xing, Beilei <[email protected]>
Subject: [PATCH] net/idpf: need to stop device when closing device

Quoted 7 lines

From: Beilei Xing <[email protected]>

This patch stops device at the beginning of idpf_dev_close.

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

Applied to dpdk-next-net-intel.

Thanks
Qi