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 ABB2F45B14; Fri, 11 Oct 2024 18:45:49 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id C005B409FA; Fri, 11 Oct 2024 18:45:34 +0200 (CEST) Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.7]) by mails.dpdk.org (Postfix) with ESMTP id 58F7940698 for ; Fri, 11 Oct 2024 18:45:31 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1728665131; x=1760201131; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=ujnuvQ9fPXluQhopGXKesJrhGL8JBtm+J/2tdlmQ2VQ=; b=FBPEJOMSXQgOmGgRw4pORMaWBxwT0pX2lzYCFuyR5ZoWrpExbcRsURfg gXW2KmBkViJmodcdboNzWNyXNsju9rlZ2VEl4LBotHBSRNs4tfDQ9tVhC tKOLz9YrtpA9mxK2kZSogSZc00oyK4B/EpDkVLBlELJd6FZJuBTlSX8y+ +AW+8JmogYNdyRIrXBVRE3ffRwSf0IudojieZhH4JgPFgDw5wPm/Uxxxz ILqmbOBdvSqzgaBQjJaGpbdwpu1R0FDJ+FTEosRAeLJhmXKeOueZeC22+ gfxo/Nm/iZkrM6Lvl9EKa3GL3bchZCJNMDyF0ZKds/zWtK5ok7LTfQMXx Q==; X-CSE-ConnectionGUID: XbjaJXkeRS2drEj1l1dIHQ== X-CSE-MsgGUID: 5SPjjtB+SIy3120MjtBJ/A== X-IronPort-AV: E=McAfee;i="6700,10204,11222"; a="53477067" X-IronPort-AV: E=Sophos;i="6.11,196,1725346800"; d="scan'208";a="53477067" Received: from fmviesa007.fm.intel.com ([10.60.135.147]) by fmvoesa101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Oct 2024 09:45:31 -0700 X-CSE-ConnectionGUID: 5LcTaMyMTpG7y4kZpZleTA== X-CSE-MsgGUID: cssXF2nrSqSChZnwZseQDg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.11,196,1725346800"; d="scan'208";a="76609333" Received: from unknown (HELO silpixa00401385.ir.intel.com) ([10.237.214.25]) by fmviesa007.fm.intel.com with ESMTP; 11 Oct 2024 09:45:30 -0700 From: Bruce Richardson To: dev@dpdk.org Cc: Bruce Richardson Subject: [PATCH 8/9] net/ice/base: allow init without TC class sched nodes Date: Fri, 11 Oct 2024 17:44:58 +0100 Message-ID: <20241011164459.1987538-9-bruce.richardson@intel.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241011164459.1987538-1-bruce.richardson@intel.com> References: <20241011164459.1987538-1-bruce.richardson@intel.com> 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 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 | 8 +++++++- drivers/net/ice/base/ice_type.h | 1 + 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/drivers/net/ice/base/ice_sched.c b/drivers/net/ice/base/ice_sched.c index 4c5c19daf3..7e255c0337 100644 --- a/drivers/net/ice/base/ice_sched.c +++ b/drivers/net/ice/base/ice_sched.c @@ -293,6 +293,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) + 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,7 +1310,9 @@ int ice_sched_init_port(struct ice_port_info *pi) if (buf[0].generic[j].data.elem_type == ICE_AQC_ELEM_TYPE_ENTRY_POINT) hw->sw_entry_point_layer = j; - + else 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 6177bf4e2a..35f832eb9f 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 { -- 2.43.0