[4/8] net/mlx5: check DevX to support more Verb ports
Checks
Commit Message
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@nvidia.com>
---
drivers/net/mlx5/linux/mlx5_os.c | 13 ++++++++++---
1 file changed, 10 insertions(+), 3 deletions(-)
@@ -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;