[mvapich-discuss] [PATCH] Fix rate type for mlx5 device

Honggang LI honli at redhat.com
Tue Sep 15 05:02:14 EDT 2020


From: Honggang Li <honli at redhat.com>

The function 'mv2_get_hca_type' sets variable 'rate' with default '0'.
When the environment variable 'MV2_USE_RoCE' was set, no matter it set
to '0' or '1', the function 'get_rate' will be skipped. As result, the
'hca_type' has been set with default 'MV2_HCA_MLX_CX_SDR' for mlx5
device.

Signed-off-by: Honggang Li <honli at redhat.com>
---
 .../common/src/detect/hca/mv2_hca_detect.c         | 14 ++++++--------
 1 file changed, 6 insertions(+), 8 deletions(-)

diff --git a/src/mpid/ch3/channels/common/src/detect/hca/mv2_hca_detect.c b/src/mpid/ch3/channels/common/src/detect/hca/mv2_hca_detect.c
index 1356fae8ba55..023d72e034c6 100644
--- a/src/mpid/ch3/channels/common/src/detect/hca/mv2_hca_detect.c
+++ b/src/mpid/ch3/channels/common/src/detect/hca/mv2_hca_detect.c
@@ -478,14 +478,12 @@ mv2_hca_type mv2_get_hca_type( struct ibv_device *dev )
             return hca_type;
         }
 
-        if (!getenv("MV2_USE_RoCE")) {
-            rate = get_rate(&umad_ca);
-            if (!rate) {
-                umad_release_ca(&umad_ca);
-                umad_done();
-                last_type = hca_type;
-                return hca_type;
-            }
+        rate = get_rate(&umad_ca);
+        if (!rate) {
+            umad_release_ca(&umad_ca);
+            umad_done();
+            last_type = hca_type;
+            return hca_type;
         }
 
         umad_release_ca(&umad_ca);
-- 
2.25.4



More information about the mvapich-discuss mailing list