summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHanoh Haim <hhaim@cisco.com>2017-02-07 18:13:15 +0200
committerIdo Barnea <ibarnea@cisco.com>2017-02-13 12:32:26 +0200
commit0d83d222c256cff715072db9880ee2166e0d0675 (patch)
tree7df8694801233a15d50f16497618d1a27a1e7c65
parent2fdda58490659a0f924c95e4c325b8fd2fcecad0 (diff)
OFED version at least 3.4.1, 4.0.0 would be valid
Signed-off-by: Hanoh Haim <hhaim@cisco.com>
-rwxr-xr-xscripts/dpdk_setup_ports.py16
1 files changed, 13 insertions, 3 deletions
diff --git a/scripts/dpdk_setup_ports.py b/scripts/dpdk_setup_ports.py
index 34f2ef8a..751a71bd 100755
--- a/scripts/dpdk_setup_ports.py
+++ b/scripts/dpdk_setup_ports.py
@@ -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.'