diff options
author | Martin Banszel <martinx.banszel@intel.com> | 2017-07-19 19:35:02 +0000 |
---|---|---|
committer | Ross Brattain <ross.b.brattain@intel.com> | 2017-09-18 01:28:28 -0700 |
commit | 86083c8023f40d368f6339d2ab68d49c9ac8b8ee (patch) | |
tree | 0ca209f5bf0f00e36e856ffecd21184921265077 /yardstick/network_services/traffic_profile/rfc2544.py | |
parent | 38eb33a092e903b9854267d3e36496c919517103 (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/network_services/traffic_profile/rfc2544.py')
-rw-r--r-- | yardstick/network_services/traffic_profile/rfc2544.py | 31 |
1 files changed, 14 insertions, 17 deletions
diff --git a/yardstick/network_services/traffic_profile/rfc2544.py b/yardstick/network_services/traffic_profile/rfc2544.py index a3b803673..6a0ecaf99 100644 --- a/yardstick/network_services/traffic_profile/rfc2544.py +++ b/yardstick/network_services/traffic_profile/rfc2544.py @@ -43,7 +43,7 @@ class RFC2544Profile(TrexProfile): def register_generator(self, generator): self.generator = generator - def execute(self, traffic_generator=None): + def execute_traffic(self, traffic_generator=None): """ Generate the stream and run traffic on the given ports """ if traffic_generator is not None and self.generator is None: self.generator = traffic_generator @@ -52,21 +52,18 @@ class RFC2544Profile(TrexProfile): return self.ports = [] - priv_ports = self.generator.priv_ports - pub_ports = self.generator.pub_ports - # start from 1 for private_1, public_1, etc. - for index, (priv_port, pub_port) in enumerate(zip(priv_ports, pub_ports), 1): - profile_data = self.params.get('private_{}'.format(index), '') - self.ports.append(priv_port) - # pass profile_data directly, don't use self.profile_data - self.generator.client.add_streams(self.get_streams(profile_data), ports=priv_port) - profile_data = self.params.get('public_{}'.format(index), '') + for vld_id, intfs in sorted(self.generator.networks.items()): + profile_data = self.params.get(vld_id) + # no profile for this port + if not profile_data: + continue # correlated traffic doesn't use public traffic? - if not profile_data or self.generator.rfc2544_helper.correlated_traffic: + if vld_id.startswith("public") and self.generator.rfc2544_helper.correlated_traffic: continue - # just get the pub_port - self.ports.append(pub_port) - self.generator.client.add_streams(self.get_streams(profile_data), ports=pub_port) + for intf in intfs: + port = self.generator.vnfd_helper.port_num(intf) + self.ports.append(port) + self.generator.client.add_streams(self.get_streams(profile_data), ports=port) self.max_rate = self.rate self.min_rate = 0 @@ -86,7 +83,7 @@ class RFC2544Profile(TrexProfile): if generator is None: generator = self.generator run_duration = self.generator.RUN_DURATION - samples = self.generator.generate_samples() + samples = self.generator.generate_samples(self.ports) in_packets = sum([value['in_packets'] for value in samples.values()]) out_packets = sum([value['out_packets'] for value in samples.values()]) @@ -135,8 +132,8 @@ class RFC2544Profile(TrexProfile): # TODO(esm): why don't we discard results that are out of tolerance? self.min_rate = self.rate - generator.clear_client_stats() - generator.start_client(mult=self.get_multiplier(), + generator.clear_client_stats(self.ports) + generator.start_client(self.ports, mult=self.get_multiplier(), duration=run_duration, force=True) # if correlated traffic update the Throughput |