Skip to content

Commit

Permalink
net/mlx5: IPsec, Fix esp modify function attribute
Browse files Browse the repository at this point in the history
The function mlx5_fpga_esp_validate_xfrm_attrs is wrongly used
with negative negation as zero value indicates success but it
used as failure return value instead.

Fix by remove the unary not negation operator.

Fixes: 05564d0 ("net/mlx5: Add flow-steering commands for FPGA IPSec implementation")
Signed-off-by: Raed Salem <raeds@mellanox.com>
Reviewed-by: Boris Pismenny <borisp@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
  • Loading branch information
Raed Salem authored and Saeed Mahameed committed Feb 6, 2020
1 parent c194839 commit 0dc2c53
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/net/ethernet/mellanox/mlx5/core/fpga/ipsec.c
Original file line number Diff line number Diff line change
Expand Up @@ -1478,7 +1478,7 @@ int mlx5_fpga_esp_modify_xfrm(struct mlx5_accel_esp_xfrm *xfrm,
if (!memcmp(&xfrm->attrs, attrs, sizeof(xfrm->attrs)))
return 0;

if (!mlx5_fpga_esp_validate_xfrm_attrs(mdev, attrs)) {
if (mlx5_fpga_esp_validate_xfrm_attrs(mdev, attrs)) {
mlx5_core_warn(mdev, "Tried to create an esp with unsupported attrs\n");
return -EOPNOTSUPP;
}
Expand Down

0 comments on commit 0dc2c53

Please sign in to comment.