summaryrefslogtreecommitdiffstats
path: root/linux_dpdk
diff options
context:
space:
mode:
authorHanoh Haim <hhaim@cisco.com>2017-02-27 15:06:14 +0200
committerHanoh Haim <hhaim@cisco.com>2017-02-27 15:44:33 +0200
commit636b54879f9017deb00a28eaf4ab54cf0e6455de (patch)
tree1bf25e169e2b3f461a490af1b492546931f45ffc /linux_dpdk
parente56cadaa90bcf67e874741a78ebcde477749700b (diff)
mlx5, enforce OFED 4.0
Signed-off-by: Hanoh Haim <hhaim@cisco.com>
Diffstat (limited to 'linux_dpdk')
-rwxr-xr-xlinux_dpdk/ws_main.py17
1 files changed, 13 insertions, 4 deletions
diff --git a/linux_dpdk/ws_main.py b/linux_dpdk/ws_main.py
index fba75407..a55fe6be 100755
--- a/linux_dpdk/ws_main.py
+++ b/linux_dpdk/ws_main.py
@@ -143,8 +143,11 @@ def missing_pkg_msg(fedora, ubuntu):
def check_ofed(ctx):
ctx.start_msg('Checking for OFED')
ofed_info='/usr/bin/ofed_info'
- ofed_ver= '-3.4-'
- ofed_ver_show= 'v3.4'
+
+ ofed_ver_re = re.compile('.*[-](\d)[.](\d)[-].*')
+
+ ofed_ver= 40
+ ofed_ver_show= '4.0'
if not os.path.isfile(ofed_info):
ctx.end_msg('not found', 'YELLOW')
@@ -160,8 +163,14 @@ def check_ofed(ctx):
ctx.end_msg('Expected several output lines from %s, got:\n%s' % (ofed_info, out), 'YELLOW')
return False
- if ofed_ver not in lines[0]:
- ctx.end_msg('Expected version: %s, got: %s.' % (ofed_ver, lines[0]), 'YELLOW')
+ m= ofed_ver_re.match(str(lines[0]))
+ if m:
+ ver=int(m.group(1))*10+int(m.group(2))
+ if ver < ofed_ver:
+ ctx.end_msg("installed OFED version is '%s' should be at least '%s' and up" % (lines[0],ofed_ver_show),'YELLOW')
+ return False
+ else:
+ ctx.end_msg("not found valid OFED version '%s' " % (lines[0]),'YELLOW')
return False
ctx.end_msg('Found needed version %s' % ofed_ver_show)