Skip to content

Commit 74573e3

Browse files
raed-salemkuba-moo
authored andcommitted
net/mlx5e: Fix macsec rx security association (SA) update/delete
The cited commit adds the support for update/delete MACsec Rx SA, naturally, these operations need to check if the SA in question exists to update/delete the SA and return error code otherwise, however they do just the opposite i.e. return with error if the SA exists Fix by change the check to return error in case the SA in question does not exist, adjust error message and code accordingly. Fixes: aae3454 ("net/mlx5e: Add MACsec offload Rx command support") Signed-off-by: Raed Salem <[email protected]> Signed-off-by: Saeed Mahameed <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent d3ecf03 commit 74573e3

File tree

1 file changed

+6
-6
lines changed
  • drivers/net/ethernet/mellanox/mlx5/core/en_accel

1 file changed

+6
-6
lines changed

drivers/net/ethernet/mellanox/mlx5/core/en_accel/macsec.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -999,11 +999,11 @@ static int mlx5e_macsec_upd_rxsa(struct macsec_context *ctx)
999999
}
10001000

10011001
rx_sa = rx_sc->rx_sa[assoc_num];
1002-
if (rx_sa) {
1002+
if (!rx_sa) {
10031003
netdev_err(ctx->netdev,
1004-
"MACsec offload rx_sc sci %lld rx_sa %d already exist\n",
1004+
"MACsec offload rx_sc sci %lld rx_sa %d doesn't exist\n",
10051005
sci, assoc_num);
1006-
err = -EEXIST;
1006+
err = -EINVAL;
10071007
goto out;
10081008
}
10091009

@@ -1055,11 +1055,11 @@ static int mlx5e_macsec_del_rxsa(struct macsec_context *ctx)
10551055
}
10561056

10571057
rx_sa = rx_sc->rx_sa[assoc_num];
1058-
if (rx_sa) {
1058+
if (!rx_sa) {
10591059
netdev_err(ctx->netdev,
1060-
"MACsec offload rx_sc sci %lld rx_sa %d already exist\n",
1060+
"MACsec offload rx_sc sci %lld rx_sa %d doesn't exist\n",
10611061
sci, assoc_num);
1062-
err = -EEXIST;
1062+
err = -EINVAL;
10631063
goto out;
10641064
}
10651065

0 commit comments

Comments
 (0)