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 D71F94575B; Wed, 7 Aug 2024 11:35:53 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 580654279C; Wed, 7 Aug 2024 11:34:39 +0200 (CEST) Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.16]) by mails.dpdk.org (Postfix) with ESMTP id B026040EAB for ; Wed, 7 Aug 2024 11:34:28 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1723023269; x=1754559269; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=v4HTJqytaqUI8XU8YwO92/UVR3ZX7NtTKectMp7+rrU=; b=dsdxek9iuJKvZZRvSEtNXGyroQ8+729Ly0MfXC0rYB43oEIFTulG6RqN 0LFQPMHAAG5+nKeELARoZw0NlbPnTckmU/bVgk/jar2SKwBCqP9YWS4Q1 ONGiXP+xHaKTIcmlDx5I9LVXJKsiMyH0Xk8zd+l/a7xqFPa+0V9c6/Lqp Y/w1sCu8Qobohz9MVe7FndmCtD82EUatNsdTaAr3pUh02SVw9+WLDF/l/ HOWmbSkU6gONjfn0h0enCMekNiezyDggKoj9yfHqWdmQmgJIEld6yf8f3 /ZCgnQlipYCv5ZQ0V9HTlKbnf0kHc8uOTEsvdE7SjtXRpnK8KdnNsOM9g w==; X-CSE-ConnectionGUID: Rtr4Hxk4QfKNYeUB/irxcQ== X-CSE-MsgGUID: /T4Y4vaaS4mZOcUQ9cm9Vg== X-IronPort-AV: E=McAfee;i="6700,10204,11156"; a="12897967" X-IronPort-AV: E=Sophos;i="6.09,269,1716274800"; d="scan'208";a="12897967" Received: from fmviesa001.fm.intel.com ([10.60.135.141]) by fmvoesa110.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Aug 2024 02:34:28 -0700 X-CSE-ConnectionGUID: tsj7zABHQoaxaP05E47ynA== X-CSE-MsgGUID: zsqxfKWyQoiY1a9CjfMjcQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.09,269,1716274800"; d="scan'208";a="87731047" Received: from silpixa00400562.ir.intel.com (HELO silpixa00401385.ir.intel.com) ([10.237.214.39]) by fmviesa001.fm.intel.com with ESMTP; 07 Aug 2024 02:34:28 -0700 From: Bruce Richardson To: dev@dpdk.org Cc: Bruce Richardson Subject: [PATCH 15/15] net/ice: add minimal capability reporting API Date: Wed, 7 Aug 2024 10:34:07 +0100 Message-ID: <20240807093407.452784-16-bruce.richardson@intel.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240807093407.452784-1-bruce.richardson@intel.com> References: <20240807093407.452784-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 Incomplete but reports number of available layers Signed-off-by: Bruce Richardson --- drivers/net/ice/ice_ethdev.h | 1 + drivers/net/ice/ice_tm.c | 17 +++++++++++++++++ 2 files changed, 18 insertions(+) diff --git a/drivers/net/ice/ice_ethdev.h b/drivers/net/ice/ice_ethdev.h index cb1a7e8e0d..6bebc511e4 100644 --- a/drivers/net/ice/ice_ethdev.h +++ b/drivers/net/ice/ice_ethdev.h @@ -682,6 +682,7 @@ int ice_rem_rss_cfg_wrap(struct ice_pf *pf, uint16_t vsi_id, struct ice_rss_hash_cfg *cfg); void ice_tm_conf_init(struct rte_eth_dev *dev); void ice_tm_conf_uninit(struct rte_eth_dev *dev); + extern const struct rte_tm_ops ice_tm_ops; static inline int diff --git a/drivers/net/ice/ice_tm.c b/drivers/net/ice/ice_tm.c index a86943a5b2..d7def61756 100644 --- a/drivers/net/ice/ice_tm.c +++ b/drivers/net/ice/ice_tm.c @@ -33,8 +33,12 @@ static int ice_shaper_profile_add(struct rte_eth_dev *dev, static int ice_shaper_profile_del(struct rte_eth_dev *dev, uint32_t shaper_profile_id, struct rte_tm_error *error); +static int ice_tm_capabilities_get(struct rte_eth_dev *dev, + struct rte_tm_capabilities *cap, + struct rte_tm_error *error); const struct rte_tm_ops ice_tm_ops = { + .capabilities_get = ice_tm_capabilities_get, .shaper_profile_add = ice_shaper_profile_add, .shaper_profile_delete = ice_shaper_profile_del, .node_add = ice_tm_node_add, @@ -861,3 +865,16 @@ ice_hierarchy_commit(struct rte_eth_dev *dev, PMD_DRV_LOG(DEBUG, "Time to apply hierarchy = %.1f\n", (float)time / rte_get_timer_hz()); return ret; } + +static int +ice_tm_capabilities_get(struct rte_eth_dev *dev, struct rte_tm_capabilities *cap, + struct rte_tm_error *error) +{ + struct ice_hw *hw = ICE_DEV_PRIVATE_TO_HW(dev->data->dev_private); + *cap = (struct rte_tm_capabilities){ + .n_levels_max = hw->num_tx_sched_layers - hw->port_info->has_tc, + }; + if (error) + error->type = RTE_TM_ERROR_TYPE_NONE; + return 0; +} -- 2.43.0