public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH net-next] octeontx2: cn10k: fix RX flowid TCAM mask handling
@ 2026-01-16 16:47 Alok Tiwari
  2026-01-19 11:08 ` Subbaraya Sundeep
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Alok Tiwari @ 2026-01-16 16:47 UTC (permalink / raw)
  To: sd, bbhushan2, pabeni, kuba, edumazet, davem, andrew+netdev,
	sbhatta, jerinj, hkelam, gakula, lcherian, sgoutham,
	george.cherian, netdev
  Cc: alok.a.tiwarilinux, alok.a.tiwari

The RX flowid programming initializes the TCAM mask to all ones, but
then overwrites it when clearing the MAC DA mask bits. This results
in losing the intended initialization and may affect other match fields.

Update the code to clear the MAC DA bits using an AND operation, making
the handling of mask[0] consistent with mask[1], where the field-specific
bits are cleared after initializing the mask to ~0ULL.

Signed-off-by: Alok Tiwari <alok.a.tiwari@oracle.com>
---
 drivers/net/ethernet/marvell/octeontx2/nic/cn10k_macsec.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/marvell/octeontx2/nic/cn10k_macsec.c b/drivers/net/ethernet/marvell/octeontx2/nic/cn10k_macsec.c
index 4c7e0f345cb5..060c715ebad0 100644
--- a/drivers/net/ethernet/marvell/octeontx2/nic/cn10k_macsec.c
+++ b/drivers/net/ethernet/marvell/octeontx2/nic/cn10k_macsec.c
@@ -328,7 +328,7 @@ static int cn10k_mcs_write_rx_flowid(struct otx2_nic *pfvf,
 
 	req->data[0] = FIELD_PREP(MCS_TCAM0_MAC_DA_MASK, mac_da);
 	req->mask[0] = ~0ULL;
-	req->mask[0] = ~MCS_TCAM0_MAC_DA_MASK;
+	req->mask[0] &= ~MCS_TCAM0_MAC_DA_MASK;
 
 	req->data[1] = FIELD_PREP(MCS_TCAM1_ETYPE_MASK, ETH_P_MACSEC);
 	req->mask[1] = ~0ULL;
-- 
2.50.1


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

* Re: [PATCH net-next] octeontx2: cn10k: fix RX flowid TCAM mask handling
  2026-01-16 16:47 [PATCH net-next] octeontx2: cn10k: fix RX flowid TCAM mask handling Alok Tiwari
@ 2026-01-19 11:08 ` Subbaraya Sundeep
  2026-01-19 18:12 ` Jakub Kicinski
  2026-01-19 18:20 ` patchwork-bot+netdevbpf
  2 siblings, 0 replies; 4+ messages in thread
From: Subbaraya Sundeep @ 2026-01-19 11:08 UTC (permalink / raw)
  To: Alok Tiwari
  Cc: sd, bbhushan2, pabeni, kuba, edumazet, davem, andrew+netdev,
	jerinj, hkelam, gakula, lcherian, sgoutham, george.cherian,
	netdev, alok.a.tiwarilinux

On 2026-01-16 at 22:17:12, Alok Tiwari (alok.a.tiwari@oracle.com) wrote:
> The RX flowid programming initializes the TCAM mask to all ones, but
> then overwrites it when clearing the MAC DA mask bits. This results
> in losing the intended initialization and may affect other match fields.
> 
> Update the code to clear the MAC DA bits using an AND operation, making
> the handling of mask[0] consistent with mask[1], where the field-specific
> bits are cleared after initializing the mask to ~0ULL.
> 
> Signed-off-by: Alok Tiwari <alok.a.tiwari@oracle.com>
This has no impact in functionality and it is better to be consistent with
mask[1]. Thanks for the change.

Reviewed-by: Subbaraya Sundeep <sbhatta@marvell.com>

> ---
>  drivers/net/ethernet/marvell/octeontx2/nic/cn10k_macsec.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/net/ethernet/marvell/octeontx2/nic/cn10k_macsec.c b/drivers/net/ethernet/marvell/octeontx2/nic/cn10k_macsec.c
> index 4c7e0f345cb5..060c715ebad0 100644
> --- a/drivers/net/ethernet/marvell/octeontx2/nic/cn10k_macsec.c
> +++ b/drivers/net/ethernet/marvell/octeontx2/nic/cn10k_macsec.c
> @@ -328,7 +328,7 @@ static int cn10k_mcs_write_rx_flowid(struct otx2_nic *pfvf,
>  
>  	req->data[0] = FIELD_PREP(MCS_TCAM0_MAC_DA_MASK, mac_da);
>  	req->mask[0] = ~0ULL;
> -	req->mask[0] = ~MCS_TCAM0_MAC_DA_MASK;
> +	req->mask[0] &= ~MCS_TCAM0_MAC_DA_MASK;
>  
>  	req->data[1] = FIELD_PREP(MCS_TCAM1_ETYPE_MASK, ETH_P_MACSEC);
>  	req->mask[1] = ~0ULL;
> -- 
> 2.50.1
> 

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

* Re: [PATCH net-next] octeontx2: cn10k: fix RX flowid TCAM mask handling
  2026-01-16 16:47 [PATCH net-next] octeontx2: cn10k: fix RX flowid TCAM mask handling Alok Tiwari
  2026-01-19 11:08 ` Subbaraya Sundeep
@ 2026-01-19 18:12 ` Jakub Kicinski
  2026-01-19 18:20 ` patchwork-bot+netdevbpf
  2 siblings, 0 replies; 4+ messages in thread
From: Jakub Kicinski @ 2026-01-19 18:12 UTC (permalink / raw)
  To: Alok Tiwari
  Cc: sd, bbhushan2, pabeni, edumazet, davem, andrew+netdev, sbhatta,
	jerinj, hkelam, gakula, lcherian, sgoutham, george.cherian,
	netdev, alok.a.tiwarilinux

On Fri, 16 Jan 2026 08:47:12 -0800 Alok Tiwari wrote:
> The RX flowid programming initializes the TCAM mask to all ones, but
> then overwrites it when clearing the MAC DA mask bits. This results
> in losing the intended initialization and may affect other match fields.
> 
> Update the code to clear the MAC DA bits using an AND operation, making
> the handling of mask[0] consistent with mask[1], where the field-specific
> bits are cleared after initializing the mask to ~0ULL.

In the future - if the code exists in Linus's tree the fix must have 
a Fixes tag and target net.

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

* Re: [PATCH net-next] octeontx2: cn10k: fix RX flowid TCAM mask handling
  2026-01-16 16:47 [PATCH net-next] octeontx2: cn10k: fix RX flowid TCAM mask handling Alok Tiwari
  2026-01-19 11:08 ` Subbaraya Sundeep
  2026-01-19 18:12 ` Jakub Kicinski
@ 2026-01-19 18:20 ` patchwork-bot+netdevbpf
  2 siblings, 0 replies; 4+ messages in thread
From: patchwork-bot+netdevbpf @ 2026-01-19 18:20 UTC (permalink / raw)
  To: ALOK TIWARI
  Cc: sd, bbhushan2, pabeni, kuba, edumazet, davem, andrew+netdev,
	sbhatta, jerinj, hkelam, gakula, lcherian, sgoutham,
	george.cherian, netdev, alok.a.tiwarilinux

Hello:

This patch was applied to netdev/net.git (main)
by Jakub Kicinski <kuba@kernel.org>:

On Fri, 16 Jan 2026 08:47:12 -0800 you wrote:
> The RX flowid programming initializes the TCAM mask to all ones, but
> then overwrites it when clearing the MAC DA mask bits. This results
> in losing the intended initialization and may affect other match fields.
> 
> Update the code to clear the MAC DA bits using an AND operation, making
> the handling of mask[0] consistent with mask[1], where the field-specific
> bits are cleared after initializing the mask to ~0ULL.
> 
> [...]

Here is the summary with links:
  - [net-next] octeontx2: cn10k: fix RX flowid TCAM mask handling
    https://git.kernel.org/netdev/net/c/ab9b218a1521

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



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

end of thread, other threads:[~2026-01-19 18:20 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-01-16 16:47 [PATCH net-next] octeontx2: cn10k: fix RX flowid TCAM mask handling Alok Tiwari
2026-01-19 11:08 ` Subbaraya Sundeep
2026-01-19 18:12 ` Jakub Kicinski
2026-01-19 18:20 ` patchwork-bot+netdevbpf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox