mlx4 devices (ConnectX-2, ConnectX-3) can not issue max_sge in a single RDMA_READ request (resulting in a completion error). Thus, expose lower max_sge_rd to avoid this issue. Signed-off-by: Sagi Grimberg <sagig@xxxxxxxxxxxx> --- drivers/infiniband/hw/mlx4/main.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/drivers/infiniband/hw/mlx4/main.c b/drivers/infiniband/hw/mlx4/main.c index 3889723..46305dc 100644 --- a/drivers/infiniband/hw/mlx4/main.c +++ b/drivers/infiniband/hw/mlx4/main.c @@ -499,7 +499,8 @@ static int mlx4_ib_init_device_flags(struct ib_device *ibdev) ibdev->max_qp_wr = dev->dev->caps.max_wqes - MLX4_IB_SQ_MAX_SPARE; ibdev->max_sge = min(dev->dev->caps.max_sq_sg, dev->dev->caps.max_rq_sg); - ibdev->max_sge_rd = ibdev->max_sge; + /* reserve 2 sge slots for rdma reads */ + ibdev->max_sge_rd = ibdev->max_sge - 2; ibdev->max_cq = dev->dev->quotas.cq; ibdev->max_cqe = dev->dev->caps.max_cqes; ibdev->max_mr = dev->dev->quotas.mpt; -- 1.7.1 -- To unsubscribe from this list: send the line "unsubscribe target-devel" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html