From: Wenjun Wu Date: Tue, 17 May 2022 05:09:31 +0000 (+0800) Subject: net/ice: support queue weight configuration X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=2660b8b3290e4011e6f0dbddbd5f754c1122424c;p=dpdk.git net/ice: support queue weight configuration This patch adds queue weight configuration support. Signed-off-by: Wenjun Wu Acked-by: Qi Zhang --- diff --git a/doc/guides/rel_notes/release_22_07.rst b/doc/guides/rel_notes/release_22_07.rst index 33204229c1..2b54a09263 100644 --- a/doc/guides/rel_notes/release_22_07.rst +++ b/doc/guides/rel_notes/release_22_07.rst @@ -103,6 +103,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;