[dpdk-dev] [PATCH 4/8] net/mlx5: check DevX to support more Verb ports

Xueming Li xuemingl at nvidia.com
Mon Sep 27 10:32:52 CEST 2021


Verbs API doesn't support device port number larger than 255 by design.

To support more VF or SubFunction port representors, forces DevX api
check when max ports larger than 255.

Signed-off-by: Xueming Li <xuemingl at nvidia.com>
---
 drivers/net/mlx5/linux/mlx5_os.c | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)

diff --git a/drivers/net/mlx5/linux/mlx5_os.c b/drivers/net/mlx5/linux/mlx5_os.c
index 79ab789df43..e9256ad5245 100644
--- a/drivers/net/mlx5/linux/mlx5_os.c
+++ b/drivers/net/mlx5/linux/mlx5_os.c
@@ -1344,9 +1344,16 @@ mlx5_dev_spawn(struct rte_device *dpdk_dev,
 #endif
 	if (spawn->max_port > UINT8_MAX) {
 		/* Verbs can't support ports larger than 255 by design. */
-		DRV_LOG(ERR, "can't support IB ports > UINT8_MAX");
-		err = EINVAL;
-		goto error;
+#ifdef HAVE_MLX5DV_DEVX_UAR_OFFSET
+		if (!config->dv_flow_en || !config->dv_esw_en) {
+			DRV_LOG(INFO, "must enable DV and ESW when IB ports > 255");
+#else
+		{
+			DRV_LOG(ERR, "DevX does not provide UAR offset, can't support IB ports > UINT8_MAX");
+#endif
+			err = EINVAL;
+			goto error;
+		}
 	}
 	config->ind_table_max_size =
 		sh->device_attr.max_rwq_indirection_table_size;
-- 
2.33.0



More information about the dev mailing list