From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 9A92341C3C; Wed, 8 Feb 2023 09:44:53 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 8332E40141; Wed, 8 Feb 2023 09:44:53 +0100 (CET) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by mails.dpdk.org (Postfix) with ESMTP id DA677400D6 for ; Wed, 8 Feb 2023 09:44:51 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1675845892; x=1707381892; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=fK2KRqCxR9mOndoaQf/FJ12B++TMJEnlJEcleJnr71c=; b=C7hQxbGPxfDPtR2Vr8fa7RzFsjACgXBKTtXQC70ulDOPhbC23PpQ/hIk PnIUXwKBq33zBw6k8Y+N0Viqg5SUZFzpyzC6WHPst+WAkXcUHvohICoeu HKGneb59J8H2bGf3zA6ckJW2a7T5U5PxnaiGamEfJvzLTl0nZ7XAYGQBW k/FQNXo9BcacjJz2E8IC+d2WA+FeuIEzUAZNJBY77MxXBrvkumiS1dfT4 +J2CnufgmzgfUxHgY5honezXH5DGgFbpPOVpQG22GDPgxmVekvo9mgKdS wL1RC4D+hTt7ubgpiHrdPKATonuMtnC7EtEQpV5DA8IXWnZrZ0W3UiFjo A==; X-IronPort-AV: E=McAfee;i="6500,9779,10614"; a="357134042" X-IronPort-AV: E=Sophos;i="5.97,280,1669104000"; d="scan'208";a="357134042" Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Feb 2023 00:44:51 -0800 X-IronPort-AV: E=McAfee;i="6500,9779,10614"; a="996055044" X-IronPort-AV: E=Sophos;i="5.97,280,1669104000"; d="scan'208";a="996055044" Received: from unknown (HELO localhost.localdomain) ([10.239.252.104]) by fmsmga005-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Feb 2023 00:44:49 -0800 From: Ke Zhang To: qi.z.zhang@intel.com, qiming.yang@intel.com, dev@dpdk.org Cc: Ke Zhang Subject: [PATCH] net/ice: fix ice dcf contrl thread crash Date: Wed, 8 Feb 2023 16:30:05 +0800 Message-Id: <20230208083005.290571-1-ke1x.zhang@intel.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org 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 --- 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