common/cnxk: fix setting channel mask for SDP interfaces
Checks
Commit Message
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(-)
Comments
> -----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>
@@ -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);
@@ -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_ */
@@ -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;