Commit 83b3bba0 authored by Leon Romanovsky's avatar Leon Romanovsky Committed by Luis Henriques

IB/mlx5: Fix RC transport send queue overhead computation

commit 75c1657e upstream.

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 9e65dc37 ("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: 9e65dc37 ("IB/mlx5: Fix RC transport send queue overhead computation")
Signed-off-by: default avatarKamal Heib <kamalh@mellanox.com>
Signed-off-by: default avatarLeon Romanovsky <leonro@mellanox.com>
Reviewed-by: default avatarSagi Grimberg <sagig@mellanox.com>
Signed-off-by: default avatarDoug Ledford <dledford@redhat.com>
Signed-off-by: default avatarLuis Henriques <luis.henriques@canonical.com>
parent b55a1e32
...@@ -207,8 +207,10 @@ static int sq_overhead(enum ib_qp_type qp_type) ...@@ -207,8 +207,10 @@ static int sq_overhead(enum ib_qp_type qp_type)
/* fall through */ /* fall through */
case IB_QPT_RC: case IB_QPT_RC:
size += sizeof(struct mlx5_wqe_ctrl_seg) + size += sizeof(struct mlx5_wqe_ctrl_seg) +
sizeof(struct mlx5_wqe_atomic_seg) + max(sizeof(struct mlx5_wqe_atomic_seg) +
sizeof(struct mlx5_wqe_raddr_seg); sizeof(struct mlx5_wqe_raddr_seg),
sizeof(struct mlx5_wqe_umr_ctrl_seg) +
sizeof(struct mlx5_mkey_seg));
break; break;
case IB_QPT_XRC_TGT: case IB_QPT_XRC_TGT:
...@@ -216,9 +218,9 @@ static int sq_overhead(enum ib_qp_type qp_type) ...@@ -216,9 +218,9 @@ static int sq_overhead(enum ib_qp_type qp_type)
case IB_QPT_UC: case IB_QPT_UC:
size += sizeof(struct mlx5_wqe_ctrl_seg) + size += sizeof(struct mlx5_wqe_ctrl_seg) +
sizeof(struct mlx5_wqe_raddr_seg) + max(sizeof(struct mlx5_wqe_raddr_seg),
sizeof(struct mlx5_wqe_umr_ctrl_seg) + sizeof(struct mlx5_wqe_umr_ctrl_seg) +
sizeof(struct mlx5_mkey_seg); sizeof(struct mlx5_mkey_seg));
break; break;
case IB_QPT_UD: case IB_QPT_UD:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment