mlx4: Expose correct max_sge_rd limit
authorSagi Grimberg <sagig@mellanox.com>
Wed, 28 Oct 2015 11:28:15 +0000 (13:28 +0200)
committerDoug Ledford <dledford@redhat.com>
Tue, 8 Dec 2015 17:42:44 +0000 (12:42 -0500)
commita5e14ba334e202c58e45ef47414ec94c585c1a8c
treeb04bac58103e9551d2107aa96295db010c5695a2
parent533708867dd6388f643f12c87465b59e732d729d
mlx4: Expose correct max_sge_rd limit

mlx4 devices (ConnectX-2, ConnectX-3) has a limitation
where rdma read work queue entries cannot exceed 512 bytes.
A rdma_read wqe needs to fit in 512 bytes:
- wqe control segment (16 bytes)
- rdma segment (16 bytes)
- scatter elements (16 bytes each)

So max_sge_rd should be: (512 - 16 - 16) / 16 = 30.

Signed-off-by: Sagi Grimberg <sagig@mellanox.com>
Reviewed-by: Steve Wise <swise@opengridcomputing.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
drivers/infiniband/hw/mlx4/main.c
include/linux/mlx4/device.h