- cryptodev_config = 'dev {0}'.format(
- re.sub(r'\d.\d$', '1.'+str(i), cryptodev))
- path = ['dpdk', cryptodev_config]
- self.add_config_item(self._nodeconfig, '', path)
- self.add_dpdk_uio_driver('igb_uio')
+ cryptodev_config = re.sub(r"\d.\d$", f"1.{str(i)}", cryptodev)
+ path = [u"dpdk", f"dev {cryptodev_config}"]
+ self.add_config_item(self._nodeconfig, u"", path)
+ self.add_dpdk_uio_driver(u"vfio-pci")
+
+ def add_dpdk_sw_cryptodev(self, sw_pmd_type, socket_id, count):
+ """Add DPDK SW Crypto device configuration.
+
+ :param sw_pmd_type: Type of SW crypto device PMD to add.
+ :param socket_id: Socket ID.
+ :param count: Number of SW crypto devices to add.
+ :type sw_pmd_type: str
+ :type socket_id: int
+ :type count: int
+ """
+ for _ in range(count):
+ cryptodev_config = f"vdev cryptodev_{sw_pmd_type}_pmd," \
+ f"socket_id={str(socket_id)}"
+ path = [u"dpdk", cryptodev_config]
+ self.add_config_item(self._nodeconfig, u"", path)
+
+ def add_dpdk_eth_bond_dev(self, ethbond_id, mode, xmit_policy, *slaves):
+ """Add DPDK Eth_bond device configuration.
+
+ :param ethbond_id: Eth_bond device ID.
+ :param mode: Link bonding mode.
+ :param xmit_policy: Transmission policy.
+ :param slaves: PCI device(s) to be bonded (format xxxx:xx:xx.x).
+ :type ethbond_id: str or int
+ :type mode: str or int
+ :type xmit_policy: str
+ :type slaves: list
+ """
+ slaves_config = u"slave=" + u",slave=".join(
+ slave if pci_dev_check(slave) else u"" for slave in slaves
+ )
+ ethbond_config = f"vdev eth_bond{ethbond_id}," \
+ f"mode={mode}{slaves_config},xmit_policy={xmit_policy}"
+ path = [u"dpdk", ethbond_config]
+ self.add_config_item(self._nodeconfig, u"", path)