diff options
Diffstat (limited to 'yardstick/network_services/vnf_generic/vnf/udp_replay.py')
-rw-r--r-- | yardstick/network_services/vnf_generic/vnf/udp_replay.py | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/yardstick/network_services/vnf_generic/vnf/udp_replay.py b/yardstick/network_services/vnf_generic/vnf/udp_replay.py index a57f53bc7..a3b0b9fd9 100644 --- a/yardstick/network_services/vnf_generic/vnf/udp_replay.py +++ b/yardstick/network_services/vnf_generic/vnf/udp_replay.py @@ -1,4 +1,4 @@ -# Copyright (c) 2016-2017 Intel Corporation +# Copyright (c) 2016-2019 Intel Corporation # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -19,7 +19,7 @@ from yardstick.common.process import check_if_process_failed from yardstick.network_services.vnf_generic.vnf.sample_vnf import SampleVNF from yardstick.network_services.vnf_generic.vnf.sample_vnf import DpdkVnfSetupEnvHelper from yardstick.network_services.vnf_generic.vnf.sample_vnf import ClientResourceHelper - +from yardstick.benchmark.contexts import base as ctx_base LOG = logging.getLogger(__name__) @@ -79,9 +79,11 @@ class UdpReplayApproxVnf(SampleVNF): ports_mask_hex = hex(sum(2 ** num for num in port_nums)) # one core extra for master cpu_mask_hex = hex(2 ** (number_of_ports + 1) - 1) + nfvi_context = ctx_base.Context.get_context_from_server( + self.scenario_helper.nodes[self.name]) hw_csum = "" if (not self.scenario_helper.options.get('hw_csum', False) or - self.nfvi_context.attrs.get('nfvi_type') not in self.HW_OFFLOADING_NFVI_TYPES): + nfvi_context.attrs.get('nfvi_type') not in self.HW_OFFLOADING_NFVI_TYPES): hw_csum = '--no-hw-csum' # tuples of (FLD_PORT, FLD_QUEUE, FLD_LCORE) @@ -107,7 +109,7 @@ class UdpReplayApproxVnf(SampleVNF): def collect_kpi(self): def get_sum(offset): - return sum(int(i) for i in split_stats[offset::5]) + return sum(int(i) for i in split_stats[offset::6]) # we can't get KPIs if the VNF is down check_if_process_failed(self._vnf_process) @@ -115,8 +117,13 @@ class UdpReplayApproxVnf(SampleVNF): stats = self.get_stats() stats_words = stats.split() - split_stats = stats_words[stats_words.index('0'):][:number_of_ports * 5] + split_stats = stats_words[stats_words.index('arp_pkts') + 1:][:number_of_ports * 6] + + physical_node = ctx_base.Context.get_physical_node_from_server( + self.scenario_helper.nodes[self.name]) + result = { + "physical_node": physical_node, "packets_in": get_sum(1), "packets_fwd": get_sum(2), "packets_dropped": get_sum(3) + get_sum(4), |