diff options
author | Martin Banszel <martinx.banszel@intel.com> | 2017-07-19 19:35:02 +0000 |
---|---|---|
committer | Edward MacGillivray <edward.s.macgillivray@intel.com> | 2017-09-14 15:46:38 -0700 |
commit | be6e7ed6f053a4a697af939fa0ddcd5dce54c0c8 (patch) | |
tree | 5bc4b5bed762d9d4ddf79369d3e925acf86596e2 /yardstick/benchmark/scenarios/networking | |
parent | ac0c076ffc701333aed7d65112a0f2e15fda825a (diff) |
NSB: fix port topology
Add a new PortPair class to resolve the
topology into list of public and private ports.
Before we were calculating public/private in multiple
locations and using different conventions.
In addition for all the DPDK test we need to use the DPDK
port number and no rely on interface ordering or interface naming
conventions.
We used to use xe0 -> 0, xe1 -> 1, etc. This is not the DPDK port
number.
Use the new dpdknicbind_helper class to parse the output of
dpdk-devbind.py to find the actual DPDK port number at runtime.
We then use this DPDK port number to correctly calculate the
port_mask_hex.
The port mask maps the DPDK port num (PMD ID) to the LINK ID
used in the pipeline config
We also need to make sure we only use the interfaces matched to the
topology and not use all the interfaces, because in some cases we will
have unused interfaces. In particular TRex always requires an even
number of interfaces, so for single port TRex tests we have to create
the second port and not use it.
Thus we had to modify the traffic generator stats code to only dump
stats for used ports and no unused ports.
Ixia was using interface ordering to map to Ixia ports, instead we use
the dpdk_port_num which must be hardcoded for Ixia.
Renamed traffic_profile.execute to traffic_profile.execute_traffic so
we can trace the code easier.
We pass the port used by the traffic profile to generate_samples so we
don't get stats for unused ports.
Fixed up vPE config creation and bring up issues.
Fixed up CGNAPT and UDP_Replay to work correctly.
Tested with 4-port scale-out
Change-Id: I2e4f328bff2904108081e92a4bf712333fa73869
Signed-off-by: Ross Brattain <ross.b.brattain@intel.com>
Signed-off-by: Edward MacGillivray <edward.s.macgillivray@intel.com>
Diffstat (limited to 'yardstick/benchmark/scenarios/networking')
-rw-r--r-- | yardstick/benchmark/scenarios/networking/vnf_generic.py | 53 |
1 files changed, 34 insertions, 19 deletions
diff --git a/yardstick/benchmark/scenarios/networking/vnf_generic.py b/yardstick/benchmark/scenarios/networking/vnf_generic.py index 0e6ceab6e..ada92121b 100644 --- a/yardstick/benchmark/scenarios/networking/vnf_generic.py +++ b/yardstick/benchmark/scenarios/networking/vnf_generic.py @@ -25,7 +25,6 @@ import re from itertools import chain import six -from operator import itemgetter from collections import defaultdict from yardstick.benchmark.scenarios import base @@ -134,6 +133,7 @@ class NetworkServiceTestCase(base.Scenario): self.vnfs = [] self.collector = None self.traffic_profile = None + self.node_netdevs = {} def _get_ip_flow_range(self, ip_start_range): @@ -168,15 +168,17 @@ class NetworkServiceTestCase(base.Scenario): def _get_traffic_flow(self): flow = {} try: + # TODO: should be .0 or .1 so we can use list + # but this also roughly matches private_0, public_0 fflow = self.scenario_cfg["options"]["flow"] for index, src in enumerate(fflow.get("src_ip", [])): - flow["src_ip{}".format(index)] = self._get_ip_flow_range(src) + flow["src_ip_{}".format(index)] = self._get_ip_flow_range(src) for index, dst in enumerate(fflow.get("dst_ip", [])): - flow["dst_ip{}".format(index)] = self._get_ip_flow_range(dst) + flow["dst_ip_{}".format(index)] = self._get_ip_flow_range(dst) - for index, publicip in enumerate(fflow.get("publicip", [])): - flow["public_ip{}".format(index)] = publicip + for index, publicip in enumerate(fflow.get("public_ip", [])): + flow["public_ip_{}".format(index)] = publicip flow["count"] = fflow["count"] except KeyError: @@ -263,7 +265,6 @@ class NetworkServiceTestCase(base.Scenario): node0_if["node_name"] = node0_name node1_if["node_name"] = node1_name - vld_networks = self.get_vld_networks(self.context_cfg["networks"]) node0_if["vld_id"] = vld["id"] node1_if["vld_id"] = vld["id"] @@ -276,6 +277,7 @@ class NetworkServiceTestCase(base.Scenario): node1_if["peer_ifname"] = node0_if_name # just load the network + vld_networks = self.get_vld_networks(self.context_cfg["networks"]) node0_if["network"] = vld_networks.get(vld["id"], {}) node1_if["network"] = vld_networks.get(vld["id"], {}) @@ -325,16 +327,15 @@ class NetworkServiceTestCase(base.Scenario): vnfd = self._find_vnfd_from_vnf_idx(vnf_idx) self.context_cfg["nodes"][vnf_name].update(vnfd) - @staticmethod - def _sort_dpdk_port_num(netdevs): - # dpdk_port_num is PCI BUS ID ordering, lowest first - s = sorted(netdevs.values(), key=itemgetter('pci_bus_id')) - for dpdk_port_num, netdev in enumerate(s): - netdev['dpdk_port_num'] = dpdk_port_num + def _probe_netdevs(self, node, node_dict, timeout=120): + try: + return self.node_netdevs[node] + except KeyError: + pass - def _probe_netdevs(self, node, node_dict): - cmd = "PATH=$PATH:/sbin:/usr/sbin ip addr show" netdevs = {} + cmd = "PATH=$PATH:/sbin:/usr/sbin ip addr show" + with SshManager(node_dict) as conn: if conn: exit_status = conn.execute(cmd)[0] @@ -346,6 +347,8 @@ class NetworkServiceTestCase(base.Scenario): raise IncorrectSetup( "Cannot find netdev info in sysfs" % node) netdevs = node_dict['netdevs'] = self.parse_netdev_info(stdout) + + self.node_netdevs[node] = netdevs return netdevs @classmethod @@ -458,10 +461,22 @@ printf "%s/driver:" $1 ; basename $(readlink -s $1/device/driver); } \ (expected_name, classes_found)) @staticmethod - def update_interfaces_from_node(vnfd, node): - for intf in vnfd["vdu"][0]["external-interface"]: - node_intf = node['interfaces'][intf['name']] - intf['virtual-interface'].update(node_intf) + def create_interfaces_from_node(vnfd, node): + ext_intfs = vnfd["vdu"][0]["external-interface"] = [] + # have to sort so xe0 goes first + for intf_name, intf in sorted(node['interfaces'].items()): + if intf.get('vld_id'): + # force dpkd_port_num to int so we can do reverse lookup + try: + intf['dpdk_port_num'] = int(intf['dpdk_port_num']) + except KeyError: + pass + ext_intf = { + "name": intf_name, + "virtual-interface": intf, + "vnfd-connection-point-ref": intf_name, + } + ext_intfs.append(ext_intf) def load_vnf_models(self, scenario_cfg=None, context_cfg=None): """ Create VNF objects based on YAML descriptors @@ -491,7 +506,7 @@ printf "%s/driver:" $1 ; basename $(readlink -s $1/device/driver); } \ vnfd = vnfdgen.generate_vnfd(vnf_model, node) # TODO: here add extra context_cfg["nodes"] regardless of template vnfd = vnfd["vnfd:vnfd-catalog"]["vnfd"][0] - self.update_interfaces_from_node(vnfd, node) + self.create_interfaces_from_node(vnfd, node) vnf_impl = self.get_vnf_impl(vnfd['id']) vnf_instance = vnf_impl(node_name, vnfd) vnfs.append(vnf_instance) |