]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
IB/mlx5: Expose correct max_sge_rd limit
authorSagi Grimberg <sagi@grimberg.me>
Thu, 31 Mar 2016 16:03:25 +0000 (19:03 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 4 May 2016 21:49:09 +0000 (14:49 -0700)
commitf0a5cc2e6685a452ccb7002073664dd5849a6e19
treec681cbc6081e423d969c0eb48ce6afb8c5fa11d3
parent0af7d2fc9dd15f67c8fec0a817c033b0ee66e70f
IB/mlx5: Expose correct max_sge_rd limit

commit 986ef95ecdd3eb6fa29433e68faa94c7624083be upstream.

mlx5 devices (Connect-IB, ConnectX-4, ConnectX-4-LX) 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.

Reported-by: Christoph Hellwig <hch@lst.de>
Tested-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Sagi Grimberg <sagig@grimberg.me>
Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/infiniband/hw/mlx5/main.c
include/linux/mlx5/device.h