From 8755c892f6cfbfb8ca4f3405675dfe770c769605 Mon Sep 17 00:00:00 2001 From: fmenguy Date: Tue, 21 Apr 2020 18:26:41 +0200 Subject: NFVBENCH-163: Add gratuitous ARP in case of L3 router mode Change-Id: Iec2b186176285f723eb2685319c55e6cd6d33a8a Signed-off-by: fmenguy --- nfvbench/traffic_client.py | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) (limited to 'nfvbench/traffic_client.py') diff --git a/nfvbench/traffic_client.py b/nfvbench/traffic_client.py index ae8af8d..c349289 100755 --- a/nfvbench/traffic_client.py +++ b/nfvbench/traffic_client.py @@ -1069,6 +1069,9 @@ class TrafficClient(object): 'theoretical_tx_rate_bps': stats['theoretical_tx_rate_bps'], 'theoretical_tx_rate_pps': stats['theoretical_tx_rate_pps']} + if self.config.periodic_gratuitous_arp: + retDict['garp_total_tx_rate'] = stats['garp_total_tx_rate'] + tx_keys = ['total_pkts', 'total_pkt_bytes', 'pkt_rate', 'pkt_bit_rate'] rx_keys = tx_keys + ['dropped_pkts'] @@ -1367,12 +1370,25 @@ class TrafficClient(object): for idx, key in enumerate(["direction-forward", "direction-reverse"]): tx_rate = results["stats"][str(idx)]["tx"]["total_pkts"] / self.config.duration_sec rx_rate = results["stats"][str(1 - idx)]["rx"]["total_pkts"] / self.config.duration_sec + + orig_rate = self.run_config['rates'][idx] + if self.config.periodic_gratuitous_arp: + orig_rate['rate_pps'] = float( + orig_rate['rate_pps']) - self.config.gratuitous_arp_pps + r[key] = { - "orig": self.__convert_rates(self.run_config['rates'][idx]), + "orig": self.__convert_rates(orig_rate), "tx": self.__convert_rates({'rate_pps': tx_rate}), "rx": self.__convert_rates({'rate_pps': rx_rate}) } + if self.config.periodic_gratuitous_arp: + r['garp-direction-total'] = { + "orig": self.__convert_rates({'rate_pps': self.config.gratuitous_arp_pps * 2}), + "tx": self.__convert_rates({'rate_pps': results["stats"]["garp_total_tx_rate"]}), + "rx": self.__convert_rates({'rate_pps': 0}) + } + total = {} for direction in ['orig', 'tx', 'rx']: total[direction] = {} @@ -1380,6 +1396,7 @@ class TrafficClient(object): total[direction][unit] = sum([float(x[direction][unit]) for x in list(r.values())]) r['direction-total'] = total + return r def insert_interface_stats(self, pps_list): -- cgit 1.2.3-korg