From patchwork Mon Aug 12 15:28:14 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bruce Richardson X-Patchwork-Id: 143097 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 96A61457A1; Mon, 12 Aug 2024 17:30:08 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 325D540E4B; Mon, 12 Aug 2024 17:28:54 +0200 (CEST) Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.16]) by mails.dpdk.org (Postfix) with ESMTP id 0512F40E15 for ; Mon, 12 Aug 2024 17:28:43 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1723476524; x=1755012524; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=yZoAcxk0Ds8+hVOoaYLkwtth7DLBjQcmE1bRlTNAIoY=; b=mWux2UyMN7+8zn25roHCxcRiofyRdz0H5gwe5LctzCMs4L8MgRIfP8vf QuB+muu3BA5K6stBVgXSByaCQxnw4kzp7ub4cN2G5pouYSZTylm4iTEUC mwTPvc9NHE399BNUf4AdkxUgMk4T9ZryMEGmkMBBYyksgTQtW5je652+S 5q3YjZWqXHgMt3x5X6GA0/Tv+mzKcezD5ejd5Q8Mrlfc37XVCXJHWbJ31 B1hlgzIbRZO1RjbLzwY8a2wX6D/5MCCDdWALRvETa7HXfIEjZog+P1Nz8 6Z0tM8RwoWT6r2BFaS4e0ydNlACmw1WZWR3EdhIJTt90NKalet23Zj4kf A==; X-CSE-ConnectionGUID: ELkwZpDnSGmAojUno6ihMg== X-CSE-MsgGUID: PFjH/RZ0TguftJOugJSG0g== X-IronPort-AV: E=McAfee;i="6700,10204,11162"; a="21743061" X-IronPort-AV: E=Sophos;i="6.09,283,1716274800"; d="scan'208";a="21743061" 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:43 -0700 X-CSE-ConnectionGUID: Nle6SatpSWqOywEx2ueuwg== X-CSE-MsgGUID: D0T8HpSdQ7COEoA5Z27duw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.09,283,1716274800"; d="scan'208";a="63222617" 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:43 -0700 From: Bruce Richardson To: dev@dpdk.org Cc: Bruce Richardson Subject: [PATCH v3 15/16] net/ice: add minimal capability reporting API Date: Mon, 12 Aug 2024 16:28:14 +0100 Message-ID: <20240812152815.1132697-16-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 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 80039c8aff..3dcd091c38 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, @@ -864,3 +868,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; +}