diff options
author | Sagi Grimberg <sagig@mellanox.com> | 2014-08-13 12:54:29 -0400 |
---|---|---|
committer | Roland Dreier <roland@purestorage.com> | 2014-10-09 03:10:53 -0400 |
commit | fd22f78cf7b95102d8e5b988afe27165e47471fc (patch) | |
tree | 280a55566556f024072d097481eefd66b900ecad | |
parent | b261aeafe115256c9b4589dd7bd4ca877eb0fa6c (diff) |
IB/mlx5: Use enumerations for PI copy mask
In case input and output space parameters match, we can use a copy
mask from input and output space. Use enums for those.
Signed-off-by: Sagi Grimberg <sagig@mellanox.com>
Signed-off-by: Roland Dreier <roland@purestorage.com>
-rw-r--r-- | drivers/infiniband/hw/mlx5/qp.c | 6 | ||||
-rw-r--r-- | include/linux/mlx5/qp.h | 3 |
2 files changed, 6 insertions, 3 deletions
diff --git a/drivers/infiniband/hw/mlx5/qp.c b/drivers/infiniband/hw/mlx5/qp.c index 8c574b63d77b..554410c2655d 100644 --- a/drivers/infiniband/hw/mlx5/qp.c +++ b/drivers/infiniband/hw/mlx5/qp.c | |||
@@ -2095,11 +2095,11 @@ static int mlx5_set_bsf(struct ib_mr *sig_mr, | |||
2095 | /* Same block structure */ | 2095 | /* Same block structure */ |
2096 | basic->bsf_size_sbs = 1 << 4; | 2096 | basic->bsf_size_sbs = 1 << 4; |
2097 | if (mem->sig.dif.bg_type == wire->sig.dif.bg_type) | 2097 | if (mem->sig.dif.bg_type == wire->sig.dif.bg_type) |
2098 | basic->wire.copy_byte_mask |= 0xc0; | 2098 | basic->wire.copy_byte_mask |= MLX5_CPY_GRD_MASK; |
2099 | if (mem->sig.dif.app_tag == wire->sig.dif.app_tag) | 2099 | if (mem->sig.dif.app_tag == wire->sig.dif.app_tag) |
2100 | basic->wire.copy_byte_mask |= 0x30; | 2100 | basic->wire.copy_byte_mask |= MLX5_CPY_APP_MASK; |
2101 | if (mem->sig.dif.ref_tag == wire->sig.dif.ref_tag) | 2101 | if (mem->sig.dif.ref_tag == wire->sig.dif.ref_tag) |
2102 | basic->wire.copy_byte_mask |= 0x0f; | 2102 | basic->wire.copy_byte_mask |= MLX5_CPY_REF_MASK; |
2103 | } else | 2103 | } else |
2104 | basic->wire.bs_selector = bs_selector(wire->sig.dif.pi_interval); | 2104 | basic->wire.bs_selector = bs_selector(wire->sig.dif.pi_interval); |
2105 | 2105 | ||
diff --git a/include/linux/mlx5/qp.h b/include/linux/mlx5/qp.h index 9709b30e2d69..4aa5634dc210 100644 --- a/include/linux/mlx5/qp.h +++ b/include/linux/mlx5/qp.h | |||
@@ -40,6 +40,9 @@ | |||
40 | #define MLX5_SIG_WQE_SIZE (MLX5_SEND_WQE_BB * 5) | 40 | #define MLX5_SIG_WQE_SIZE (MLX5_SEND_WQE_BB * 5) |
41 | #define MLX5_DIF_SIZE 8 | 41 | #define MLX5_DIF_SIZE 8 |
42 | #define MLX5_STRIDE_BLOCK_OP 0x400 | 42 | #define MLX5_STRIDE_BLOCK_OP 0x400 |
43 | #define MLX5_CPY_GRD_MASK 0xc0 | ||
44 | #define MLX5_CPY_APP_MASK 0x30 | ||
45 | #define MLX5_CPY_REF_MASK 0x0f | ||
43 | 46 | ||
44 | enum mlx5_qp_optpar { | 47 | enum mlx5_qp_optpar { |
45 | MLX5_QP_OPTPAR_ALT_ADDR_PATH = 1 << 0, | 48 | MLX5_QP_OPTPAR_ALT_ADDR_PATH = 1 << 0, |