aboutsummaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorMartin Klozik <martinx.klozik@intel.com>2016-07-29 12:20:33 +0000
committerGerrit Code Review <gerrit@172.30.200.206>2016-07-29 12:20:33 +0000
commit93e3095b4d7ea6b850b81858ec7ae2c1caaf0448 (patch)
tree4482f3bb5780334d0f882a26dbc090eb94be732f /tools
parentdad35a0c7a32fcbf0e96d1f9c96597c5f5f597a7 (diff)
parent49c477226c80bbe7350ddfc77c118d0b8aee0547 (diff)
Merge "dpdk: Support of DPDK16.07-rc5 and newer"
Diffstat (limited to 'tools')
-rw-r--r--tools/networkcard.py2
-rw-r--r--tools/systeminfo.py41
2 files changed, 33 insertions, 10 deletions
diff --git a/tools/networkcard.py b/tools/networkcard.py
index c31be691..8d704fd5 100644
--- a/tools/networkcard.py
+++ b/tools/networkcard.py
@@ -249,7 +249,7 @@ def reinit_vfs(pf_pci_handle):
:param pf_pci_handle: PCI slot identifier of PF with domain part.
"""
- rte_pci_tool = os.path.join(settings.getValue('RTE_SDK'), 'tools', 'dpdk_nic_bind.py')
+ rte_pci_tool = glob.glob(os.path.join(settings.getValue('RTE_SDK'), 'tools', 'dpdk*bind.py'))[0]
for vf_nic in get_sriov_vfs_list(pf_pci_handle):
nic_driver = get_driver(vf_nic)
diff --git a/tools/systeminfo.py b/tools/systeminfo.py
index 9d8eb5cb..50dc17e0 100644
--- a/tools/systeminfo.py
+++ b/tools/systeminfo.py
@@ -223,22 +223,45 @@ def get_version(app_name):
app_git_tag = get_git_tag(S.getValue('OVS_DIR'))
elif app_name.lower() in ['dpdk', 'testpmd']:
tmp_ver = ['', '', '']
- found = False
+ dpdk_16 = False
with open(app_version_file['dpdk']) as file_:
for line in file_:
if not line.strip():
continue
+ # DPDK version < 16
if line.startswith('#define RTE_VER_MAJOR'):
- found = True
tmp_ver[0] = line.rstrip('\n').split(' ')[2]
- if line.startswith('#define RTE_VER_MINOR'):
- found = True
- tmp_ver[1] = line.rstrip('\n').split(' ')[2]
- if line.startswith('#define RTE_VER_PATCH_LEVEL'):
- found = True
+ # DPDK version < 16
+ elif line.startswith('#define RTE_VER_PATCH_LEVEL'):
tmp_ver[2] = line.rstrip('\n').split(' ')[2]
-
- if found:
+ # DPDK version < 16
+ elif line.startswith('#define RTE_VER_PATCH_RELEASE'):
+ release = line.rstrip('\n').split(' ')[2]
+ if not '16' in release:
+ tmp_ver[2] += line.rstrip('\n').split(' ')[2]
+ # DPDK all versions
+ elif line.startswith('#define RTE_VER_MINOR'):
+ if dpdk_16:
+ tmp_ver[2] = line.rstrip('\n').split(' ')[2]
+ else:
+ tmp_ver[1] = line.rstrip('\n').split(' ')[2]
+ # DPDK all versions
+ elif line.startswith('#define RTE_VER_SUFFIX'):
+ tmp_ver[2] += line.rstrip('\n').split('"')[1]
+ # DPDK version >= 16
+ elif line.startswith('#define RTE_VER_YEAR'):
+ dpdk_16 = True
+ tmp_ver[0] = line.rstrip('\n').split(' ')[2]
+ # DPDK version >= 16
+ elif line.startswith('#define RTE_VER_MONTH'):
+ tmp_ver[1] = '{:0>2}'.format(line.rstrip('\n').split(' ')[2])
+ # DPDK version >= 16
+ elif line.startswith('#define RTE_VER_RELEASE'):
+ release = line.rstrip('\n').split(' ')[2]
+ if not '16' in release:
+ tmp_ver[2] += line.rstrip('\n').split(' ')[2]
+
+ if len(tmp_ver[0]):
app_version = '.'.join(tmp_ver)
app_git_tag = get_git_tag(S.getValue('RTE_SDK'))
elif app_name.lower().startswith('qemu'):