From ed1df5da8e6468ec7a0e25a853fe803bfc0af3f6 Mon Sep 17 00:00:00 2001 From: ahothan Date: Fri, 7 Dec 2018 15:05:06 -0800 Subject: NFVBENCH-118 VxLAN fixed rate: Trex far end port Rx counters are incorrect Change-Id: If3d0b199f4b97f8610dea360cb9e70fabec06601 Signed-off-by: ahothan --- nfvbench/traffic_client.py | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) (limited to 'nfvbench/traffic_client.py') diff --git a/nfvbench/traffic_client.py b/nfvbench/traffic_client.py index 093a02d..dbb8206 100755 --- a/nfvbench/traffic_client.py +++ b/nfvbench/traffic_client.py @@ -360,7 +360,6 @@ class GeneratorConfig(object): self.udp_src_port = gen_config.udp_src_port self.udp_dst_port = gen_config.udp_dst_port self.vteps = gen_config.get('vteps') - self.vnis = gen_config.get('vnis') self.devices = [Device(port, self) for port in [0, 1]] # This should normally always be [0, 1] self.ports = [device.port for device in self.devices] @@ -1027,7 +1026,29 @@ class TrafficClient(object): # interface stats for the pps because it could have been modified to contain # additional interface stats self.gen.get_stream_stats(stats, ifs, self.pps_list[chain_idx].latencies, chain_idx) - + # special handling for vxlan + # in case of vxlan, flow stats are not available so all rx counters will be + # zeros when the total rx port counter is non zero. + # in that case, + for port in range(2): + total_rx = 0 + for ifs in self.ifstats: + total_rx += ifs[port].rx + if total_rx == 0: + # check if the total port rx from Trex is also zero + port_rx = stats[port]['rx']['total_pkts'] + if port_rx: + # the total rx for all chains from port level stats is non zero + # which means that the per-chain stats are not available + if len(self.ifstats) == 1: + # only one chain, simply report the port level rx to the chain rx stats + self.ifstats[0][port].rx = port_rx + else: + for ifs in self.ifstats: + # mark this data as unavailable + ifs[port].rx = None + # pitch in the total rx only in the last chain pps + self.ifstats[-1][port].rx_total = port_rx @staticmethod def compare_tx_rates(required, actual): -- cgit 1.2.3-korg