DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] common/cnxk: fix setting channel mask for SDP interfaces
@ 2023-11-07  6:40 psatheesh
  2023-11-07 11:48 ` [EXT] " Jerin Jacob Kollanukkaran
  0 siblings, 1 reply; 2+ messages in thread
From: psatheesh @ 2023-11-07  6:40 UTC (permalink / raw)
  To: Nithin Dabilpuram, Kiran Kumar K, Sunil Kumar Kori, Satha Rao,
	Satheesh Paul
  Cc: dev, stable

From: Satheesh Paul <psatheesh@marvell.com>

Channel mask field is incorrectly returned as 16 bits.
Fixing it by truncating to 12 bits.

Fixes: 2703f1fa3200 ("common/cnxk: fix setting channel mask for SDP interfaces")
Cc: stable@dpdk.org

Signed-off-by: Satheesh Paul <psatheesh@marvell.com>
---
 drivers/common/cnxk/roc_npc.c   | 5 +++--
 drivers/common/cnxk/roc_npc.h   | 2 ++
 drivers/common/cnxk/version.map | 1 +
 3 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/drivers/common/cnxk/roc_npc.c b/drivers/common/cnxk/roc_npc.c
index 4173dd2933..0fd1081d43 100644
--- a/drivers/common/cnxk/roc_npc.c
+++ b/drivers/common/cnxk/roc_npc.c
@@ -1439,7 +1439,7 @@ npc_inline_dev_ipsec_action_free(struct npc *npc, struct roc_npc_flow *flow)
 	return 1;
 }
 
-static void
+void
 roc_npc_sdp_channel_get(struct roc_npc *roc_npc, uint16_t *chan_base, uint16_t *chan_mask)
 {
 	struct roc_nix *roc_nix = roc_npc->roc_nix;
@@ -1454,8 +1454,9 @@ roc_npc_sdp_channel_get(struct roc_npc *roc_npc, uint16_t *chan_base, uint16_t *
 		num_bits = (sizeof(uint32_t) * 8) - plt_clz32(range) - 1;
 		/* Set mask for (15 - numbits) MSB bits */
 		*chan_mask = (uint16_t)~GENMASK(num_bits, 0);
+		*chan_mask &= 0xFFF;
 	} else {
-		*chan_mask = (uint16_t)GENMASK(15, 0);
+		*chan_mask = (uint16_t)GENMASK(11, 0);
 	}
 
 	mask = (uint16_t)GENMASK(num_bits, 0);
diff --git a/drivers/common/cnxk/roc_npc.h b/drivers/common/cnxk/roc_npc.h
index ad88cf34a4..e9870a162a 100644
--- a/drivers/common/cnxk/roc_npc.h
+++ b/drivers/common/cnxk/roc_npc.h
@@ -451,4 +451,6 @@ int __roc_api roc_npc_validate_portid_action(struct roc_npc *roc_npc_src,
 int __roc_api roc_npc_mcam_init(struct roc_npc *roc_npc, struct roc_npc_flow *flow, int mcam_id);
 int __roc_api roc_npc_mcam_move(struct roc_npc *roc_npc, uint16_t old_ent, uint16_t new_ent);
 void *__roc_api roc_npc_aged_flow_ctx_get(struct roc_npc *roc_npc, uint32_t mcam_id);
+void __roc_api roc_npc_sdp_channel_get(struct roc_npc *roc_npc, uint16_t *chan_base,
+				       uint16_t *chan_mask);
 #endif /* _ROC_NPC_H_ */
diff --git a/drivers/common/cnxk/version.map b/drivers/common/cnxk/version.map
index fffd2064be..aa884a8fe2 100644
--- a/drivers/common/cnxk/version.map
+++ b/drivers/common/cnxk/version.map
@@ -459,6 +459,7 @@ INTERNAL {
 	roc_npc_mcam_read_counter;
 	roc_npc_inl_mcam_read_counter;
 	roc_npc_profile_name_get;
+	roc_npc_sdp_channel_get;
 	roc_npc_validate_portid_action;
 	roc_ot_ipsec_inb_sa_init;
 	roc_ot_ipsec_outb_sa_init;
-- 
2.39.2


^ permalink raw reply	[flat|nested] 2+ messages in thread

* RE: [EXT] [dpdk-dev] [PATCH] common/cnxk: fix setting channel mask for SDP interfaces
  2023-11-07  6:40 [dpdk-dev] [PATCH] common/cnxk: fix setting channel mask for SDP interfaces psatheesh
@ 2023-11-07 11:48 ` Jerin Jacob Kollanukkaran
  0 siblings, 0 replies; 2+ messages in thread
From: Jerin Jacob Kollanukkaran @ 2023-11-07 11:48 UTC (permalink / raw)
  To: Satheesh Paul Antonysamy, Nithin Kumar Dabilpuram,
	Kiran Kumar Kokkilagadda, Sunil Kumar Kori,
	Satha Koteswara Rao Kottidi, Satheesh Paul Antonysamy
  Cc: dev, stable

[-- Attachment #1: Type: text/plain, Size: 1391 bytes --]

> -----Original Message-----
> From: psatheesh@marvell.com <psatheesh@marvell.com>
> Sent: Tuesday, November 7, 2023 12:10 PM
> To: Nithin Kumar Dabilpuram <ndabilpuram@marvell.com>; Kiran Kumar
> Kokkilagadda <kirankumark@marvell.com>; Sunil Kumar Kori
> <skori@marvell.com>; Satha Koteswara Rao Kottidi
> <skoteshwar@marvell.com>; Satheesh Paul Antonysamy
> <psatheesh@marvell.com>
> Cc: dev@dpdk.org; stable@dpdk.org
> Subject: [EXT] [dpdk-dev] [PATCH] common/cnxk: fix setting channel mask for
> SDP interfaces
> 
> External Email
> 
> ----------------------------------------------------------------------
> From: Satheesh Paul <psatheesh@marvell.com>
> 
> Channel mask field is incorrectly returned as 16 bits.
> Fixing it by truncating to 12 bits.
> 
> Fixes: 2703f1fa3200 ("common/cnxk: fix setting channel mask for SDP
> interfaces")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Satheesh Paul <psatheesh@marvell.com>

Updated the git commit as follows and applied to dpdk-next-net-mrvl/for-next-net. Thanks

    common/cnxk: fix SDP channel mask
		
    Channel mask field is incorrectly for SDP interface and it  
    is returning as 16 bits. Fixing it by truncating to 12 bits.
 
    Fixes: 2703f1fa3200 ("common/cnxk: fix setting channel mask for SDP interfaces")
    Cc: stable@dpdk.org

    Signed-off-by: Satheesh Paul <psatheesh@marvell.com>

[-- Attachment #2: winmail.dat --]
[-- Type: application/ms-tnef, Size: 33622 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-11-07 11:48 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-11-07  6:40 [dpdk-dev] [PATCH] common/cnxk: fix setting channel mask for SDP interfaces psatheesh
2023-11-07 11:48 ` [EXT] " Jerin Jacob Kollanukkaran

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).