From patchwork Tue May 17 05:09:31 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wenjun Wu X-Patchwork-Id: 111225 X-Patchwork-Delegate: qi.z.zhang@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 EA76FA00BE; Tue, 17 May 2022 07:33:23 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id AE0F242B94; Tue, 17 May 2022 07:32:56 +0200 (CEST) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by mails.dpdk.org (Postfix) with ESMTP id 43F144282F for ; Tue, 17 May 2022 07:32:53 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1652765573; x=1684301573; h=from:to:subject:date:message-id:in-reply-to:references: mime-version:content-transfer-encoding; bh=LP2BspKTZ78hOXPYhj8xHl+dBUuZMVMUwN2X8cEKsVo=; b=cOFjvPOzwvcP4aFhwu2y0ccDdVsIqw8CeT6UYUJA8y2HqM680rG//9iM PUaGE3/LN4PDLZT7ngcfbp4W1ZL2Gb1Sb85VNv8lVIE/+CBU0OB1bLyAj vSXNh6VrIRGCA9eOTB9pxc6mmkiw9OED6WGRGOBWoh7P4YVMjNWZaNdQz uv8QYs/HpOZU8abeCyuQqKjpp8qGdwrhH0kd4JC71d+DsOnC9SPMVHncs qkoRFsgKqIETyUB8/bXfRFxS8+0rDmNCJpU2qv/F4K9TNya2OhD/0ThwP BHoLhy/Llr4RtiYLsmCcN4zzLxybgzGqXYG42UyV1oZ1+vkpGb/+bZWYH A==; X-IronPort-AV: E=McAfee;i="6400,9594,10349"; a="268645207" X-IronPort-AV: E=Sophos;i="5.91,231,1647327600"; d="scan'208";a="268645207" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 May 2022 22:32:52 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.91,231,1647327600"; d="scan'208";a="596934796" Received: from npg-wuwenjun-dpdk-01.sh.intel.com ([10.67.110.181]) by orsmga008.jf.intel.com with ESMTP; 16 May 2022 22:32:51 -0700 From: Wenjun Wu To: dev@dpdk.org, qiming.yang@intel.com, qi.z.zhang@intel.com Subject: [PATCH v11 6/7] net/ice: support queue weight configuration Date: Tue, 17 May 2022 13:09:31 +0800 Message-Id: <20220517050932.4078968-7-wenjun1.wu@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220517050932.4078968-1-wenjun1.wu@intel.com> References: <20220329014813.1092054-1-wenjun1.wu@intel.com> <20220517050932.4078968-1-wenjun1.wu@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 This patch adds queue weight configuration support. Signed-off-by: Wenjun Wu --- doc/guides/rel_notes/release_22_07.rst | 1 + drivers/net/ice/ice_tm.c | 13 +++++++++++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/doc/guides/rel_notes/release_22_07.rst b/doc/guides/rel_notes/release_22_07.rst index c5bfc52368..a0eb6ab61b 100644 --- a/doc/guides/rel_notes/release_22_07.rst +++ b/doc/guides/rel_notes/release_22_07.rst @@ -76,6 +76,7 @@ New Features * Added support for VLAN filter and offload configuration in DCF mode. * Added Tx QoS queue / queue group rate limitation configure support. * Added Tx QoS queue / queue group priority configuration support. + * Added Tx QoS queue weight configuration support. * **Updated Mellanox mlx5 driver.** diff --git a/drivers/net/ice/ice_tm.c b/drivers/net/ice/ice_tm.c index 105455f3cc..f604523ead 100644 --- a/drivers/net/ice/ice_tm.c +++ b/drivers/net/ice/ice_tm.c @@ -153,9 +153,9 @@ ice_node_param_check(struct ice_pf *pf, uint32_t node_id, return -EINVAL; } - if (weight != 1) { + if (weight > 200 || weight < 1) { error->type = RTE_TM_ERROR_TYPE_NODE_WEIGHT; - error->message = "weight must be 1"; + error->message = "weight must be between 1 and 200"; return -EINVAL; } @@ -813,6 +813,15 @@ static int ice_hierarchy_commit(struct rte_eth_dev *dev, PMD_DRV_LOG(ERR, "configure queue %u priority failed", tm_node->priority); goto fail_clear; } + + ret_val = ice_cfg_q_bw_alloc(hw->port_info, vsi->idx, + tm_node->tc, tm_node->id, + ICE_MAX_BW, (u32)tm_node->weight); + if (ret_val) { + error->type = RTE_TM_ERROR_TYPE_NODE_WEIGHT; + PMD_DRV_LOG(ERR, "configure queue %u weight failed", tm_node->weight); + goto fail_clear; + } } return ret_val;