diff options
author | ahothan <ahothan@cisco.com> | 2018-04-04 00:56:04 -0700 |
---|---|---|
committer | ahothan <ahothan@cisco.com> | 2018-04-04 00:56:04 -0700 |
commit | 90e69f01d75a76dbac971174db0e701ebd40f543 (patch) | |
tree | 3af12045bbdfd3b5e9aa72f1f10fbf157764938f /nfvbench/traffic_client.py | |
parent | 5d582aada32e1c5f43601015660b7936013f5b30 (diff) |
[NFVBENCH-81]With some Intel X710 NIC cards, NFVbench reports erroneous RX counters
Work around this NIC FW issue by using port level stats for packets/bytes
ALso fix mutliple calls to get_stats()
Change-Id: Id19086d0db6bcc4417adff4ed4ce9606ffb30fe2
Signed-off-by: ahothan <ahothan@cisco.com>
Diffstat (limited to 'nfvbench/traffic_client.py')
-rwxr-xr-x | nfvbench/traffic_client.py | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/nfvbench/traffic_client.py b/nfvbench/traffic_client.py index 056075a..2ce118c 100755 --- a/nfvbench/traffic_client.py +++ b/nfvbench/traffic_client.py @@ -787,13 +787,11 @@ class TrafficClient(object): def cancel_traffic(self): self.runner.stop() - def get_interface(self, port_index): + def get_interface(self, port_index, stats): port = self.gen.port_handle[port_index] tx, rx = 0, 0 - if not self.config.no_traffic: - stats = self.get_stats() - if port in stats: - tx, rx = int(stats[port]['tx']['total_pkts']), int(stats[port]['rx']['total_pkts']) + if stats and port in stats: + tx, rx = int(stats[port]['tx']['total_pkts']), int(stats[port]['rx']['total_pkts']) return Interface('traffic-generator', self.tool.lower(), tx, rx) def get_traffic_config(self): |