X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=blobdiff_plain;f=yardstick%2Fnetwork_services%2Fhelpers%2Fsamplevnf_helper.py;h=9d89d41889bf0cc87a8ee77a5c0388f239056391;hb=d3ee35dc0015e073b7138f3b02508b40fc6288b1;hp=dbc10b8c50acf98d2fd9a29abf961252af101169;hpb=dc3434a60f5d675d2822927afc271d2cd5c6dddd;p=yardstick.git diff --git a/yardstick/network_services/helpers/samplevnf_helper.py b/yardstick/network_services/helpers/samplevnf_helper.py index dbc10b8c5..9d89d4188 100644 --- a/yardstick/network_services/helpers/samplevnf_helper.py +++ b/yardstick/network_services/helpers/samplevnf_helper.py @@ -36,13 +36,13 @@ link {0} up ACTION_TEMPLATE = """\ p action add {0} accept -p action add {0} fwd +p action add {0} fwd {0} p action add {0} count """ FW_ACTION_TEMPLATE = """\ p action add {0} accept -p action add {0} fwd +p action add {0} fwd {0} p action add {0} count p action add {0} conntrack """ @@ -222,17 +222,22 @@ class MultiPortConfig(object): return try: - self.start_core = 'h{}'.format(int(self.start_core)) + self.start_core = '{}h'.format(int(self.start_core)) except ValueError: self.start_core = int(self.start_core[:-1]) + 1 @staticmethod def get_port_pairs(interfaces): port_pair_list = [] - networks = defaultdict(list) + networks = {} for private_intf in interfaces: vintf = private_intf['virtual-interface'] - networks[vintf['vld_id']].append(vintf) + try: + vld_id = vintf['vld_id'] + except KeyError: + pass + else: + networks.setdefault(vld_id, []).append(vintf) for name, net in networks.items(): # partition returns a tuple @@ -333,10 +338,20 @@ class MultiPortConfig(object): 'nd_route_tbl': "(0100::,64,0,::1)" } self.pktq_out_os = swq_out_str.split(' ') - # why? + # HWLB is a run to complition. So override the pktq_in/pktq_out if self.lb_config == self.HW_LB: - arpicmp_data['pktq_in'] = swq_in_str self.swq = 0 + swq_in_str = \ + self.make_range_str('SWQ{}', self.swq, + offset=(self.lb_count * self.worker_threads)) + arpicmp_data['pktq_in'] = swq_in_str + # WA: Since port_pairs will not be populated during arp pipeline + self.port_pairs = self.port_pair_list + port_iter = \ + self.make_port_pairs_iter(self.float_x_plus_one_tenth_of_y, [self.mul]) + pktq_out = self.make_str('TXQ{}', port_iter) + arpicmp_data['pktq_out'] = pktq_out + return arpicmp_data def generate_final_txrx_data(self):