Skip to content

Commit

Permalink
mlx5: Adjust Crypto BSF size if signature is used
Browse files Browse the repository at this point in the history
[ Upstream commit b38f343 ]

When a Mkey is configured with crypto and signature offload, the crypto
BSF size and signature BSF size should both be set to 128 Bytes.
Currently, when building the crypto BSF, we do not take into account
if signature mode is configured or not, and we set the crypto BSF size to
64 Bytes.

The situation above does not affect crypto configuration on CX6 HCA,
but will obstruct crypto traffic in more recent HCA's such as
CX6Dx and onwards.

Thus, check if signature mode is configured when building crypto bsf,
and set the bsf size accordingly.

Fixes: b5f0a58 ("mlx5: Add crypto setter for MKey")
Signed-off-by: Maher Sanalla <msanalla@nvidia.com>
Reviewed-by: Avihai Horon <avihaih@nvidia.com>
Signed-off-by: Yishai Hadas <yishaih@nvidia.com>
Signed-off-by: Nicolas Morey-Chaisemartin <nmoreychaisemartin@suse.com>
  • Loading branch information
msanalla authored and nmorey committed Jul 19, 2022
1 parent bf04e36 commit 354ba9b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion providers/mlx5/qp.c
Original file line number Diff line number Diff line change
Expand Up @@ -2403,7 +2403,8 @@ static int mlx5_umr_fill_crypto_bsf(struct mlx5_crypto_bsf *crypto_bsf,

memset(crypto_bsf, 0, sizeof(*crypto_bsf));

crypto_bsf->bsf_size_type |= MLX5_BSF_SIZE_WITH_INLINE
crypto_bsf->bsf_size_type |= (block ? MLX5_BSF_SIZE_SIG_AND_CRYPTO :
MLX5_BSF_SIZE_WITH_INLINE)
<< MLX5_BSF_SIZE_SHIFT;
crypto_bsf->bsf_size_type |= MLX5_BSF_TYPE_CRYPTO;
order = get_crypto_order(attr->encrypt_on_tx,
Expand Down

0 comments on commit 354ba9b

Please sign in to comment.