This patch fixes the shaper rate by configuring the
user given rate in bytes. Earlier driver was considering
the user given rate value in bits.

Fixes: ac624068ee25 ("net/dpaa2: support traffic management")
Cc: sta...@dpdk.org

Signed-off-by: Gagandeep Singh <g.si...@nxp.com>
---
 drivers/net/dpaa2/dpaa2_tm.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/net/dpaa2/dpaa2_tm.c b/drivers/net/dpaa2/dpaa2_tm.c
index f91392b092..dbf66c756e 100644
--- a/drivers/net/dpaa2/dpaa2_tm.c
+++ b/drivers/net/dpaa2/dpaa2_tm.c
@@ -1,5 +1,5 @@
 /* SPDX-License-Identifier: BSD-3-Clause
- * Copyright 2020-2023 NXP
+ * Copyright 2020-2024 NXP
  */
 
 #include <rte_ethdev.h>
@@ -733,12 +733,12 @@ dpaa2_hierarchy_commit(struct rte_eth_dev *dev, int 
clear_on_fail,
                        tx_cr_shaper.max_burst_size =
                                node->profile->params.committed.size;
                        tx_cr_shaper.rate_limit =
-                               node->profile->params.committed.rate /
-                               (1024 * 1024);
+                               (node->profile->params.committed.rate /
+                               (1024 * 1024)) * 8;
                        tx_er_shaper.max_burst_size =
                                node->profile->params.peak.size;
                        tx_er_shaper.rate_limit =
-                               node->profile->params.peak.rate / (1024 * 1024);
+                               (node->profile->params.peak.rate / (1024 * 
1024)) * 8;
                        /* root node */
                        if (node->parent == NULL) {
                                DPAA2_PMD_DEBUG("LNI S.rate = %u, burst =%u",
-- 
2.25.1

Reply via email to