diff options
Diffstat (limited to 'VNFs/DPPD-PROX')
-rw-r--r-- | VNFs/DPPD-PROX/helper-scripts/rapid/rapid_k8s_pod.py | 20 | ||||
-rw-r--r-- | VNFs/DPPD-PROX/helper-scripts/rapid/rapid_machine.py | 2 |
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' |