From patchwork Tue Mar 29 03:06:49 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wenjun Wu X-Patchwork-Id: 108966 X-Patchwork-Delegate: qi.z.zhang@intel.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 70B26A0505; Tue, 29 Mar 2022 05:29:29 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id D993542889; Tue, 29 Mar 2022 05:29:24 +0200 (CEST) Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by mails.dpdk.org (Postfix) with ESMTP id CD9EA40691 for ; Tue, 29 Mar 2022 05:29:22 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1648524563; x=1680060563; h=from:to:subject:date:message-id:in-reply-to:references: mime-version:content-transfer-encoding; bh=xEKefMjR3h9JAESPdnQE2kx5ptBt1rR8l5zTEtJ2nDc=; b=B/bPH1ezNCn7HUJQb0JThZ08oXsTmNk7bWKn3BcfOr+WWoLmQDd+NOpu BclEJ+XlaEzqO4QF3fXE2MlG3CTXW2yVPxrjwjaEUIYtUXiliexwJ0fi2 rYlsBA4lsVzlCc0Peqc24mxVfiKsS1TiyMMIqVLs1JmBvrLknNuVWNoQK UJIEflK2IFNUXTyws8VcHtiR6dEYBT+oCiEn5lBNKcOpu6b7NiuKlexpM sEV0OpbHIW0xu2+s/hVyrm3inmDXDoZhJ8mcpkkQpB2zck75kP7dFGdNE ZWHkkJdjsYLVpRwhK9OujcQuwxvS/KWPz0XOSd74YQH1R2l0I8pdzk4vm w==; X-IronPort-AV: E=McAfee;i="6200,9189,10300"; a="259122345" X-IronPort-AV: E=Sophos;i="5.90,219,1643702400"; d="scan'208";a="259122345" Received: from orsmga006.jf.intel.com ([10.7.209.51]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Mar 2022 20:29:22 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.90,219,1643702400"; d="scan'208";a="521266520" Received: from npg-wuwenjun-dpdk-01.sh.intel.com ([10.67.110.181]) by orsmga006.jf.intel.com with ESMTP; 28 Mar 2022 20:29:21 -0700 From: Wenjun Wu To: dev@dpdk.org, qiming.yang@intel.com, qi.z.zhang@intel.com Subject: [PATCH v3 1/9] net/ice/base: fix dead lock issue when getting node from ID type Date: Tue, 29 Mar 2022 11:06:49 +0800 Message-Id: <20220329030657.1121305-2-wenjun1.wu@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220329030657.1121305-1-wenjun1.wu@intel.com> References: <20220329020308.1099471-1-wenjun1.wu@intel.com> <20220329030657.1121305-1-wenjun1.wu@intel.com> MIME-Version: 1.0 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 function ice_sched_get_node_by_id_type needs to be called with the scheduler lock held. However, the function ice_sched_get_node also requests the scheduler lock. It will cause the dead lock issue. This patch replaces function ice_sched_get_node with function ice_sched_find_node_by_teid to solve this problem. Signed-off-by: Wenjun Wu --- drivers/net/ice/base/ice_sched.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/ice/base/ice_sched.c b/drivers/net/ice/base/ice_sched.c index 2620892c9e..e697c579be 100644 --- a/drivers/net/ice/base/ice_sched.c +++ b/drivers/net/ice/base/ice_sched.c @@ -4774,12 +4774,12 @@ ice_sched_get_node_by_id_type(struct ice_port_info *pi, u32 id, case ICE_AGG_TYPE_Q: /* The current implementation allows single queue to modify */ - node = ice_sched_get_node(pi, id); + node = ice_sched_find_node_by_teid(pi->root, id); break; case ICE_AGG_TYPE_QG: /* The current implementation allows single qg to modify */ - child_node = ice_sched_get_node(pi, id); + child_node = ice_sched_find_node_by_teid(pi->root, id); if (!child_node) break; node = child_node->parent;