]> git.baikalelectronics.ru Git - kernel.git/commitdiff
net/mlx5e: kTLS, Fix build time constant test in RX
authorTariq Toukan <tariqt@nvidia.com>
Mon, 6 Jun 2022 18:21:10 +0000 (21:21 +0300)
committerSaeed Mahameed <saeedm@nvidia.com>
Wed, 6 Jul 2022 23:11:54 +0000 (16:11 -0700)
Use the correct constant (TLS_DRIVER_STATE_SIZE_RX) in the comparison
against the size of the private RX TLS driver context.

Fixes: c6ad9e0b50d4 ("net/mlx5e: kTLS, Add kTLS RX HW offload support")
Signed-off-by: Tariq Toukan <tariqt@nvidia.com>
Reviewed-by: Maxim Mikityanskiy <maximmi@nvidia.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
drivers/net/ethernet/mellanox/mlx5/core/en_accel/ktls_rx.c

index 0bb0633b75426dfac464bb72efb9edfd8f65661a..27483aa7be8a8e649cb69edf08a179400cfa3622 100644 (file)
@@ -231,8 +231,7 @@ mlx5e_set_ktls_rx_priv_ctx(struct tls_context *tls_ctx,
        struct mlx5e_ktls_offload_context_rx **ctx =
                __tls_driver_ctx(tls_ctx, TLS_OFFLOAD_CTX_DIR_RX);
 
-       BUILD_BUG_ON(sizeof(struct mlx5e_ktls_offload_context_rx *) >
-                    TLS_OFFLOAD_CONTEXT_SIZE_RX);
+       BUILD_BUG_ON(sizeof(priv_rx) > TLS_DRIVER_STATE_SIZE_RX);
 
        *ctx = priv_rx;
 }