summaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/marvell/octeontx2/nic/cn10k_macsec.c
diff options
context:
space:
mode:
authorJoerg Roedel <jroedel@suse.de>2023-10-26 17:05:58 +0200
committerJoerg Roedel <jroedel@suse.de>2023-10-26 17:05:58 +0200
commit3613047280ec42a4e1350fdc1a6dd161ff4008cc (patch)
tree6cf2f03f518537f3229e6066a8b2638755f0bb48 /drivers/net/ethernet/marvell/octeontx2/nic/cn10k_macsec.c
parentiommu/dart: Remove the force_bypass variable (diff)
parentLinux 6.6-rc7 (diff)
downloadlinux-3613047280ec42a4e1350fdc1a6dd161ff4008cc.tar.xz
linux-3613047280ec42a4e1350fdc1a6dd161ff4008cc.zip
Merge tag 'v6.6-rc7' into core
Linux 6.6-rc7
Diffstat (limited to 'drivers/net/ethernet/marvell/octeontx2/nic/cn10k_macsec.c')
-rw-r--r--drivers/net/ethernet/marvell/octeontx2/nic/cn10k_macsec.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/drivers/net/ethernet/marvell/octeontx2/nic/cn10k_macsec.c b/drivers/net/ethernet/marvell/octeontx2/nic/cn10k_macsec.c
index 59b138214af2..6cc7a78968fc 100644
--- a/drivers/net/ethernet/marvell/octeontx2/nic/cn10k_macsec.c
+++ b/drivers/net/ethernet/marvell/octeontx2/nic/cn10k_macsec.c
@@ -1357,10 +1357,12 @@ static int cn10k_mdo_upd_txsa(struct macsec_context *ctx)
if (netif_running(secy->netdev)) {
/* Keys cannot be changed after creation */
- err = cn10k_write_tx_sa_pn(pfvf, txsc, sa_num,
- sw_tx_sa->next_pn);
- if (err)
- return err;
+ if (ctx->sa.update_pn) {
+ err = cn10k_write_tx_sa_pn(pfvf, txsc, sa_num,
+ sw_tx_sa->next_pn);
+ if (err)
+ return err;
+ }
err = cn10k_mcs_link_tx_sa2sc(pfvf, secy, txsc,
sa_num, sw_tx_sa->active);
@@ -1529,6 +1531,9 @@ static int cn10k_mdo_upd_rxsa(struct macsec_context *ctx)
if (err)
return err;
+ if (!ctx->sa.update_pn)
+ return 0;
+
err = cn10k_mcs_write_rx_sa_pn(pfvf, rxsc, sa_num,
rx_sa->next_pn);
if (err)