|
| 1 | +From 33d0f922f2bed99cdab07fa8b6f60b4150845139 Mon Sep 17 00:00:00 2001 |
| 2 | + |
| 3 | +Date: Tue, 19 Apr 2022 02:09:28 +0000 |
| 4 | +Subject: [PATCH 2/6] net/iavf: refine queue rate limit configure |
| 5 | + |
| 6 | +Refine two operations when configuring queue rate limit: |
| 7 | +1. no need to stop port first, now can configure queue rate limit at |
| 8 | +runtime |
| 9 | +2. users can delete part of the queues and set new rate limit for them, |
| 10 | +but they must assign correct queue id. Otherwise, the result will be not |
| 11 | +correct. |
| 12 | + |
| 13 | +Signed-off-by: Ting Xu < [email protected]> |
| 14 | +--- |
| 15 | + drivers/net/intel/iavf/iavf_tm.c | 11 +++++++---- |
| 16 | + 1 file changed, 7 insertions(+), 4 deletions(-) |
| 17 | + |
| 18 | +diff --git a/drivers/net/intel/iavf/iavf_tm.c b/drivers/net/intel/iavf/iavf_tm.c |
| 19 | +index 1d12196ba6..67186dff67 100644 |
| 20 | +--- a/drivers/net/intel/iavf/iavf_tm.c |
| 21 | ++++ b/drivers/net/intel/iavf/iavf_tm.c |
| 22 | +@@ -810,8 +810,10 @@ static int iavf_hierarchy_commit(struct rte_eth_dev *dev, |
| 23 | + int index = 0, node_committed = 0; |
| 24 | + int i, ret_val = IAVF_SUCCESS; |
| 25 | + |
| 26 | +- /* check if port is stopped */ |
| 27 | +- if (adapter->stopped != 1) { |
| 28 | ++ /* check if port is stopped, except for setting queue bandwidth */ |
| 29 | ++ if (vf->tm_conf.nb_tc_node != 1 && |
| 30 | ++ vf->qos_cap->num_elem != 1 && |
| 31 | ++ adapter->stopped != 1) { |
| 32 | + PMD_DRV_LOG(ERR, "Please stop port first"); |
| 33 | + ret_val = IAVF_ERR_NOT_READY; |
| 34 | + goto err; |
| 35 | +@@ -862,7 +864,7 @@ static int iavf_hierarchy_commit(struct rte_eth_dev *dev, |
| 36 | + q_tc_mapping->tc[tm_node->tc].req.queue_count++; |
| 37 | + |
| 38 | + if (tm_node->shaper_profile) { |
| 39 | +- q_bw->cfg[node_committed].queue_id = node_committed; |
| 40 | ++ q_bw->cfg[node_committed].queue_id = tm_node->id; |
| 41 | + q_bw->cfg[node_committed].shaper.peak = |
| 42 | + tm_node->shaper_profile->profile.peak.rate / |
| 43 | + 1000 * IAVF_BITS_PER_BYTE; |
| 44 | +@@ -906,7 +908,8 @@ static int iavf_hierarchy_commit(struct rte_eth_dev *dev, |
| 45 | + goto fail_clear; |
| 46 | + |
| 47 | + vf->qtc_map = qtc_map; |
| 48 | +- vf->tm_conf.committed = true; |
| 49 | ++ if (adapter->stopped == 1) |
| 50 | ++ vf->tm_conf.committed = true; |
| 51 | + return ret_val; |
| 52 | + |
| 53 | + fail_clear: |
| 54 | +-- |
| 55 | +2.34.1 |
| 56 | + |
0 commit comments