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: aae3454e4d
("net/mlx5e: Add MACsec offload Rx command support")
Signed-off-by: Raed Salem <raeds@nvidia.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
Link: https://lore.kernel.org/r/20221026135153.154807-14-saeed@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
parent
d3ecf03756
commit
74573e38e9
@ -999,11 +999,11 @@ static int mlx5e_macsec_upd_rxsa(struct macsec_context *ctx)
|
||||
}
|
||||
|
||||
rx_sa = rx_sc->rx_sa[assoc_num];
|
||||
if (rx_sa) {
|
||||
if (!rx_sa) {
|
||||
netdev_err(ctx->netdev,
|
||||
"MACsec offload rx_sc sci %lld rx_sa %d already exist\n",
|
||||
"MACsec offload rx_sc sci %lld rx_sa %d doesn't exist\n",
|
||||
sci, assoc_num);
|
||||
err = -EEXIST;
|
||||
err = -EINVAL;
|
||||
goto out;
|
||||
}
|
||||
|
||||
@ -1055,11 +1055,11 @@ static int mlx5e_macsec_del_rxsa(struct macsec_context *ctx)
|
||||
}
|
||||
|
||||
rx_sa = rx_sc->rx_sa[assoc_num];
|
||||
if (rx_sa) {
|
||||
if (!rx_sa) {
|
||||
netdev_err(ctx->netdev,
|
||||
"MACsec offload rx_sc sci %lld rx_sa %d already exist\n",
|
||||
"MACsec offload rx_sc sci %lld rx_sa %d doesn't exist\n",
|
||||
sci, assoc_num);
|
||||
err = -EEXIST;
|
||||
err = -EINVAL;
|
||||
goto out;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user