octeontx2-pf: mcs: update PN only when update_pn is true
authorRadu Pirea (NXP OSS) <radu-nicolae.pirea@oss.nxp.com>
Thu, 5 Oct 2023 18:06:34 +0000 (21:06 +0300)
committerPaolo Abeni <pabeni@redhat.com>
Tue, 10 Oct 2023 08:30:31 +0000 (10:30 +0200)
commit4dcf38ae3ca16b8872f151d46ba5ac28dd580b60
treee75e35d304d507e807950abcb9b8f4be52d6f5bb
parent0412cc846a1ef38697c3f321f9b174da91ecd3b5
octeontx2-pf: mcs: update PN only when update_pn is true

When updating SA, update the PN only when the update_pn flag is true.
Otherwise, the PN will be reset to its previous value using the
following command and this should not happen:
$ ip macsec set macsec0 tx sa 0 on

Fixes: c54ffc73601c ("octeontx2-pf: mcs: Introduce MACSEC hardware offloading")
Signed-off-by: Radu Pirea (NXP OSS) <radu-nicolae.pirea@oss.nxp.com>
Reviewed-by: Sabrina Dubroca <sd@queasysnail.net>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
drivers/net/ethernet/marvell/octeontx2/nic/cn10k_macsec.c