History

IB/mlx5: Expose correct max_sge_rd limit

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.

Sagi Grimberg committed 10 years ago

Commit 986ef951 parent 32cc92c2 files · +12 −1Browse files

Showing the changes to include/linux (1 of 2 files). Show all

Unified · Split

include/linux/mlx5/device.h+11−0
@@ -392,6 +392,17 @@ enum { · 391 unmodified lines
392392 MLX5_CAP_OFF_CMDIF_CSUM = 46,
393393 };
394394
395+enum {
396+ /*
397+ * Max wqe size for rdma read is 512 bytes, so this
398+ * limits our max_sge_rd as the wqe needs to fit:
399+ * - ctrl segment (16 bytes)
400+ * - rdma segment (16 bytes)
401+ * - scatter elements (16 bytes each)
402+ */
403+ MLX5_MAX_SGE_RD = (512 - 16 - 16) / 16
404+};
405+
395406 struct mlx5_inbox_hdr {
396407 __be16 opcode;
397408 u8 rsvd[4];