- with VatTerminal(node) as vat_ter:
- if_data = vat_ter.vat_terminal_exec_cmd_from_template(
- 'interface_dump.vat')[0]
-
- tmp_fn = '/tmp/put_subinterfaces_up.config'
- commands = list()
- for i in range(0, vxlan_count):
- vxlan_subif_key = Topology.add_new_port(node, 'vxlan_tunnel')
- vxlan_subif_name = 'vxlan_tunnel{nr}'.format(nr=i)
- vxlan_found = False
- vxlan_subif_idx = None
- vlan_subif_key = Topology.add_new_port(node, 'vlan_subif')
- vlan_subif_name = '{if_name}.{vlan}'.format(
- if_name=Topology.get_interface_name(
- node, node_vlan_if), vlan=i+1)
- vlan_found = False
- vlan_idx = None
- for data in if_data:
- if_name = data['interface_name']
- if not vxlan_found and if_name == vxlan_subif_name:
- vxlan_subif_idx = data['sw_if_index']
- vxlan_found = True
- elif not vlan_found and if_name == vlan_subif_name:
- vlan_idx = data['sw_if_index']
- vlan_found = True
- if vxlan_found and vlan_found:
- break
- Topology.update_interface_sw_if_index(
- node, vxlan_subif_key, vxlan_subif_idx)
- Topology.update_interface_name(
- node, vxlan_subif_key, vxlan_subif_name)
- commands.append(
- 'sw_interface_set_flags sw_if_index {sw_idx} admin-up link-up\n'
- .format(sw_idx=vxlan_subif_idx))
- Topology.update_interface_sw_if_index(
- node, vlan_subif_key, vlan_idx)
- Topology.update_interface_name(
- node, vlan_subif_key, vlan_subif_name)
- commands.append(
- 'sw_interface_set_flags sw_if_index {sw_idx} admin-up link-up\n'
- .format(sw_idx=vlan_idx))
-
- VatExecutor().write_and_execute_script(node, tmp_fn, commands)
+ worker_id = 0
+ worker_cnt = len(VPPUtil.vpp_show_threads(node)) - 1
+ if not worker_cnt:
+ return
+ for placement in InterfaceUtil.vpp_sw_interface_rx_placement_dump(node):
+ for interface in node['interfaces'].values():
+ if placement['sw_if_index'] == interface['vpp_sw_index'] \
+ and prefix in interface['name']:
+ InterfaceUtil.vpp_sw_interface_set_rx_placement(
+ node, placement['sw_if_index'], placement['queue_id'],
+ worker_id % worker_cnt)
+ worker_id += 1