* [PATCH 01/11] net/dpaa2: fix issue of extract buffer preparation
[not found] <20250530071344.2939434-1-g.singh@nxp.com>
@ 2025-05-30 7:13 ` Gagandeep Singh
2025-05-30 7:13 ` [PATCH 02/11] net/dpaa2: fix shaper rate Gagandeep Singh
1 sibling, 0 replies; 2+ messages in thread
From: Gagandeep Singh @ 2025-05-30 7:13 UTC (permalink / raw)
To: dev, Hemant Agrawal, Sachin Saxena, Jun Yang; +Cc: stable
From: Jun Yang <jun.yang@nxp.com>
1) The max size of extract buffer should be size of
"struct dpni_ext_set_rx_tc_dist"(488), which is greater than 256.
2) dpkg_prepare_key_cfg is responsible to clear
extract buffer before preparing.
Fixes: 25d0ae624245 ("net/dpaa2: check IOVA before sending MC command")
Cc: stable@dpdk.org
Signed-off-by: Jun Yang <jun.yang@nxp.com>
---
drivers/net/dpaa2/dpaa2_ethdev.c | 4 ++--
drivers/net/dpaa2/dpaa2_ethdev.h | 6 ++++--
2 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/drivers/net/dpaa2/dpaa2_ethdev.c b/drivers/net/dpaa2/dpaa2_ethdev.c
index c53c2d0549..c154a574ce 100644
--- a/drivers/net/dpaa2/dpaa2_ethdev.c
+++ b/drivers/net/dpaa2/dpaa2_ethdev.c
@@ -2788,7 +2788,7 @@ dpaa2_dev_init(struct rte_eth_dev *eth_dev)
/* Init fields w.r.t. classification */
memset(&priv->extract.qos_key_extract, 0,
sizeof(struct dpaa2_key_extract));
- priv->extract.qos_extract_param = rte_malloc(NULL,
+ priv->extract.qos_extract_param = rte_zmalloc(NULL,
DPAA2_EXTRACT_PARAM_MAX_SIZE,
RTE_CACHE_LINE_SIZE);
if (!priv->extract.qos_extract_param) {
@@ -2799,7 +2799,7 @@ dpaa2_dev_init(struct rte_eth_dev *eth_dev)
for (i = 0; i < MAX_TCS; i++) {
memset(&priv->extract.tc_key_extract[i], 0,
sizeof(struct dpaa2_key_extract));
- priv->extract.tc_extract_param[i] = rte_malloc(NULL,
+ priv->extract.tc_extract_param[i] = rte_zmalloc(NULL,
DPAA2_EXTRACT_PARAM_MAX_SIZE,
RTE_CACHE_LINE_SIZE);
if (!priv->extract.tc_extract_param[i]) {
diff --git a/drivers/net/dpaa2/dpaa2_ethdev.h b/drivers/net/dpaa2/dpaa2_ethdev.h
index fd3119247a..f32c31c763 100644
--- a/drivers/net/dpaa2/dpaa2_ethdev.h
+++ b/drivers/net/dpaa2/dpaa2_ethdev.h
@@ -31,7 +31,9 @@
#define MAX_DPNI 8
#define DPAA2_MAX_CHANNELS 16
-#define DPAA2_EXTRACT_PARAM_MAX_SIZE 256
+#define DPAA2_EXTRACT_PARAM_MAX_SIZE \
+ RTE_ALIGN(sizeof(struct dpni_ext_set_rx_tc_dist), 256)
+
#define DPAA2_EXTRACT_ALLOC_KEY_MAX_SIZE 256
#define DPAA2_RX_DEFAULT_NBDESC 512
@@ -60,7 +62,7 @@
#define CONG_RX_OAL 128
/* Size of the input SMMU mapped memory required by MC */
-#define DIST_PARAM_IOVA_SIZE 256
+#define DIST_PARAM_IOVA_SIZE DPAA2_EXTRACT_PARAM_MAX_SIZE
/* Enable TX Congestion control support
* default is disable
--
2.25.1
^ permalink raw reply [flat|nested] 2+ messages in thread
* [PATCH 02/11] net/dpaa2: fix shaper rate
[not found] <20250530071344.2939434-1-g.singh@nxp.com>
2025-05-30 7:13 ` [PATCH 01/11] net/dpaa2: fix issue of extract buffer preparation Gagandeep Singh
@ 2025-05-30 7:13 ` Gagandeep Singh
1 sibling, 0 replies; 2+ messages in thread
From: Gagandeep Singh @ 2025-05-30 7:13 UTC (permalink / raw)
To: dev, Hemant Agrawal, Sachin Saxena; +Cc: stable
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: stable@dpdk.org
Signed-off-by: Gagandeep Singh <g.singh@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
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2025-05-30 7:14 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <20250530071344.2939434-1-g.singh@nxp.com>
2025-05-30 7:13 ` [PATCH 01/11] net/dpaa2: fix issue of extract buffer preparation Gagandeep Singh
2025-05-30 7:13 ` [PATCH 02/11] net/dpaa2: fix shaper rate Gagandeep Singh
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).