Skip to content

Commit

Permalink
net/mlx5e: Remove WARN_ON when trying to offload an unsupported TLS c…
Browse files Browse the repository at this point in the history
…ipher/version

[ Upstream commit 115d9f9 ]

The driver reports whether TX/RX TLS device offloads are supported, but
not which ciphers/versions, these should be handled by returning
-EOPNOTSUPP when .tls_dev_add() is called.

Remove the WARN_ON kernel trace when the driver gets a request to
offload a cipher/version that is not supported as it is expected.

Fixes: d2ead1f ("net/mlx5e: Add kTLS TX HW offload support")
Signed-off-by: Gal Pressman <gal@nvidia.com>
Reviewed-by: Tariq Toukan <tariqt@nvidia.com>
Reviewed-by: Maxim Mikityanskiy <maximmi@nvidia.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
gal-pressman authored and gregkh committed Aug 17, 2022
1 parent 22ae7f4 commit 2109cba
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/net/ethernet/mellanox/mlx5/core/en_accel/ktls.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ static int mlx5e_ktls_add(struct net_device *netdev, struct sock *sk,
struct mlx5_core_dev *mdev = priv->mdev;
int err;

if (WARN_ON(!mlx5e_ktls_type_check(mdev, crypto_info)))
if (!mlx5e_ktls_type_check(mdev, crypto_info))
return -EOPNOTSUPP;

if (direction == TLS_OFFLOAD_CTX_DIR_TX)
Expand Down

0 comments on commit 2109cba

Please sign in to comment.