summaryrefslogtreecommitdiffstats
path: root/VNFs
diff options
context:
space:
mode:
authorLuc Provoost <luc.provoost@gmail.com>2023-02-01 16:26:27 +0100
committerLuc Provoost <luc.provoost@gmail.com>2023-02-01 16:26:27 +0100
commit347404a0956ed949c94428a9c8fc4eb71dbc8c06 (patch)
treef081f7f8d45ba6f0bdc45fb72b72d5c67618c23e /VNFs
parent942d5e737729a030bd8f436c1c41a71911e6dd45 (diff)
Use proper DPDK EAL parameter name: --allow
The name of one of the EAL parameters has changed. Depending on the DPDK version, we need to use a different name. While building the PROX image, we need now to create a file /opt/rapid/dpdk_version that contains the DPDK version. When running runrapid.py, we will now check this file to decide if we use the old --whitelist, or the new --allow parameter name for the PCI address to be used. Signed-off-by: Luc Provoost <luc.provoost@gmail.com> Change-Id: I3e07c552d014c818138d389abce936e275108776
Diffstat (limited to 'VNFs')
-rw-r--r--VNFs/DPPD-PROX/helper-scripts/rapid/rapid_k8s_pod.py20
-rw-r--r--VNFs/DPPD-PROX/helper-scripts/rapid/rapid_machine.py2
2 files changed, 19 insertions, 3 deletions
diff --git a/VNFs/DPPD-PROX/helper-scripts/rapid/rapid_k8s_pod.py b/VNFs/DPPD-PROX/helper-scripts/rapid/rapid_k8s_pod.py
index 3a90dcb2..8ddff3bf 100644
--- a/VNFs/DPPD-PROX/helper-scripts/rapid/rapid_k8s_pod.py
+++ b/VNFs/DPPD-PROX/helper-scripts/rapid/rapid_k8s_pod.py
@@ -177,8 +177,24 @@ class Pod:
self._sriov_vf = cmd_output.split(",")[0]
self._log.debug("Using first SRIOV VF %s" % self._sriov_vf)
- self._log.info("Getting MAC address for assigned SRIOV VF %s" % self._sriov_vf)
- self._ssh_client.run_cmd("sudo /opt/rapid/port_info_app -n 4 -w %s" % self._sriov_vf)
+ # find DPDK version
+ self._log.info("Checking DPDK version for POD %s" % self._name)
+ ret = self._ssh_client.run_cmd("cat /opt/rapid/dpdk_version")
+ if ret != 0:
+ self._log.error("Failed to check DPDK version"
+ "Error %s" % self._ssh_client.get_error())
+ return -1
+ dpdk_version = self._ssh_client.get_output().decode("utf-8").rstrip()
+ self._log.debug("DPDK version %s" % dpdk_version)
+ if (dpdk_version >= '20.11.0'):
+ allow_parameter = 'allow'
+ else:
+ allow_parameter = 'pci-whitelist'
+
+ self._log.info("Getting MAC address for assigned SRIOV VF %s" % \
+ self._sriov_vf)
+ self._ssh_client.run_cmd("sudo /opt/rapid/port_info_app -n 4 \
+ --{} {}".format(allow_parameter, self._sriov_vf))
if ret != 0:
self._log.error("Failed to get MAC address!"
"Error %s" % self._ssh_client.get_error())
diff --git a/VNFs/DPPD-PROX/helper-scripts/rapid/rapid_machine.py b/VNFs/DPPD-PROX/helper-scripts/rapid/rapid_machine.py
index f00f916b..80c8793c 100644
--- a/VNFs/DPPD-PROX/helper-scripts/rapid/rapid_machine.py
+++ b/VNFs/DPPD-PROX/helper-scripts/rapid/rapid_machine.py
@@ -150,7 +150,7 @@ class RapidMachine(object):
LuaFile.write('local_ip{}="{}"\n'.format(index, dp_port['ip']))
LuaFile.write('local_hex_ip{}=convertIPToHex(local_ip{})\n'.format(index, index))
if self.vim in ['kubernetes']:
- cmd = 'pkg-config --modversion libdpdk'
+ cmd = 'cat /opt/rapid/dpdk_version'
dpdk_version = self._client.run_cmd(cmd).decode().rstrip()
if (dpdk_version >= '20.11.0'):
allow_parameter = 'allow'