From patchwork Wed Aug 7 09:47:06 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bruce Richardson X-Patchwork-Id: 143001 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 52C444575B; Wed, 7 Aug 2024 11:48:52 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id E30B142D99; Wed, 7 Aug 2024 11:47:35 +0200 (CEST) Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.14]) by mails.dpdk.org (Postfix) with ESMTP id B3969427D1 for ; Wed, 7 Aug 2024 11:47:27 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1723024048; x=1754560048; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=v4HTJqytaqUI8XU8YwO92/UVR3ZX7NtTKectMp7+rrU=; b=irGbAP5ilIzLqGMNOLJTtBMGhA5fjtV0K4DZ9TJns4ROaGtoy8DN9LXR omUFGct07N5NPfqzobHYG1qLBVwxhlsmGCJg8VGlbBI/+X64KDPABVty/ xW30mHJd+0XhsVho1yF24s/7unIivgzcunw/1E3icphO/YQcH+6C44Ua1 aACmA1Enl3SbZoRKqdhYEOGKkDeZ/aqJi3XFbr/5EPa44umKuRjoJbs3M IsDBebee8KTLijFhagpSjnILsv7xI3VABfU02T9BokV+WqN4S7r5dOzns HKph38nd4lFx/iaDEWOr3Hw0KXK3RA3Defp3aseeMaCYwCQPve/2mpHmS Q==; X-CSE-ConnectionGUID: c+sIdV8CTyuPXxxADLuB/Q== X-CSE-MsgGUID: 9h4Tb0mySd+NgZtvA23HwA== X-IronPort-AV: E=McAfee;i="6700,10204,11156"; a="21257957" X-IronPort-AV: E=Sophos;i="6.09,269,1716274800"; d="scan'208";a="21257957" Received: from orviesa002.jf.intel.com ([10.64.159.142]) by fmvoesa108.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Aug 2024 02:47:27 -0700 X-CSE-ConnectionGUID: o9HLnG3bTOaQzPBr10Y4HA== X-CSE-MsgGUID: BbwpW9EeQgGnede0VhkDWA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.09,269,1716274800"; d="scan'208";a="87467411" Received: from silpixa00400562.ir.intel.com (HELO silpixa00401385.ir.intel.com) ([10.237.214.39]) by orviesa002.jf.intel.com with ESMTP; 07 Aug 2024 02:47:26 -0700 From: Bruce Richardson To: dev@dpdk.org Cc: Bruce Richardson Subject: [PATCH v2 15/15] net/ice: add minimal capability reporting API Date: Wed, 7 Aug 2024 10:47:06 +0100 Message-ID: <20240807094706.459822-16-bruce.richardson@intel.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240807094706.459822-1-bruce.richardson@intel.com> References: <20240807093407.452784-1-bruce.richardson@intel.com> <20240807094706.459822-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 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; +}