OFED version at least 3.4.1, 4.0.0 would be valid
authorHanoh Haim <[email protected]>
Tue, 7 Feb 2017 16:13:15 +0000 (18:13 +0200)
committerIdo Barnea <[email protected]>
Mon, 13 Feb 2017 10:32:26 +0000 (12:32 +0200)
Signed-off-by: Hanoh Haim <[email protected]>
scripts/dpdk_setup_ports.py

index 34f2ef8..751a71b 100755 (executable)
@@ -357,7 +357,10 @@ Other network devices
 
     def check_ofed_version (self):
         ofed_info='/usr/bin/ofed_info'
-        ofed_ver= '-3.4-'
+
+        ofed_ver_re = re.compile('.*[-](\d)[.](\d)[-].*')
+
+        ofed_ver= 34
         ofed_ver_show= '3.4-1'
 
 
@@ -374,10 +377,17 @@ Other network devices
         lines=out.splitlines();
 
         if len(lines)>1:
-            if not (ofed_ver in str(lines[0])):
-                print("installed OFED version is '%s' should be at least '%s' and up" % (lines[0],ofed_ver_show))
+            m= ofed_ver_re.match(str(lines[0]))
+            if m:
+                ver=int(m.group(1))*10+int(m.group(2))
+                if ver < ofed_ver:
+                  print("installed OFED version is '%s' should be at least '%s' and up" % (lines[0],ofed_ver_show))
+                  exit(-1);
+            else:
+                print("not found valid  OFED version '%s' " % (lines[0]))
                 exit(-1);
 
+
     def verify_ofed_os(self):
         err_msg = 'Warning: Mellanox NICs where tested only with RedHat/CentOS 7.2\n'
         err_msg += 'Correct usage with other Linux distributions is not guaranteed.'