aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/hw/mlx5/qp.c
diff options
context:
space:
mode:
authorSagi Grimberg <sagig@mellanox.com>2014-02-23 07:19:12 -0500
committerRoland Dreier <roland@purestorage.com>2014-03-07 14:40:04 -0500
commitd5436ba01075ef4629015f7a00914d64ffd795d6 (patch)
tree1eb91ca4b7454c86c01fa794f93250203c37023c /drivers/infiniband/hw/mlx5/qp.c
parente6631814fb3ac454fbbf47ea343c2b9508e4e1ba (diff)
IB/mlx5: Collect signature error completion
This commit takes care of the generated signature error CQE generated by the HW (if happened). The underlying mlx5 driver will handle signature error completions and will mark the relevant memory region as dirty. Once the consumer gets the completion for the transaction, it must check for signature errors on signature memory region using a new lightweight verb ib_check_mr_status(). In case the user doesn't check for signature error (i.e. doesn't call ib_check_mr_status() with status check IB_MR_CHECK_SIG_STATUS), the memory region cannot be used for another signature operation (REG_SIG_MR work request will fail). Signed-off-by: Sagi Grimberg <sagig@mellanox.com> Signed-off-by: Roland Dreier <roland@purestorage.com>
Diffstat (limited to 'drivers/infiniband/hw/mlx5/qp.c')
-rw-r--r--drivers/infiniband/hw/mlx5/qp.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/infiniband/hw/mlx5/qp.c b/drivers/infiniband/hw/mlx5/qp.c
index 67e79989b181..ae788d27b93f 100644
--- a/drivers/infiniband/hw/mlx5/qp.c
+++ b/drivers/infiniband/hw/mlx5/qp.c
@@ -1784,6 +1784,7 @@ static __be64 sig_mkey_mask(void)
1784 result = MLX5_MKEY_MASK_LEN | 1784 result = MLX5_MKEY_MASK_LEN |
1785 MLX5_MKEY_MASK_PAGE_SIZE | 1785 MLX5_MKEY_MASK_PAGE_SIZE |
1786 MLX5_MKEY_MASK_START_ADDR | 1786 MLX5_MKEY_MASK_START_ADDR |
1787 MLX5_MKEY_MASK_EN_SIGERR |
1787 MLX5_MKEY_MASK_EN_RINVAL | 1788 MLX5_MKEY_MASK_EN_RINVAL |
1788 MLX5_MKEY_MASK_KEY | 1789 MLX5_MKEY_MASK_KEY |
1789 MLX5_MKEY_MASK_LR | 1790 MLX5_MKEY_MASK_LR |
@@ -2219,13 +2220,14 @@ static void set_sig_mkey_segment(struct mlx5_mkey_seg *seg,
2219{ 2220{
2220 struct ib_mr *sig_mr = wr->wr.sig_handover.sig_mr; 2221 struct ib_mr *sig_mr = wr->wr.sig_handover.sig_mr;
2221 u32 sig_key = sig_mr->rkey; 2222 u32 sig_key = sig_mr->rkey;
2223 u8 sigerr = to_mmr(sig_mr)->sig->sigerr_count & 1;
2222 2224
2223 memset(seg, 0, sizeof(*seg)); 2225 memset(seg, 0, sizeof(*seg));
2224 2226
2225 seg->flags = get_umr_flags(wr->wr.sig_handover.access_flags) | 2227 seg->flags = get_umr_flags(wr->wr.sig_handover.access_flags) |
2226 MLX5_ACCESS_MODE_KLM; 2228 MLX5_ACCESS_MODE_KLM;
2227 seg->qpn_mkey7_0 = cpu_to_be32((sig_key & 0xff) | 0xffffff00); 2229 seg->qpn_mkey7_0 = cpu_to_be32((sig_key & 0xff) | 0xffffff00);
2228 seg->flags_pd = cpu_to_be32(MLX5_MKEY_REMOTE_INVAL | 2230 seg->flags_pd = cpu_to_be32(MLX5_MKEY_REMOTE_INVAL | sigerr << 26 |
2229 MLX5_MKEY_BSF_EN | pdn); 2231 MLX5_MKEY_BSF_EN | pdn);
2230 seg->len = cpu_to_be64(length); 2232 seg->len = cpu_to_be64(length);
2231 seg->xlt_oct_size = cpu_to_be32(be16_to_cpu(get_klm_octo(nelements))); 2233 seg->xlt_oct_size = cpu_to_be32(be16_to_cpu(get_klm_octo(nelements)));
@@ -2255,7 +2257,8 @@ static int set_sig_umr_wr(struct ib_send_wr *wr, struct mlx5_ib_qp *qp,
2255 if (unlikely(wr->num_sge != 1) || 2257 if (unlikely(wr->num_sge != 1) ||
2256 unlikely(wr->wr.sig_handover.access_flags & 2258 unlikely(wr->wr.sig_handover.access_flags &
2257 IB_ACCESS_REMOTE_ATOMIC) || 2259 IB_ACCESS_REMOTE_ATOMIC) ||
2258 unlikely(!sig_mr->sig) || unlikely(!qp->signature_en)) 2260 unlikely(!sig_mr->sig) || unlikely(!qp->signature_en) ||
2261 unlikely(!sig_mr->sig->sig_status_checked))
2259 return -EINVAL; 2262 return -EINVAL;
2260 2263
2261 /* length of the protected region, data + protection */ 2264 /* length of the protected region, data + protection */
@@ -2286,6 +2289,7 @@ static int set_sig_umr_wr(struct ib_send_wr *wr, struct mlx5_ib_qp *qp,
2286 if (ret) 2289 if (ret)
2287 return ret; 2290 return ret;
2288 2291
2292 sig_mr->sig->sig_status_checked = false;
2289 return 0; 2293 return 0;
2290} 2294}
2291 2295