net/mlx5: check DevX to support more Verbs ports
authorXueming Li <xuemingl@nvidia.com>
Tue, 19 Oct 2021 10:35:01 +0000 (18:35 +0800)
committerRaslan Darawsheh <rasland@nvidia.com>
Thu, 21 Oct 2021 07:31:14 +0000 (09:31 +0200)
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 Verbs device link ports larger than 255.

Signed-off-by: Xueming Li <xuemingl@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
drivers/net/mlx5/linux/mlx5_os.c

index 0ab6d55..7de60ac 100644 (file)
@@ -1244,12 +1244,6 @@ err_secondary:
                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;
        /*
@@ -1700,6 +1694,11 @@ err_secondary:
                                        mlx5_rxq_ibv_obj_dummy_lb_create;
                priv->obj_ops.lb_dummy_queue_release =
                                        mlx5_rxq_ibv_obj_dummy_lb_release;
+       } else if (spawn->max_port > UINT8_MAX) {
+               /* Verbs can't support ports larger than 255 by design. */
+               DRV_LOG(ERR, "must enable DV and ESW when RDMA link ports > 255");
+               err = ENOTSUP;
+               goto error;
        } else {
                priv->obj_ops = ibv_obj_ops;
        }