DPDK patches and discussions
 help / color / mirror / Atom feed
* [PATCH] net/ice: fix ice dcf contrl thread crash
@ 2023-02-08  8:30 Ke Zhang
  2023-02-09  0:05 ` Stephen Hemminger
                   ` (3 more replies)
  0 siblings, 4 replies; 25+ messages in thread
From: Ke Zhang @ 2023-02-08  8:30 UTC (permalink / raw)
  To: qi.z.zhang, qiming.yang, dev; +Cc: Ke Zhang

The control thread accesses the hardware resources after the
resources were released, resulting in a segment error.

This commit fixes the bug by exiting thread before resource released.

Signed-off-by: Ke Zhang <ke1x.zhang@intel.com>
---
 drivers/net/ice/ice_dcf.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/net/ice/ice_dcf.c b/drivers/net/ice/ice_dcf.c
index 1c3d22ae0f..e58908caf5 100644
--- a/drivers/net/ice/ice_dcf.c
+++ b/drivers/net/ice/ice_dcf.c
@@ -543,6 +543,8 @@ ice_dcf_handle_vsi_update_event(struct ice_dcf_hw *hw)
 	ice_dcf_disable_irq0(hw);
 
 	for (;;) {
+		if (hw->vc_event_msg_cb == NULL)
+			pthread_exit(NULL);
 		if (ice_dcf_get_vf_resource(hw) == 0 &&
 		    ice_dcf_get_vf_vsi_map(hw) >= 0) {
 			err = 0;
@@ -760,6 +762,8 @@ ice_dcf_uninit_hw(struct rte_eth_dev *eth_dev, struct ice_dcf_hw *hw)
 	rte_intr_callback_unregister(intr_handle,
 				     ice_dcf_dev_interrupt_handler, hw);
 
+	hw->vc_event_msg_cb = NULL;
+
 	ice_dcf_mode_disable(hw);
 	iavf_shutdown_adminq(&hw->avf);
 
-- 
2.25.1


^ permalink raw reply	[flat|nested] 25+ messages in thread
* RE: [PATCH v7] net/ice: fix ice dcf control thread crash
@ 2023-05-10  9:34 Liao, TingtingX
  0 siblings, 0 replies; 25+ messages in thread
From: Liao, TingtingX @ 2023-05-10  9:34 UTC (permalink / raw)
  To: Ye, MingjinX, dev
  Cc: Yang, Qiming, stable, Zhou, YidingX, Ye, MingjinX, Zhang, Qi Z,
	Liao, TingtingX

[-- Attachment #1: Type: text/plain, Size: 1806 bytes --]

> -----Original Message-----

> From: Mingjin Ye <mingjinx.ye@intel.com<mailto:mingjinx.ye@intel.com>>

> Sent: Tuesday, April 11, 2023 10:09 AM

> To: dev@dpdk.org<mailto:dev@dpdk.org>

> Cc: Yang, Qiming <qiming.yang@intel.com<mailto:qiming.yang@intel.com>>; stable@dpdk.org<mailto:stable@dpdk.org>; Zhou, YidingX <yidingx.zhou@intel.com<mailto:yidingx.zhou@intel.com>>; Ye, MingjinX <mingjinx.ye@intel.com<mailto:mingjinx.ye@intel.com>>; Zhang, Ke1X <ke1x.zhang@intel.com<mailto:ke1x.zhang@intel.com>>; Zhang, Qi Z <qi.z.zhang@intel.com<mailto:qi.z.zhang@intel.com>>

> Subject: [PATCH v7] net/ice: fix ice dcf control thread crash

>

> The control thread accesses the hardware resources after the resources were released, which results in a segment error.

>

> The 'ice-reset' threads are detached, so thread resources cannot be reclaimed by `pthread_join` calls.

>

> This commit synchronizes the number of "ice-reset" threads by adding a variable ("vsi_update_thread_num") to the "struct ice_dcf_hw" and performing an atomic operation on this variable. When releasing HW resources, we wait for the number of "ice-reset" threads to be reduced to 0 before releasing the resources.

>

> Fixes: c7e1a1a3bfeb ("net/ice: refactor DCF VLAN handling")

> Fixes: 3b3757bda3c3 ("net/ice: get VF hardware index in DCF")

> Fixes: 7564d5509611 ("net/ice: add DCF hardware initialization")

> Fixes: 0b02c9519432 ("net/ice: handle PF initialization by DCF")

> Cc: stable@dpdk.org<mailto:stable@dpdk.org>

>

> Signed-off-by: Ke Zhang <ke1x.zhang@intel.com<mailto:ke1x.zhang@intel.com>>

> Signed-off-by: Mingjin Ye <mingjinx.ye@intel.com<mailto:mingjinx.ye@intel.com>>



Tested-by: Tingting Liao <tingtingx.liao@intel.com<mailto:tingtingx.liao@intel.com>>




[-- Attachment #2: Type: text/html, Size: 6482 bytes --]

^ permalink raw reply	[flat|nested] 25+ messages in thread

end of thread, other threads:[~2023-05-15  6:29 UTC | newest]

Thread overview: 25+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-02-08  8:30 [PATCH] net/ice: fix ice dcf contrl thread crash Ke Zhang
2023-02-09  0:05 ` Stephen Hemminger
2023-02-13  7:03 ` [PATCH v2] " Ke Zhang
2023-02-21  0:29   ` Zhang, Qi Z
2023-02-13  7:14 ` Ke Zhang
2023-02-13  7:16 ` [PATCH v2] net/ice: fix ice dcf control " Ke Zhang
2023-02-14 11:03   ` Thomas Monjalon
2023-02-16  7:53     ` Zhang, Ke1X
2023-02-20  0:30       ` Thomas Monjalon
2023-03-01  1:54         ` Zhang, Ke1X
2023-03-01 14:53   ` Kevin Traynor
2023-03-15  8:20   ` [PATCH v3] " Mingjin Ye
2023-03-15 13:06     ` Zhang, Qi Z
2023-03-17  5:09     ` [PATCH v4] " Mingjin Ye
2023-03-17 10:15       ` Zhang, Qi Z
2023-03-20  9:40       ` [PATCH v5] " Mingjin Ye
2023-03-20 12:52         ` Zhang, Qi Z
2023-03-21  2:08           ` Ye, MingjinX
2023-03-21 11:55             ` Zhang, Qi Z
2023-03-21 16:24               ` Tyler Retzlaff
2023-03-22  5:56         ` [PATCH v6] " Mingjin Ye
2023-04-03  6:54           ` Zhang, Qi Z
2023-04-11  2:08           ` [PATCH v7] " Mingjin Ye
2023-05-15  6:28             ` Zhang, Qi Z
2023-05-10  9:34 Liao, TingtingX

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).