From patchwork Mon Aug 12 15:28:05 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bruce Richardson X-Patchwork-Id: 143088 X-Patchwork-Delegate: bruce.richardson@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 6098F457A1; Mon, 12 Aug 2024 17:29:09 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 23A0440DD8; Mon, 12 Aug 2024 17:28:41 +0200 (CEST) Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.16]) by mails.dpdk.org (Postfix) with ESMTP id EBD1340B99 for ; Mon, 12 Aug 2024 17:28:34 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1723476515; x=1755012515; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=Rgp3nCjBnYGk6+bYR0XFomTHqEgLOuvbBBKSe7KP9LY=; b=aqe04+cwzxJkFk4bd9vgBbweIpEf9RgB0BN8PP5PI9yJBe23pJXnTL28 BGFB8ryyKmT9A0AAloogyOitLUEzgk+rcDtQvvVc6N8KhXofYHXH6St+w GxRjveTDSAQaboNqpO7FlS0lNRJTHxTi012MVn7lvV7pFgiCXw5FDMIQ4 ym5vg2VQdZK2v0nlszjAQhK9IG6DNIiQEpFAx3+wk9cJSp8+kLNk8RP0L aXTl9EjUXhHfDhuSLlm5yExR6Dn3+adALb+jd46Gx/z1KVNbkrIunWBB0 LNAvsMexDlK1MWXE1M36YUvBhFutmN7ystEr183HKbdo6o9DmeRfS+ODv w==; X-CSE-ConnectionGUID: 5SLEuHwnRLWP+DTxdv3T2w== X-CSE-MsgGUID: sx2EUS38ReKSofFjAtDo5A== X-IronPort-AV: E=McAfee;i="6700,10204,11162"; a="21743043" X-IronPort-AV: E=Sophos;i="6.09,283,1716274800"; d="scan'208";a="21743043" Received: from orviesa004.jf.intel.com ([10.64.159.144]) by orvoesa108.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Aug 2024 08:28:35 -0700 X-CSE-ConnectionGUID: vmdqDiUKTA6pplPERW1jjw== X-CSE-MsgGUID: 1cj5pnBkQMS+2tcKqitwSQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.09,283,1716274800"; d="scan'208";a="63222553" Received: from silpixa00400562.ir.intel.com (HELO silpixa00401385.ir.intel.com) ([10.237.214.39]) by orviesa004.jf.intel.com with ESMTP; 12 Aug 2024 08:28:34 -0700 From: Bruce Richardson To: dev@dpdk.org Cc: Bruce Richardson Subject: [PATCH v3 06/16] net/ice/base: allow init without TC class sched nodes Date: Mon, 12 Aug 2024 16:28:05 +0100 Message-ID: <20240812152815.1132697-7-bruce.richardson@intel.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240812152815.1132697-1-bruce.richardson@intel.com> References: <20240807093407.452784-1-bruce.richardson@intel.com> <20240812152815.1132697-1-bruce.richardson@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 If DCB support is disabled via DDP image, there will not be any traffic class (TC) nodes in the scheduler tree immediately above the root level. To allow the driver to work with this scenario, we allow use of the root node as a dummy TC0 node in case where there are no TC nodes in the tree. For use of any other TC other than 0 (used by default in the driver), existing behaviour of returning NULL pointer is maintained. Signed-off-by: Bruce Richardson --- drivers/net/ice/base/ice_sched.c | 6 ++++++ drivers/net/ice/base/ice_type.h | 1 + 2 files changed, 7 insertions(+) diff --git a/drivers/net/ice/base/ice_sched.c b/drivers/net/ice/base/ice_sched.c index 373c32a518..f75e5ae599 100644 --- a/drivers/net/ice/base/ice_sched.c +++ b/drivers/net/ice/base/ice_sched.c @@ -292,6 +292,10 @@ struct ice_sched_node *ice_sched_get_tc_node(struct ice_port_info *pi, u8 tc) if (!pi || !pi->root) return NULL; + /* if no TC nodes, use root as TC node 0 */ + if (pi->has_tc == 0) + return tc == 0 ? pi->root : NULL; + for (i = 0; i < pi->root->num_children; i++) if (pi->root->children[i]->tc_num == tc) return pi->root->children[i]; @@ -1306,6 +1310,8 @@ int ice_sched_init_port(struct ice_port_info *pi) ICE_AQC_ELEM_TYPE_ENTRY_POINT) hw->sw_entry_point_layer = j; + if (buf[0].generic[j].data.elem_type == ICE_AQC_ELEM_TYPE_TC) + pi->has_tc = 1; status = ice_sched_add_node(pi, j, &buf[i].generic[j], NULL); if (status) goto err_init_port; diff --git a/drivers/net/ice/base/ice_type.h b/drivers/net/ice/base/ice_type.h index 598a80155b..a70e4a8afa 100644 --- a/drivers/net/ice/base/ice_type.h +++ b/drivers/net/ice/base/ice_type.h @@ -1260,6 +1260,7 @@ struct ice_port_info { struct ice_qos_cfg qos_cfg; u8 is_vf:1; u8 is_custom_tx_enabled:1; + u8 has_tc:1; }; struct ice_switch_info {