]> git.droids-corp.org - dpdk.git/commitdiff
net/ice: support queue weight configuration
authorWenjun Wu <wenjun1.wu@intel.com>
Tue, 17 May 2022 05:09:31 +0000 (13:09 +0800)
committerQi Zhang <qi.z.zhang@intel.com>
Wed, 18 May 2022 04:23:11 +0000 (06:23 +0200)
This patch adds queue weight configuration support.

Signed-off-by: Wenjun Wu <wenjun1.wu@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
doc/guides/rel_notes/release_22_07.rst
drivers/net/ice/ice_tm.c

index 33204229c11314e8abab105b8328a12c987e8227..2b54a09263757150cc9d2db273d6420ab5b8787f 100644 (file)
@@ -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.**
 
index 105455f3ccb3fb7ca3624f47643815393235141a..f604523eadcb62bb54c0213ac11f8fa3f0353a0c 100644 (file)
@@ -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;