aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLeon Romanovsky <leon@leon.nu>2016-02-11 14:09:57 -0500
committerDoug Ledford <dledford@redhat.com>2016-02-12 14:56:08 -0500
commit75c1657e1d50730dc0130a67977f7831a4e241f4 (patch)
tree053a663b70ee3fada69aa5a14d13409cfb61f31e
parent08bc327629cbd63bb2f66677e4b33b643695097c (diff)
IB/mlx5: Fix RC transport send queue overhead computation
Fix the RC QPs send queue overhead computation to take into account two additional segments in the WQE which are needed for registration operations. The ATOMIC and UMR segments can't coexist together, so chose maximum out of them. The commit 9e65dc371b5c ("IB/mlx5: Fix RC transport send queue overhead computation") was intended to update RC transport as commit messages states, but added the code to UC transport. Fixes: 9e65dc371b5c ("IB/mlx5: Fix RC transport send queue overhead computation") Signed-off-by: Kamal Heib <kamalh@mellanox.com> Signed-off-by: Leon Romanovsky <leonro@mellanox.com> Reviewed-by: Sagi Grimberg <sagig@mellanox.com> Signed-off-by: Doug Ledford <dledford@redhat.com>
-rw-r--r--drivers/infiniband/hw/mlx5/qp.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/drivers/infiniband/hw/mlx5/qp.c b/drivers/infiniband/hw/mlx5/qp.c
index 9116bc3988a6..34cb8e87c7b8 100644
--- a/drivers/infiniband/hw/mlx5/qp.c
+++ b/drivers/infiniband/hw/mlx5/qp.c
@@ -270,8 +270,10 @@ static int sq_overhead(enum ib_qp_type qp_type)
270 /* fall through */ 270 /* fall through */
271 case IB_QPT_RC: 271 case IB_QPT_RC:
272 size += sizeof(struct mlx5_wqe_ctrl_seg) + 272 size += sizeof(struct mlx5_wqe_ctrl_seg) +
273 sizeof(struct mlx5_wqe_atomic_seg) + 273 max(sizeof(struct mlx5_wqe_atomic_seg) +
274 sizeof(struct mlx5_wqe_raddr_seg); 274 sizeof(struct mlx5_wqe_raddr_seg),
275 sizeof(struct mlx5_wqe_umr_ctrl_seg) +
276 sizeof(struct mlx5_mkey_seg));
275 break; 277 break;
276 278
277 case IB_QPT_XRC_TGT: 279 case IB_QPT_XRC_TGT:
@@ -279,9 +281,9 @@ static int sq_overhead(enum ib_qp_type qp_type)
279 281
280 case IB_QPT_UC: 282 case IB_QPT_UC:
281 size += sizeof(struct mlx5_wqe_ctrl_seg) + 283 size += sizeof(struct mlx5_wqe_ctrl_seg) +
282 sizeof(struct mlx5_wqe_raddr_seg) + 284 max(sizeof(struct mlx5_wqe_raddr_seg),
283 sizeof(struct mlx5_wqe_umr_ctrl_seg) + 285 sizeof(struct mlx5_wqe_umr_ctrl_seg) +
284 sizeof(struct mlx5_mkey_seg); 286 sizeof(struct mlx5_mkey_seg));
285 break; 287 break;
286 288
287 case IB_QPT_UD: 289 case IB_QPT_UD: