"enabled" if nba.ht_enabled else "disabled" )) _ht_diff = nba.num_physical_cores if nba.ht_enabled else 0 io_threads = [ # core_id, list of (port_id, rxq_idx) nba.IOThread(core_id=node_cpus[0][0], attached_rxqs=[(0, 0), (1, 0), (2, 0), (3, 0)], mode='normal'), nba.IOThread(core_id=node_cpus[0][1], attached_rxqs=[(0, 1), (1, 1), (2, 1), (3, 1)], mode='normal'), nba.IOThread(core_id=node_cpus[0][2], attached_rxqs=[(0, 2), (1, 2), (2, 2), (3, 2)], mode='normal'), nba.IOThread(core_id=node_cpus[1][0], attached_rxqs=[(4, 0), (5, 0), (6, 0), (7, 0)], mode='normal'), nba.IOThread(core_id=node_cpus[1][1], attached_rxqs=[(4, 1), (5, 1), (6, 1), (7, 1)], mode='normal'), nba.IOThread(core_id=node_cpus[1][2], attached_rxqs=[(4, 2), (5, 2), (6, 2), (7, 2)], mode='normal'), ] comp_threads = [ # core_id nba.CompThread(core_id=node_cpus[0][0] + _ht_diff), nba.CompThread(core_id=node_cpus[0][1] + _ht_diff), nba.CompThread(core_id=node_cpus[0][2] + _ht_diff), nba.CompThread(core_id=node_cpus[1][0] + _ht_diff), nba.CompThread(core_id=node_cpus[1][1] + _ht_diff), nba.CompThread(core_id=node_cpus[1][2] + _ht_diff), ] coproc_threads = [ # core_id, device_id nba.CoprocThread(core_id=node_cpus[0][7] + _ht_diff, device_id=0), nba.CoprocThread(core_id=node_cpus[1][7] + _ht_diff, device_id=1), ] comp_input_queues = [ # node_id, template
io_threads = [] for node_id in range(no_node): for i in range(no_cpu): attached_rxq_gen = [] for p in range(no_port): attached_rxq_gen.append((node_id * no_port_per_node + p, i)) io_threads.append( nba.IOThread(core_id=node_cpus[node_id][i], attached_rxqs=attached_rxq_gen, mode='normal')) comp_threads = [] for node_id in range(no_node): for i in range(no_cpu): comp_threads.append( nba.CompThread(core_id=node_cpus[node_id][i] + _ht_diff)) coproc_threads = [] for nid in range(no_node): # core_id, device_id coproc_threads.append( nba.CoprocThread(core_id=node_cpus[nid][7] + _ht_diff, device_id=nid)) comp_input_queues = [] for nid in range(no_node): for i in range(no_cpu): comp_input_queues.append(nba.Queue(node_id=nid, template='swrx')) coproc_input_queues = [] for nid in range(no_node): coproc_input_queues.append(nba.Queue(node_id=nid, template='taskin'))
nba.IOThread(core_id=node_cpus[1][0], attached_rxqs=[(4, 0), (5, 0), (6, 0), (7, 0)], mode='normal'), nba.IOThread(core_id=node_cpus[1][1], attached_rxqs=[(4, 1), (5, 1), (6, 1), (7, 1)], mode='normal'), nba.IOThread(core_id=node_cpus[1][2], attached_rxqs=[(4, 2), (5, 2), (6, 2), (7, 2)], mode='normal'), nba.IOThread(core_id=node_cpus[1][3], attached_rxqs=[(4, 3), (5, 3), (6, 3), (7, 3)], mode='normal'), ] comp_threads = [ # core_id nba.CompThread(core_id=node_cpus[0][4]), nba.CompThread(core_id=node_cpus[0][5]), nba.CompThread(core_id=node_cpus[0][6]), nba.CompThread(core_id=node_cpus[0][7]), nba.CompThread(core_id=node_cpus[1][4]), nba.CompThread(core_id=node_cpus[1][5]), nba.CompThread(core_id=node_cpus[1][6]), nba.CompThread(core_id=node_cpus[1][7]), ] coproc_threads = [ # core_id, device_id #nba.CoprocThread(core_id=node_cpus[0][7] + _ht_diff, device_id=0), #nba.CoprocThread(core_id=node_cpus[1][7] + _ht_diff, device_id=1), ]
io_cores_in_node = node_cores[:-num_coproc_in_node] else: io_cores_in_node = node_cores[:] if pmd in ('mlx4', 'mlnx_uio'): # The number of RXQs must be a power of two for Mellanox cards. io_cores_in_node = io_cores_in_node[:leq_power_of_two( len(io_cores_in_node))] for node_local_core_id, core_id in enumerate(io_cores_in_node): rxqs = [(netdev.device_id, node_local_core_id) for netdev in node_local_netdevices] io_threads.append( nba.IOThread(core_id=node_cpus[node_id][node_local_core_id], attached_rxqs=rxqs, mode='normal')) comp_threads.append( nba.CompThread(core_id=node_cpus[node_id][node_local_core_id] + _ht_diff)) comp_input_queues.append(nba.Queue(node_id=node_id, template='swrx')) thread_connections.append( (io_threads[-1], comp_threads[-1], comp_input_queues[-1])) if num_coproc_in_node > 0: coproc_completion_queues.append( nba.Queue(node_id=node_id, template='taskout')) for coproc_thread in coproc_threads: node_id = nba.node_of_cpu(coproc_thread.core_id) node_local_comp_threads = [ comp_thread for comp_thread in comp_threads if nba.node_of_cpu(comp_thread.core_id) == node_id ] for comp_thread in node_local_comp_threads: thread_connections.append(
nba.IOThread(core_id=node_cpus[0][3], attached_rxqs=[(4, 3), (5, 3), (6, 3), (7, 3)], mode='normal'), nba.IOThread(core_id=node_cpus[0][4], attached_rxqs=[(4, 4), (5, 4), (6, 4), (7, 4)], mode='normal'), nba.IOThread(core_id=node_cpus[0][5], attached_rxqs=[(4, 5), (5, 5), (6, 5), (7, 5)], mode='normal'), nba.IOThread(core_id=node_cpus[0][6], attached_rxqs=[(4, 6), (5, 6), (6, 6), (7, 6)], mode='normal'), ] comp_threads = [ # core_id nba.CompThread(core_id=node_cpus[0][0] + _ht_diff), nba.CompThread(core_id=node_cpus[0][1] + _ht_diff), nba.CompThread(core_id=node_cpus[0][2] + _ht_diff), nba.CompThread(core_id=node_cpus[0][3] + _ht_diff), nba.CompThread(core_id=node_cpus[0][4] + _ht_diff), nba.CompThread(core_id=node_cpus[0][5] + _ht_diff), nba.CompThread(core_id=node_cpus[0][6] + _ht_diff), ] coproc_threads = [ # core_id, device_id nba.CoprocThread(core_id=node_cpus[0][7] + _ht_diff, device_id=0), ] comp_input_queues = [ # node_id, template