* [PATCH] net/idpf: need to stop device when closing device
@ 2022-11-14 10:39 beilei.xing
2022-11-15 3:31 ` Zhang, Qi Z
0 siblings, 1 reply; 2+ messages in thread
From: beilei.xing @ 2022-11-14 10:39 UTC (permalink / raw)
To: jingjing.wu, qi.z.zhang; +Cc: dev, Beilei Xing
From: Beilei Xing <beilei.xing@intel.com>
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>
---
drivers/net/idpf/idpf_ethdev.c | 7 +++++++
drivers/net/idpf/idpf_ethdev.h | 2 ++
2 files changed, 9 insertions(+)
diff --git a/drivers/net/idpf/idpf_ethdev.c b/drivers/net/idpf/idpf_ethdev.c
index 50aac65daf..5a141ba035 100644
--- a/drivers/net/idpf/idpf_ethdev.c
+++ b/drivers/net/idpf/idpf_ethdev.c
@@ -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);
diff --git a/drivers/net/idpf/idpf_ethdev.h b/drivers/net/idpf/idpf_ethdev.h
index ccdf4abe40..bfe27a5267 100644
--- a/drivers/net/idpf/idpf_ethdev.h
+++ b/drivers/net/idpf/idpf_ethdev.h
@@ -127,6 +127,8 @@ struct idpf_vport {
struct idpf_chunks_info chunks_info;
uint16_t devarg_id;
+
+ bool stopped;
};
struct idpf_adapter {
--
2.26.2
^ permalink raw reply [flat|nested] 2+ messages in thread
* RE: [PATCH] net/idpf: need to stop device when closing device
2022-11-14 10:39 [PATCH] net/idpf: need to stop device when closing device beilei.xing
@ 2022-11-15 3:31 ` Zhang, Qi Z
0 siblings, 0 replies; 2+ messages in thread
From: Zhang, Qi Z @ 2022-11-15 3:31 UTC (permalink / raw)
To: Xing, Beilei, Wu, Jingjing; +Cc: dev
> -----Original Message-----
> From: Xing, Beilei <beilei.xing@intel.com>
> Sent: Monday, November 14, 2022 6:40 PM
> To: Wu, Jingjing <jingjing.wu@intel.com>; Zhang, Qi Z <qi.z.zhang@intel.com>
> Cc: dev@dpdk.org; Xing, Beilei <beilei.xing@intel.com>
> Subject: [PATCH] net/idpf: need to stop device when closing device
>
> From: Beilei Xing <beilei.xing@intel.com>
>
> 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>
Applied to dpdk-next-net-intel.
Thanks
Qi
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-11-15 3:31 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-14 10:39 [PATCH] net/idpf: need to stop device when closing device beilei.xing
2022-11-15 3:31 ` Zhang, Qi Z
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).