IB/mlx5: Expose correct max_sge_rd limit
[firefly-linux-kernel-4.4.55.git] / include / linux / mlx5 / device.h
index 0b473cbfa7ef10c875c1eed802c2a7dd74f415d4..a91b67b18a7308b2b25eb5abe7abf2c01ccbb5f5 100644 (file)
@@ -334,6 +334,17 @@ enum {
        MLX5_CAP_OFF_CMDIF_CSUM         = 46,
 };
 
+enum {
+       /*
+        * Max wqe size for rdma read is 512 bytes, so this
+        * limits our max_sge_rd as the wqe needs to fit:
+        * - ctrl segment (16 bytes)
+        * - rdma segment (16 bytes)
+        * - scatter elements (16 bytes each)
+        */
+       MLX5_MAX_SGE_RD = (512 - 16 - 16) / 16
+};
+
 struct mlx5_inbox_hdr {
        __be16          opcode;
        u8              rsvd[4];