[dpdk-dev] [PATCH v1 08/14] net/mlx5: check max Verbs port number
Xueming Li
xuemingl at nvidia.com
Wed Jun 16 06:09:29 CEST 2021
Verbs API doesn't support Device port number larger than 255 by design.
Adds check and fails probing with proper error log.
Signed-off-by: Xueming Li <xuemingl at nvidia.com>
---
drivers/net/mlx5/linux/mlx5_os.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/drivers/net/mlx5/linux/mlx5_os.c b/drivers/net/mlx5/linux/mlx5_os.c
index 47df3b92f8..9a3616d539 100644
--- a/drivers/net/mlx5/linux/mlx5_os.c
+++ b/drivers/net/mlx5/linux/mlx5_os.c
@@ -1168,6 +1168,12 @@ mlx5_dev_spawn(struct rte_device *dpdk_dev,
config->dv_flow_en = 0;
}
#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;
+ }
config->ind_table_max_size =
sh->device_attr.max_rwq_indirection_table_size;
/*
--
2.25.1
More information about the dev
mailing list