From patchwork Thu Mar 7 08:42:27 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Saeed Mahameed X-Patchwork-Id: 13585212 X-Patchwork-Delegate: kuba@kernel.org Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id ADB9D83CA8 for ; Thu, 7 Mar 2024 08:42:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709800970; cv=none; b=RWokE5SJZsvws3p1BG05tzSdGIZEoPWsevgDkPZfmgjUsC7DRa6lPdzEhigLnO+lEDgxpBuBGYB2ecFxfYfBXX5zkF3rsDrfiOkfV8eOUHewhRNMzSsUfS0d95zWO1tXw0Hu7EJ/c34lqV7zY6P+Q3k+IM9zzNyWk6yvcMstruI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709800970; c=relaxed/simple; bh=LByt4fDpvLI3yHzi5uT7STPE49xcc8ESEhlPMZSXQHc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=tzffcfhuB5a7ry3Z8IC88MkldRIHHtz3hooM83tgjl7ngTzjCUtCJgJwmhUa6bj9gRtkJazAX6s9rdirB51Ux0JqvqxdsXZRjiwJkskHNH9mZs5PSdB5D2vaGbTvDmyxu62JCrZZ0O2ukuIACi5zGO8HrfLx2ys3kuzDKdWFebk= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=hUXlBqGH; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="hUXlBqGH" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1E87DC433C7; Thu, 7 Mar 2024 08:42:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1709800970; bh=LByt4fDpvLI3yHzi5uT7STPE49xcc8ESEhlPMZSXQHc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=hUXlBqGH1Bfrgt6O7hY94/rajV7ECcEnDK5Tc1Nt79QSo3kxUEpQLwdGqt92qFES+ vo9epSVXZK6T0I+wymArOH8PTGVVUBp/RQ9vq6/LFCpjb23q2eEp41HpCuRTn+25cl wXh7x2LsIsvvVBBk46qGvBRWbr/aKhzMqeII/YbK4i+lBI28chQY58JN0oP80hL9m9 Wj9moH34Ey/J54IeowXMxIK1hQaOd+7vD/J+ppGbr3ETrusJdUfo0CP/SOfA5b/nQb QjD1BOI24KIwwxH6WED/llf5w+qljLuOpIKuJa2bC4Yh3yFTlbiEhsxee4RcK6/Pod g55ns9PRyeFuA== From: Saeed Mahameed To: "David S. Miller" , Jakub Kicinski , Paolo Abeni , Eric Dumazet Cc: Saeed Mahameed , netdev@vger.kernel.org, Tariq Toukan , Gal Pressman , Leon Romanovsky Subject: [net-next V6 13/15] net/mlx5e: Block TLS device offload on combined SD netdev Date: Thu, 7 Mar 2024 00:42:27 -0800 Message-ID: <20240307084229.500776-14-saeed@kernel.org> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240307084229.500776-1-saeed@kernel.org> References: <20240307084229.500776-1-saeed@kernel.org> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Patchwork-Delegate: kuba@kernel.org From: Tariq Toukan 1) Each TX TLS device offloaded context has its own TIS object. Extra work is needed to get it working in a SD environment, where a stream can move between different SQs (belonging to different mdevs). 2) Each RX TLS device offloaded context needs a DEK object from the DEK pool. Extra work is needed to get it working in a SD environment, as the DEK pool currently falsely depends on TX cap, and is on the primary device only. Disallow this combination for now. Signed-off-by: Tariq Toukan Reviewed-by: Gal Pressman Signed-off-by: Saeed Mahameed --- drivers/net/ethernet/mellanox/mlx5/core/en_accel/ktls.c | 2 +- drivers/net/ethernet/mellanox/mlx5/core/en_accel/ktls.h | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_accel/ktls.c b/drivers/net/ethernet/mellanox/mlx5/core/en_accel/ktls.c index 984fa04bd331..e3e57c849436 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en_accel/ktls.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_accel/ktls.c @@ -96,7 +96,7 @@ bool mlx5e_is_ktls_rx(struct mlx5_core_dev *mdev) { u8 max_sq_wqebbs = mlx5e_get_max_sq_wqebbs(mdev); - if (is_kdump_kernel() || !MLX5_CAP_GEN(mdev, tls_rx)) + if (is_kdump_kernel() || !MLX5_CAP_GEN(mdev, tls_rx) || mlx5_get_sd(mdev)) return false; /* Check the possibility to post the required ICOSQ WQEs. */ diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_accel/ktls.h b/drivers/net/ethernet/mellanox/mlx5/core/en_accel/ktls.h index f11075e67658..adc6d8ea0960 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en_accel/ktls.h +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_accel/ktls.h @@ -11,6 +11,7 @@ #ifdef CONFIG_MLX5_EN_TLS #include "lib/crypto.h" +#include "lib/mlx5.h" struct mlx5_crypto_dek *mlx5_ktls_create_key(struct mlx5_crypto_dek_pool *dek_pool, struct tls_crypto_info *crypto_info); @@ -61,7 +62,8 @@ void mlx5e_ktls_rx_resync_destroy_resp_list(struct mlx5e_ktls_resync_resp *resp_ static inline bool mlx5e_is_ktls_tx(struct mlx5_core_dev *mdev) { - return !is_kdump_kernel() && MLX5_CAP_GEN(mdev, tls_tx); + return !is_kdump_kernel() && MLX5_CAP_GEN(mdev, tls_tx) && + !mlx5_get_sd(mdev); } bool mlx5e_is_ktls_rx(struct mlx5_core_dev *mdev);