* [PATCH v2 05/19] common/cnxk: fix inline device API
[not found] ` <20251013065949.200414-1-ndabilpuram@marvell.com>
@ 2025-10-13 6:59 ` Nithin Dabilpuram
2025-10-13 6:59 ` [PATCH v2 12/19] common/cnxk: fix max number of SQB bufs in clean up Nithin Dabilpuram
` (3 subsequent siblings)
4 siblings, 0 replies; 5+ messages in thread
From: Nithin Dabilpuram @ 2025-10-13 6:59 UTC (permalink / raw)
To: Nithin Dabilpuram, Kiran Kumar K, Sunil Kumar Kori, Satha Rao,
Harman Kalra
Cc: jerinj, dev, Monendra Singh Kushwaha, stable
From: Monendra Singh Kushwaha <kmonendra@marvell.com>
This patch fixes the inline device functions to work
when roc_nix is NULL.
Fixes: f81ee7133b48 ("common/cnxk: support inline SA context invalidate")
Cc: stable@dpdk.org
Signed-off-by: Monendra Singh Kushwaha <kmonendra@marvell.com>
---
drivers/common/cnxk/roc_nix_inl.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/common/cnxk/roc_nix_inl.c b/drivers/common/cnxk/roc_nix_inl.c
index c7637ddbdc..a5fc33b5c9 100644
--- a/drivers/common/cnxk/roc_nix_inl.c
+++ b/drivers/common/cnxk/roc_nix_inl.c
@@ -2324,7 +2324,7 @@ roc_nix_inl_ctx_write(struct roc_nix *roc_nix, void *sa_dptr, void *sa_cptr,
if (outb_lf == NULL)
goto exit;
- if (roc_model_is_cn10k() || roc_nix->use_write_sa) {
+ if (roc_model_is_cn10k() || (roc_nix && roc_nix->use_write_sa)) {
rbase = outb_lf->rbase;
flush.u = 0;
--
2.34.1
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH v2 12/19] common/cnxk: fix max number of SQB bufs in clean up
[not found] ` <20251013065949.200414-1-ndabilpuram@marvell.com>
2025-10-13 6:59 ` [PATCH v2 05/19] common/cnxk: fix inline device API Nithin Dabilpuram
@ 2025-10-13 6:59 ` Nithin Dabilpuram
2025-10-13 6:59 ` [PATCH v2 16/19] common/cnxk: fix null SQ access Nithin Dabilpuram
` (2 subsequent siblings)
4 siblings, 0 replies; 5+ messages in thread
From: Nithin Dabilpuram @ 2025-10-13 6:59 UTC (permalink / raw)
To: Nithin Dabilpuram, Kiran Kumar K, Sunil Kumar Kori, Satha Rao,
Harman Kalra
Cc: jerinj, dev, stable
From: Sunil Kumar Kori <skori@marvell.com>
By default, SQB pool is created with max (512 buffers) +
extra threshold buffers and aura limit is set to 512 + thr.
But while clean up, aura limit is reset to MAX (512 buffers)
only before destroying the pool.
Hence while destroying the pool, only 512 buffers are cleaned
from aura and extra threshold buffers are left as it is.
At later stage if same SQB pool is created then H/W
throws error for extra threshold buffers that it is already
in pool.
Fixes: 780f90e951a5 ("common/cnxk: restore NIX SQB pool limit before destroy")
Cc: stable@dpdk.org
Signed-off-by: Sunil Kumar Kori <skori@marvell.com>
---
drivers/common/cnxk/roc_nix_queue.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/common/cnxk/roc_nix_queue.c b/drivers/common/cnxk/roc_nix_queue.c
index 356367624f..8737728dd5 100644
--- a/drivers/common/cnxk/roc_nix_queue.c
+++ b/drivers/common/cnxk/roc_nix_queue.c
@@ -2057,7 +2057,7 @@ roc_nix_sq_fini(struct roc_nix_sq *sq)
/* Restore limit to max SQB count that the pool was created
* for aura drain to succeed.
*/
- roc_npa_aura_limit_modify(sq->aura_handle, NIX_MAX_SQB);
+ roc_npa_aura_limit_modify(sq->aura_handle, sq->aura_sqb_bufs);
rc |= roc_npa_pool_destroy(sq->aura_handle);
plt_free(sq->fc);
plt_free(sq->sqe_mem);
--
2.34.1
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH v2 16/19] common/cnxk: fix null SQ access
[not found] ` <20251013065949.200414-1-ndabilpuram@marvell.com>
2025-10-13 6:59 ` [PATCH v2 05/19] common/cnxk: fix inline device API Nithin Dabilpuram
2025-10-13 6:59 ` [PATCH v2 12/19] common/cnxk: fix max number of SQB bufs in clean up Nithin Dabilpuram
@ 2025-10-13 6:59 ` Nithin Dabilpuram
2025-10-13 6:59 ` [PATCH v2 18/19] common/cnxk: fix error handling on inline inbound setup Nithin Dabilpuram
2025-10-13 6:59 ` [PATCH v2 19/19] drivers: fix Klocwork issues Nithin Dabilpuram
4 siblings, 0 replies; 5+ messages in thread
From: Nithin Dabilpuram @ 2025-10-13 6:59 UTC (permalink / raw)
To: Nithin Dabilpuram, Kiran Kumar K, Sunil Kumar Kori, Satha Rao,
Harman Kalra
Cc: jerinj, dev, stable
From: Satha Rao <skoteshwar@marvell.com>
Condition to check SQ is non NULL before access. Also pktio locks
are simplified while doing threshold_profile config.
Fixes: 90a903ffa6eb ("common/cnxk: split NIX TM hierarchy enable API")
Cc: stable@dpdk.org
Signed-off-by: Satha Rao <skoteshwar@marvell.com>
---
drivers/common/cnxk/roc_nix_tm_ops.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/drivers/common/cnxk/roc_nix_tm_ops.c b/drivers/common/cnxk/roc_nix_tm_ops.c
index 09d014a276..230e9b72f6 100644
--- a/drivers/common/cnxk/roc_nix_tm_ops.c
+++ b/drivers/common/cnxk/roc_nix_tm_ops.c
@@ -624,6 +624,13 @@ roc_nix_tm_hierarchy_xmit_enable(struct roc_nix *roc_nix, enum roc_nix_tm_tree t
sq_id = node->id;
sq = nix->sqs[sq_id];
+ if (!sq) {
+ plt_err("nb_rxq %d nb_txq %d sq_id %d lvl %d", nix->nb_rx_queues,
+ nix->nb_tx_queues, sq_id, node->lvl);
+ roc_nix_tm_dump(roc_nix, NULL);
+ roc_nix_dump(roc_nix, NULL);
+ return NIX_ERR_TM_INVALID_NODE;
+ }
rc = roc_nix_sq_ena_dis(sq, true);
if (rc) {
plt_err("TM sw xon failed on SQ %u, rc=%d", node->id,
--
2.34.1
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH v2 18/19] common/cnxk: fix error handling on inline inbound setup
[not found] ` <20251013065949.200414-1-ndabilpuram@marvell.com>
` (2 preceding siblings ...)
2025-10-13 6:59 ` [PATCH v2 16/19] common/cnxk: fix null SQ access Nithin Dabilpuram
@ 2025-10-13 6:59 ` Nithin Dabilpuram
2025-10-13 6:59 ` [PATCH v2 19/19] drivers: fix Klocwork issues Nithin Dabilpuram
4 siblings, 0 replies; 5+ messages in thread
From: Nithin Dabilpuram @ 2025-10-13 6:59 UTC (permalink / raw)
To: Nithin Dabilpuram, Kiran Kumar K, Sunil Kumar Kori, Satha Rao,
Harman Kalra
Cc: jerinj, dev, stable
Fix issue reported by kloc work.
Fixes: f410059baac6 ("common/cnxk: support inline inbound queue")
Cc: stable@dpdk.org
Signed-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com>
---
drivers/common/cnxk/roc_nix_inl_dev.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/common/cnxk/roc_nix_inl_dev.c b/drivers/common/cnxk/roc_nix_inl_dev.c
index 75d03c1077..38ff96334e 100644
--- a/drivers/common/cnxk/roc_nix_inl_dev.c
+++ b/drivers/common/cnxk/roc_nix_inl_dev.c
@@ -244,7 +244,7 @@ nix_inl_inb_queue_setup(struct nix_inl_dev *inl_dev, uint8_t slot_id)
if (!cpt_req) {
rc |= -ENOSPC;
} else {
- nix_req->enable = false;
+ cpt_req->enable = 0;
rc |= mbox_process(mbox);
}
cpt_cfg_fail:
--
2.34.1
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH v2 19/19] drivers: fix Klocwork issues
[not found] ` <20251013065949.200414-1-ndabilpuram@marvell.com>
` (3 preceding siblings ...)
2025-10-13 6:59 ` [PATCH v2 18/19] common/cnxk: fix error handling on inline inbound setup Nithin Dabilpuram
@ 2025-10-13 6:59 ` Nithin Dabilpuram
4 siblings, 0 replies; 5+ messages in thread
From: Nithin Dabilpuram @ 2025-10-13 6:59 UTC (permalink / raw)
To: Thomas Monjalon, Nithin Dabilpuram, Kiran Kumar K,
Sunil Kumar Kori, Satha Rao, Harman Kalra
Cc: jerinj, dev, Aarnav JP, stable
From: Aarnav JP <ajp@marvell.com>
fixed klocwork suggested issues in
cnxk component of drivers module
Fixes: db5744d3cd23 ("common/cnxk: support NIX debug for CN20K")
Fixes: 3c31a7485172 ("common/cnxk: config CPT result address for CN20K")
Fixes: 4b8eb5bd6627 ("common/cnxk: reserve CPT LF for Rx inject")
Fixes: f410059baac6 ("common/cnxk: support inline inbound queue")
Fixes: 47cca253d605 ("net/cnxk: support Rx inject")
Fixes: ac35d4bf4cd6 ("net/cnxk: support ingress meter pre-color")
Cc: stable@dpdk.org
Signed-off-by: Aarnav JP <ajp@marvell.com>
---
.mailmap | 1 +
drivers/common/cnxk/roc_nix_debug.c | 4 ++--
drivers/common/cnxk/roc_nix_inl.c | 13 ++++++-------
drivers/net/cnxk/cn10k_ethdev_sec.c | 2 ++
drivers/net/cnxk/cnxk_ethdev_mtr.c | 8 +++++++-
5 files changed, 18 insertions(+), 10 deletions(-)
diff --git a/.mailmap b/.mailmap
index 0b043cb0c0..01ede7bc2b 100644
--- a/.mailmap
+++ b/.mailmap
@@ -1,4 +1,5 @@
Aakash Sasidharan <asasidharan@marvell.com>
+Aarnav JP <ajp@marvell.com>
Aaro Koskinen <aaro.koskinen@nsn.com>
Aaron Campbell <aaron@arbor.net>
Aaron Conole <aconole@redhat.com>
diff --git a/drivers/common/cnxk/roc_nix_debug.c b/drivers/common/cnxk/roc_nix_debug.c
index f9294e693b..11994bf131 100644
--- a/drivers/common/cnxk/roc_nix_debug.c
+++ b/drivers/common/cnxk/roc_nix_debug.c
@@ -769,8 +769,8 @@ nix_lf_rq_dump(__io struct nix_cn20k_rq_ctx_s *ctx, FILE *file)
nix_dump(file, "W2: xqe_hdr_split \t\t%d\nW2: xqe_imm_copy \t\t%d",
ctx->xqe_hdr_split, ctx->xqe_imm_copy);
- nix_dump(file, "W2: band_prof_id\t\t%d\n",
- ((ctx->band_prof_id_h << 10) | ctx->band_prof_id_l));
+ nix_dump(file, "W2: band_prof_id\t\t0x%" PRIx64 "\n",
+ (uint64_t)((ctx->band_prof_id_h << 10) | ctx->band_prof_id_l));
nix_dump(file, "W2: xqe_imm_size \t\t%d\nW2: later_skip \t\t\t%d",
ctx->xqe_imm_size, ctx->later_skip);
nix_dump(file, "W2: sso_bp_ena\t\t%d\n", ctx->sso_bp_ena);
diff --git a/drivers/common/cnxk/roc_nix_inl.c b/drivers/common/cnxk/roc_nix_inl.c
index a5fc33b5c9..9135c1c172 100644
--- a/drivers/common/cnxk/roc_nix_inl.c
+++ b/drivers/common/cnxk/roc_nix_inl.c
@@ -581,7 +581,7 @@ nix_inl_reass_inb_sa_tbl_setup(struct roc_nix *roc_nix)
struct nix_inl_dev *inl_dev = NULL;
uint64_t max_sa = 1, sa_pow2_sz;
uint64_t sa_idx_w, lenm1_max;
- uint64_t res_addr_offset;
+ uint64_t res_addr_offset = 0;
uint64_t def_cptq = 0;
size_t inb_sa_sz = 1;
uint8_t profile_id;
@@ -626,12 +626,11 @@ nix_inl_reass_inb_sa_tbl_setup(struct roc_nix *roc_nix)
inl_dev = idev->nix_inl_dev;
if (inl_dev->nb_inb_cptlfs)
def_cptq = inl_dev->nix_inb_qids[inl_dev->inb_cpt_lf_id];
+ res_addr_offset = (uint64_t)(inl_dev->res_addr_offset & 0xFF) << 48;
+ if (res_addr_offset)
+ res_addr_offset |= (1UL << 56);
}
- res_addr_offset = (uint64_t)(inl_dev->res_addr_offset & 0xFF) << 48;
- if (res_addr_offset)
- res_addr_offset |= (1UL << 56);
-
lf_cfg->enable = 1;
lf_cfg->profile_id = profile_id;
lf_cfg->rx_inline_sa_base = (uintptr_t)nix->inb_sa_base[profile_id];
@@ -850,12 +849,12 @@ roc_nix_inl_inb_rx_inject_enable(struct roc_nix *roc_nix, bool inb_inl_dev)
if (inb_inl_dev) {
inl_dev = idev->nix_inl_dev;
- if (inl_dev && inl_dev->attach_cptlf && inl_dev->rx_inj_ena &&
+ if (inl_dev && inl_dev->attach_cptlf && inl_dev->rx_inj_ena && roc_nix &&
roc_nix->rx_inj_ena)
return true;
}
- return roc_nix->rx_inj_ena;
+ return roc_nix ? roc_nix->rx_inj_ena : 0;
}
uint32_t
diff --git a/drivers/net/cnxk/cn10k_ethdev_sec.c b/drivers/net/cnxk/cn10k_ethdev_sec.c
index 110630596e..5ecdc2b463 100644
--- a/drivers/net/cnxk/cn10k_ethdev_sec.c
+++ b/drivers/net/cnxk/cn10k_ethdev_sec.c
@@ -1336,6 +1336,8 @@ cn10k_eth_sec_rx_inject_config(void *device, uint16_t port_id, bool enable)
roc_idev_nix_rx_inject_set(port_id, enable);
inl_lf = roc_nix_inl_inb_inj_lf_get(nix);
+ if (!inl_lf)
+ return -ENOTSUP;
sa_base = roc_nix_inl_inb_sa_base_get(nix, dev->inb.inl_dev);
inj_cfg = &dev->inj_cfg;
diff --git a/drivers/net/cnxk/cnxk_ethdev_mtr.c b/drivers/net/cnxk/cnxk_ethdev_mtr.c
index edeca6dcc3..992e2d446e 100644
--- a/drivers/net/cnxk/cnxk_ethdev_mtr.c
+++ b/drivers/net/cnxk/cnxk_ethdev_mtr.c
@@ -1261,7 +1261,13 @@ nix_mtr_config_map(struct cnxk_meter_node *mtr, struct roc_nix_bpf_cfg *cfg)
cfg->alg = alg_map[profile->profile.alg];
cfg->lmode = profile->profile.packet_mode;
- cfg->icolor = color_map[mtr->params.default_input_color];
+ int idx = mtr->params.default_input_color;
+
+ /* Index validation */
+ if (idx >= RTE_COLORS)
+ cfg->icolor = ROC_NIX_BPF_COLOR_GREEN;
+ else
+ cfg->icolor = color_map[idx];
switch (RTE_MTR_COLOR_IN_PROTO_OUTER_IP) {
case RTE_MTR_COLOR_IN_PROTO_OUTER_IP:
--
2.34.1
^ permalink raw reply [flat|nested] 5+ messages in thread