From: Marek Kasiewicz <[email protected]> Allow per-queue bandwidth rate limiting to be configured without stopping the port when only a single TC node and single QoS element are involved. This enables dynamic session management where individual queue pacing rates can be changed while other queues continue transmitting.
Also fix the queue ID assignment in the bandwidth configuration to use the actual TM node ID rather than a sequential counter index, and only mark the TM hierarchy as committed when the port is stopped to permit subsequent reconfiguration. Signed-off-by: Marek Kasiewicz <[email protected]> Signed-off-by: Dawid Wesierski <[email protected]> --- drivers/net/intel/iavf/iavf_tm.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/drivers/net/intel/iavf/iavf_tm.c b/drivers/net/intel/iavf/iavf_tm.c index 1cf7bfb106..43d7a44337 100644 --- a/drivers/net/intel/iavf/iavf_tm.c +++ b/drivers/net/intel/iavf/iavf_tm.c @@ -804,8 +804,10 @@ static int iavf_hierarchy_commit(struct rte_eth_dev *dev, int index = 0, node_committed = 0; int i, ret_val = IAVF_SUCCESS; - /* check if port is stopped */ - if (adapter->stopped != 1) { + /* check if port is stopped, except for setting queue bandwidth */ + if (vf->tm_conf.nb_tc_node != 1 && + vf->qos_cap->num_elem != 1 && + adapter->stopped != 1) { PMD_DRV_LOG(ERR, "Please stop port first"); ret_val = IAVF_ERR_NOT_READY; goto err; @@ -856,7 +858,7 @@ static int iavf_hierarchy_commit(struct rte_eth_dev *dev, q_tc_mapping->tc[tm_node->tc].req.queue_count++; if (tm_node->shaper_profile) { - q_bw->cfg[node_committed].queue_id = node_committed; + q_bw->cfg[node_committed].queue_id = tm_node->id; q_bw->cfg[node_committed].shaper.peak = tm_node->shaper_profile->profile.peak.rate / 1000 * IAVF_BITS_PER_BYTE; @@ -900,7 +902,8 @@ static int iavf_hierarchy_commit(struct rte_eth_dev *dev, goto fail_clear; vf->qtc_map = qtc_map; - vf->tm_conf.committed = true; + if (adapter->stopped == 1) + vf->tm_conf.committed = true; return ret_val; fail_clear: -- 2.47.3 --------------------------------------------------------------------- Intel Technology Poland sp. z o.o. ul. Slowackiego 173 | 80-298 Gdansk | Sad Rejonowy Gdansk Polnoc | VII Wydzial Gospodarczy Krajowego Rejestru Sadowego - KRS 101882 | NIP 957-07-52-316 | Kapital zakladowy 200.000 PLN. Spolka oswiadcza, ze posiada status duzego przedsiebiorcy w rozumieniu ustawy z dnia 8 marca 2013 r. o przeciwdzialaniu nadmiernym opoznieniom w transakcjach handlowych. Ta wiadomosc wraz z zalacznikami jest przeznaczona dla okreslonego adresata i moze zawierac informacje poufne. W razie przypadkowego otrzymania tej wiadomosci, prosimy o powiadomienie nadawcy oraz trwale jej usuniecie; jakiekolwiek przegladanie lub rozpowszechnianie jest zabronione. This e-mail and any attachments may contain confidential material for the sole use of the intended recipient(s). If you are not the intended recipient, please contact the sender and delete all copies; any review or distribution by others is strictly prohibited.

