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

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