netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] octeontx2-pf: macsec: Fix incorrect MTU size in TX secy policy
@ 2025-05-07 17:14 Subbaraya Sundeep
  2025-05-08 19:00 ` Simon Horman
  0 siblings, 1 reply; 3+ messages in thread
From: Subbaraya Sundeep @ 2025-05-07 17:14 UTC (permalink / raw)
  To: sd, andrew+netdev, davem, edumazet, kuba, pabeni, horms, gakula,
	hkelam, sgoutham
  Cc: netdev, Subbaraya Sundeep

Underlying real device MTU plus the L2 header length has to
be configured in TX secy policy because hardware expects the
mtu to be programmed is outgoing maximum transmission unit from
MCS block i.e, including L2 header, SecTag and ICV.

Fixes: c54ffc73601c ("octeontx2-pf: mcs: Introduce MACSEC hardware offloading")
Signed-off-by: Subbaraya Sundeep <sbhatta@marvell.com>
---
 drivers/net/ethernet/marvell/octeontx2/nic/cn10k_macsec.c | 3 ++-
 1 file changed, 2 insertions(+), 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 f3b9daf..4c7e0f3 100644
--- a/drivers/net/ethernet/marvell/octeontx2/nic/cn10k_macsec.c
+++ b/drivers/net/ethernet/marvell/octeontx2/nic/cn10k_macsec.c
@@ -531,7 +531,8 @@ static int cn10k_mcs_write_tx_secy(struct otx2_nic *pfvf,
 	if (sw_tx_sc->encrypt)
 		sectag_tci |= (MCS_TCI_E | MCS_TCI_C);
 
-	policy = FIELD_PREP(MCS_TX_SECY_PLCY_MTU, secy->netdev->mtu);
+	policy = FIELD_PREP(MCS_TX_SECY_PLCY_MTU,
+			    pfvf->netdev->mtu + OTX2_ETH_HLEN);
 	/* Write SecTag excluding AN bits(1..0) */
 	policy |= FIELD_PREP(MCS_TX_SECY_PLCY_ST_TCI, sectag_tci >> 2);
 	policy |= FIELD_PREP(MCS_TX_SECY_PLCY_ST_OFFSET, tag_offset);
-- 
2.7.4


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

* Re: [PATCH] octeontx2-pf: macsec: Fix incorrect MTU size in TX secy policy
  2025-05-07 17:14 [PATCH] octeontx2-pf: macsec: Fix incorrect MTU size in TX secy policy Subbaraya Sundeep
@ 2025-05-08 19:00 ` Simon Horman
  2025-05-09  4:42   ` Subbaraya Sundeep
  0 siblings, 1 reply; 3+ messages in thread
From: Simon Horman @ 2025-05-08 19:00 UTC (permalink / raw)
  To: Subbaraya Sundeep
  Cc: sd, andrew+netdev, davem, edumazet, kuba, pabeni, gakula, hkelam,
	sgoutham, netdev

On Wed, May 07, 2025 at 10:44:20PM +0530, Subbaraya Sundeep wrote:
> Underlying real device MTU plus the L2 header length has to
> be configured in TX secy policy because hardware expects the
> mtu to be programmed is outgoing maximum transmission unit from
> MCS block i.e, including L2 header, SecTag and ICV.

Hi Subbaraya,

I think it would be good to include an explanation of how
this bug manifests.

And please target fixes for bugs present in net at net.

Subject: [PATCH net] ...

> 
> Fixes: c54ffc73601c ("octeontx2-pf: mcs: Introduce MACSEC hardware offloading")
> Signed-off-by: Subbaraya Sundeep <sbhatta@marvell.com>

...

-- 
pw-bot: changes-requested

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

* Re: [PATCH] octeontx2-pf: macsec: Fix incorrect MTU size in TX secy policy
  2025-05-08 19:00 ` Simon Horman
@ 2025-05-09  4:42   ` Subbaraya Sundeep
  0 siblings, 0 replies; 3+ messages in thread
From: Subbaraya Sundeep @ 2025-05-09  4:42 UTC (permalink / raw)
  To: Simon Horman
  Cc: sd, andrew+netdev, davem, edumazet, kuba, pabeni, gakula, hkelam,
	sgoutham, netdev

Hi Simon,

On 2025-05-08 at 19:00:03, Simon Horman (horms@kernel.org) wrote:
> On Wed, May 07, 2025 at 10:44:20PM +0530, Subbaraya Sundeep wrote:
> > Underlying real device MTU plus the L2 header length has to
> > be configured in TX secy policy because hardware expects the
> > mtu to be programmed is outgoing maximum transmission unit from
> > MCS block i.e, including L2 header, SecTag and ICV.
> 
> Hi Subbaraya,
> 
> I think it would be good to include an explanation of how
> this bug manifests.
> 
> And please target fixes for bugs present in net at net.
> 
> Subject: [PATCH net] ...
> 
Yes I missed the net in subject. I will send v2.

Thanks,
Sundeep
> > 
> > Fixes: c54ffc73601c ("octeontx2-pf: mcs: Introduce MACSEC hardware offloading")
> > Signed-off-by: Subbaraya Sundeep <sbhatta@marvell.com>
> 
> ...
> 
> -- 
> pw-bot: changes-requested

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

end of thread, other threads:[~2025-05-09  4:42 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-05-07 17:14 [PATCH] octeontx2-pf: macsec: Fix incorrect MTU size in TX secy policy Subbaraya Sundeep
2025-05-08 19:00 ` Simon Horman
2025-05-09  4:42   ` Subbaraya Sundeep

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