- tool_path = self.ssh_helper.provision_tool(self.APP_NAME)
- ports_mask = 2 ** len(self.all_ports) - 1
- ports_mask_hex = hex(ports_mask)
- cpu_mask_hex = hex(ports_mask * 2)
- hw_csum = self.CSUM_MAP.get(self.nfvi_type, "--no-hw-csum")
- config_value = "".join(str((port, 0, port + 1)) for port in self.all_ports)
-
- whitelist = " -w ".join(self.bound_pci)
+ ports = self.vnfd_helper.port_pairs.all_ports
+ number_of_ports = len(ports)
+
+ tool_path = self.ssh_helper.provision_tool(tool_file=self.APP_NAME)
+ port_nums = self.vnfd_helper.port_nums(ports)
+ ports_mask_hex = hex(sum(2 ** num for num in port_nums))
+ # one core extra for master
+ cpu_mask_hex = hex(2 ** (number_of_ports + 1) - 1)
+ nfvi_context = ctx_base.Context.get_context_from_server(
+ self.scenario_helper.nodes[self.name])
+ hw_csum = ""
+ if (not self.scenario_helper.options.get('hw_csum', False) or
+ nfvi_context.attrs.get('nfvi_type') not in self.HW_OFFLOADING_NFVI_TYPES):
+ hw_csum = '--no-hw-csum'
+
+ # tuples of (FLD_PORT, FLD_QUEUE, FLD_LCORE)
+ # [--config (port,queue,lcore)[,(port,queue,lcore]]"
+ # start with lcore = 1 since we use lcore=0 for master
+ config_value = ",".join(
+ str((self.vnfd_helper.port_num(port), 0, core)).replace(" ", "") for core, port in
+ enumerate(self.vnfd_helper.port_pairs.all_ports, 1))
+
+ whitelist = " -w ".join(self.setup_helper.bound_pci)