Skip to contentSkip to conversation

mlx4/mlx5 RSS improvements

PATCH Applied Leon Romanovsky 2 participants 4 messages Dec 24, 2017 – Dec 28, 2017 1 message not in the archive

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

cover mlx4/mlx5 RSS improvements

Two RSS patches, Maor's patch fixes wrongly reported inner RSS capability in mlx5 and Guy provides such option for mlx4.

The patches are available in the git repository at:
git.kernel.org/pub/scm/linux/kernel/git/leon/linux-rdma.git tags/rdma-next-2017-12-24-1

Thanks
---------------------------------------

Guy Levi (1):
IB/mlx4: Add support to RSS hash for inner headers

Maor Gottlieb (1):
IB/mlx5: Report inner RSS capability

 drivers/infiniband/hw/mlx4/main.c |  6 ++++++
 drivers/infiniband/hw/mlx4/qp.c   | 14 ++++++++++++++
 drivers/infiniband/hw/mlx5/main.c |  3 ++-
 include/uapi/rdma/mlx4-abi.h      |  7 ++++---
 include/uapi/rdma/mlx5-abi.h      |  2 +-
 5 files changed, 27 insertions(+), 5 deletions(-)

--
2.15.1

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

A message that is not in the archive (sent off-list or not yet received): 20171224125125.15661-1-leon-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org

#2 lore raw

PATCH 1/2 IB/mlx4: Add support to RSS hash for inner headers

From: Guy Levi <guyle-VPRAkNaXOzVWk0Htik3J/[email protected]>

Support RSS hash for inner headers according to a new flag, MLX4_IB_RX_HASH_INNER provided by the vendor channel.

In case the flag is set, RSS hash will be done on the inner headers of VXLAN packets (which are encapsulated).
Non-encapsulated packets will be hashed according to the outer headers.

---
 drivers/infiniband/hw/mlx4/main.c |  6 ++++++
 drivers/infiniband/hw/mlx4/qp.c   | 14 ++++++++++++++
 include/uapi/rdma/mlx4-abi.h      |  7 ++++---
 3 files changed, 24 insertions(+), 3 deletions(-)
drivers/infiniband/hw/mlx4/main.c +6 -0
index 8c8a16791a3f..5695ce53fddb 100644
@@ -589,6 +589,7 @@ static int mlx4_ib_query_device(struct ib_device *ibdev,
 		if (props->rss_caps.supported_qpts) {
 			resp.rss_caps.rx_hash_function =
 				MLX4_IB_RX_HASH_FUNC_TOEPLITZ;
+
 			resp.rss_caps.rx_hash_fields_mask =
 				MLX4_IB_RX_HASH_SRC_IPV4 |
 				MLX4_IB_RX_HASH_DST_IPV4 |
@@ -598,6 +599,11 @@ static int mlx4_ib_query_device(struct ib_device *ibdev,
 				MLX4_IB_RX_HASH_DST_PORT_TCP |
 				MLX4_IB_RX_HASH_SRC_PORT_UDP |
 				MLX4_IB_RX_HASH_DST_PORT_UDP;
+
+			if (dev->dev->caps.tunnel_offload_mode ==
+			    MLX4_TUNNEL_OFFLOAD_MODE_VXLAN)
+				resp.rss_caps.rx_hash_fields_mask |=
+					MLX4_IB_RX_HASH_INNER;
 		}
 	}
 
drivers/infiniband/hw/mlx4/qp.c +14 -0
index 16dea0e3d50f..c305189eb4af 100644
@@ -722,6 +722,20 @@ static int set_qp_rss(struct mlx4_ib_dev *dev, struct mlx4_ib_rss *rss_ctx,
 		return (-EOPNOTSUPP);
 	}
 
+	if (ucmd->rx_hash_fields_mask & MLX4_IB_RX_HASH_INNER) {
+		if (dev->dev->caps.tunnel_offload_mode ==
+		    MLX4_TUNNEL_OFFLOAD_MODE_VXLAN) {
+			/*
+			 * Hash according to inner headers if exist, otherwise
+			 * according to outer headers.
+			 */
+			rss_ctx->flags |= MLX4_RSS_BY_INNER_HEADERS_IPONLY;
+		} else {
+			pr_debug("RSS Hash for inner headers isn't supported\n");
+			return (-EOPNOTSUPP);
+		}
+	}
+
 	return 0;
 }
 
include/uapi/rdma/mlx4-abi.h +4 -3
index 224b52b6279c..7f9c37346613 100644
@@ -97,8 +97,8 @@ struct mlx4_ib_create_srq_resp {
 };
 
 struct mlx4_ib_create_qp_rss {
-	__u64   rx_hash_fields_mask;
-	__u8    rx_hash_function;
+	__u64   rx_hash_fields_mask; /* Use  enum mlx4_ib_rx_hash_fields */
+	__u8    rx_hash_function; /* Use enum mlx4_ib_rx_hash_function_flags */
 	__u8    reserved[7];
 	__u8    rx_hash_key[40];
 	__u32   comp_mask;
@@ -152,7 +152,8 @@ enum mlx4_ib_rx_hash_fields {
 	MLX4_IB_RX_HASH_SRC_PORT_TCP	= 1 << 4,
 	MLX4_IB_RX_HASH_DST_PORT_TCP	= 1 << 5,
 	MLX4_IB_RX_HASH_SRC_PORT_UDP	= 1 << 6,
-	MLX4_IB_RX_HASH_DST_PORT_UDP	= 1 << 7
+	MLX4_IB_RX_HASH_DST_PORT_UDP	= 1 << 7,
+	MLX4_IB_RX_HASH_INNER		= 1ULL << 31,
 };
 
 #endif /* MLX4_ABI_USER_H */
Signature · 6 lines
2.15.1

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
#3 lore raw

PATCH 2/2 IB/mlx5: Report inner RSS capability

In reply to a message not in the archive

From: Maor Gottlieb <maorg-VPRAkNaXOzVWk0Htik3J/[email protected]>

Add missing inner RSS support capability as part of the RSS supported fields.

In addition change MLX5_RX_HASH_INNER to 1UL << 31 in order to define it as unsigned.

Fixes 309fa3470fca ("IB/mlx5: Add support for RSS on the inner packet")
---
 drivers/infiniband/hw/mlx5/main.c | 3 ++-
 include/uapi/rdma/mlx5-abi.h      | 2 +-
 2 files changed, 3 insertions(+), 2 deletions(-)
drivers/infiniband/hw/mlx5/main.c +2 -1
index 6775e440e23f..96cc51455b09 100644
@@ -682,7 +682,8 @@ static int mlx5_ib_query_device(struct ib_device *ibdev,
 						MLX5_RX_HASH_SRC_PORT_TCP |
 						MLX5_RX_HASH_DST_PORT_TCP |
 						MLX5_RX_HASH_SRC_PORT_UDP |
-						MLX5_RX_HASH_DST_PORT_UDP;
+						MLX5_RX_HASH_DST_PORT_UDP |
+						MLX5_RX_HASH_INNER;
 			resp.response_length += sizeof(resp.rss_caps);
 		}
 	} else {
include/uapi/rdma/mlx5-abi.h +1 -1
index a33e0517d3fd..062d14f07b61 100644
@@ -307,7 +307,7 @@ enum mlx5_rx_hash_fields {
 	MLX5_RX_HASH_SRC_PORT_UDP	= 1 << 6,
 	MLX5_RX_HASH_DST_PORT_UDP	= 1 << 7,
 	/* Save bits for future fields */
-	MLX5_RX_HASH_INNER		= 1 << 31
+	MLX5_RX_HASH_INNER		= (1UL << 31),
 };
 
 struct mlx5_ib_create_qp_rss {
Signature · 6 lines
2.15.1

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
#4 lore raw
In reply to a message not in the archive
Quoted 5 lines · Leon Romanovsky

Two RSS patches, Maor's patch fixes wrongly reported inner RSS capability in mlx5 and Guy provides such option for mlx4.

The patches are available in the git repository at:
git.kernel.org/pub/scm/linux/kernel/git/leon/linux-rdma.git tags/rdma-next-2017-12-24-1

Applied to for-next

Thanks,
Jason
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html