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.
Showing the changes to include/linux (1 of 2 files). Show all
Unified · Split
| @@ -392,6 +392,17 @@ enum { · 391 unmodified lines | |||
| 392 | MLX5_CAP_OFF_CMDIF_CSUM = 46, | 392 | MLX5_CAP_OFF_CMDIF_CSUM = 46, |
| 393 | }; | 393 | }; |
| 394 | 394 | ||
| 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 | |||
| 395 | struct mlx5_inbox_hdr { | 406 | struct mlx5_inbox_hdr { |
| 396 | __be16 opcode; | 407 | __be16 opcode; |
| 397 | u8 rsvd[4]; | 408 | u8 rsvd[4]; |