net/mlx5e: Remove WARN_ON when trying to offload an unsupported TLS cipher/version
authorGal Pressman <gal@nvidia.com>
Wed, 13 Jul 2022 10:57:03 +0000 (13:57 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 17 Aug 2022 12:23:35 +0000 (14:23 +0200)
[ Upstream commit 115d9f95ea7ab780ef315dc356bebba2e07cb731 ]

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: d2ead1f360e8 ("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>
drivers/net/ethernet/mellanox/mlx5/core/en_accel/ktls.c

index d93aadbf10da85f5806a247ec05b0afca06085da..90ea78239d40200f9be27cc9e0a27d5893f9ccc8 100644 (file)
@@ -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)