NetSelector with a besteffort policy. More...
#include <stdlib.h>#include <fnmatch.h>#include <arpa/inet.h>#include "NetSelector-besteffort.h"#include <Padico/Puk.h>#include <Padico/Topology.h>#include <Padico/NetSelector.h>#include <Padico/PadicoTM.h>#include <Padico/Module.h>
Go to the source code of this file.
Data Structures | |
| struct | nsbe_rule_hash_entry_s |
| stores an entry in the hashtable More... | |
| struct | nsbe_rule_hash_entry_block_lfstack_cell_s |
| struct | nsbe_rule_hash_entry_block_lfstack_s |
| struct | nsbe_rule_hash_entry_slice_lfstack_cell_s |
| struct | nsbe_rule_hash_entry_slice_lfstack_s |
| struct | nsbe_rule_hash_entry_allocator_s |
| struct | nsbe_rule_hashtable_s |
| struct | nsbe_rule_hashtable_enumerator_s |
| struct | nsbe_rule_resolved_s |
| a resolved rule for a given network; context may have been tuned for network More... | |
| struct | nsbe_rule_resolved_s::nsbe_rule_resolved_key_s |
| struct | nsbe_rule_resolved_hash_entry_s |
| stores an entry in the hashtable More... | |
| struct | nsbe_rule_resolved_hash_entry_block_lfstack_cell_s |
| struct | nsbe_rule_resolved_hash_entry_block_lfstack_s |
| struct | nsbe_rule_resolved_hash_entry_slice_lfstack_cell_s |
| struct | nsbe_rule_resolved_hash_entry_slice_lfstack_s |
| struct | nsbe_rule_resolved_hash_entry_allocator_s |
| struct | nsbe_rule_resolved_hashtable_s |
| struct | nsbe_rule_resolved_hashtable_enumerator_s |
Detailed Description
NetSelector with a besteffort policy.
Definition in file ns-besteffort.c.
Typedef Documentation
◆ nsbe_rule_hash_destructor_t
| typedef void(* nsbe_rule_hash_destructor_t) (puk_iface_t key, struct padico_nsbe_rule_vect_s *data) |
Definition at line 72 of file ns-besteffort.c.
◆ nsbe_rule_hash_entry_allocator_t
Definition at line 72 of file ns-besteffort.c.
◆ nsbe_rule_hash_entry_block_lfstack_t
Definition at line 72 of file ns-besteffort.c.
◆ nsbe_rule_hash_entry_slice_lfstack_t
Definition at line 72 of file ns-besteffort.c.
◆ nsbe_rule_hash_eqfunc_t
| typedef int(* nsbe_rule_hash_eqfunc_t) (puk_iface_t key1, puk_iface_t key2) |
Definition at line 72 of file ns-besteffort.c.
◆ nsbe_rule_hash_hfunc_t
| typedef uint32_t(* nsbe_rule_hash_hfunc_t) (puk_iface_t key) |
Definition at line 72 of file ns-besteffort.c.
◆ nsbe_rule_hashtable_enumerator_t
Definition at line 72 of file ns-besteffort.c.
◆ nsbe_rule_hashtable_t
Definition at line 72 of file ns-besteffort.c.
◆ nsbe_rule_resolved_hash_destructor_t
| typedef void(* nsbe_rule_resolved_hash_destructor_t) (struct nsbe_rule_resolved_key_s *key, struct nsbe_rule_resolved_s *data) |
Definition at line 105 of file ns-besteffort.c.
◆ nsbe_rule_resolved_hash_entry_allocator_t
Definition at line 105 of file ns-besteffort.c.
◆ nsbe_rule_resolved_hash_entry_block_lfstack_t
| typedef struct nsbe_rule_resolved_hash_entry_block_lfstack_s nsbe_rule_resolved_hash_entry_block_lfstack_t |
Definition at line 105 of file ns-besteffort.c.
◆ nsbe_rule_resolved_hash_entry_slice_lfstack_t
| typedef struct nsbe_rule_resolved_hash_entry_slice_lfstack_s nsbe_rule_resolved_hash_entry_slice_lfstack_t |
Definition at line 105 of file ns-besteffort.c.
◆ nsbe_rule_resolved_hash_eqfunc_t
| typedef int(* nsbe_rule_resolved_hash_eqfunc_t) (struct nsbe_rule_resolved_key_s *key1, struct nsbe_rule_resolved_key_s *key2) |
Definition at line 105 of file ns-besteffort.c.
◆ nsbe_rule_resolved_hash_hfunc_t
Definition at line 105 of file ns-besteffort.c.
◆ nsbe_rule_resolved_hashtable_enumerator_t
Definition at line 105 of file ns-besteffort.c.
◆ nsbe_rule_resolved_hashtable_t
Definition at line 105 of file ns-besteffort.c.
Function Documentation
◆ __attribute__() [1/5]
| struct nsbe_rule_hash_entry_block_lfstack_cell_s __attribute__ | ( | (aligned(16)) | ) |
◆ __attribute__() [2/5]
| __attribute__ | ( | (unused) | ) |
lookup in the oldtable; if found, migrate row and return cell in regular table
get the seq part of a tagged ptr
pop key & data of any element in the table
remove entry with given key from hashtable; does nothing if key not found
allocate a new hashtable
trigger progressive rehashing
flush all rows of a pending rehash
lookup an entry in the hashtable
insert an entry in the given table, without rehashing
make progress on rehash for n rows
force rehashing of given row
Definition at line 72 of file ns-besteffort.c.
◆ __attribute__() [3/5]
insert an entry into a hashtable
returns <key,value> associated with given key, outkey is set to NULL if key not found
probes whether an entry with given key exists in the hashtable
returns value associated with key, NULL if not found
Definition at line 72 of file ns-besteffort.c.
◆ __attribute__() [4/5]
initialize a new hashtable
deallocate a hashtable
destroy a hashtable
Definition at line 72 of file ns-besteffort.c.
◆ __attribute__() [5/5]
| __attribute__ | ( | (visibility("internal")) | ) |
Init the parser.
Definition at line 59 of file ns-besteffort.c.
◆ comp_int()
Definition at line 351 of file ns-besteffort.c.
References done.
Referenced by nsbe_binding_select().
◆ ns_besteffort_finalize()
Definition at line 734 of file ns-besteffort.c.
References done, nsbe, and padico_nsbe_delete_profile().
◆ ns_besteffort_getnetworks()
|
static |
Definition at line 627 of file ns-besteffort.c.
References done, host, node, padico_topo_host_getnetworks(), padico_topo_node_gethost(), and padico_topo_node_getnetworks().
Referenced by ns_besteffort_selector_2nodes().
◆ ns_besteffort_init()
Definition at line 705 of file ns-besteffort.c.
References assembly_control_sysio, assembly_vlink_sfinet, done, nsbe, NULL, padico_nsbe_new_profile(), and padico_nsbe_new_rule().
◆ ns_besteffort_selector_2networks()
|
static |
Definition at line 530 of file ns-besteffort.c.
References assembly, assert(), done, host, i, iface, n, ns_besteffort_selector_dijkstra(), nsbe, nsbe_selector, NULL, padico_nsbe_rule_resolve(), padico_nsbe_rule_vect_t, padico_topo_getlocalhost, padico_topo_host_can_input(), padico_topo_host_can_output(), padico_topo_host_getaddr2(), padico_topo_network_getname(), port, profile, r, rules, and selector.
Referenced by ns_besteffort_selector_2nodes(), and ns_besteffort_selector_host().
◆ ns_besteffort_selector_2nodes()
|
static |
Definition at line 636 of file ns-besteffort.c.
References assembly, done, iface, ns_besteffort_getnetworks(), ns_besteffort_selector_2networks(), padico_topo_node_gethost(), and profile.
Referenced by ns_besteffort_selector_serial().
◆ ns_besteffort_selector_host()
|
static |
Definition at line 661 of file ns-besteffort.c.
References assembly, assert(), done, host, iface, ns_besteffort_selector_2networks(), nsbe, NULL, padico_nsbe_rule_resolve(), padico_nsbe_rule_vect_t, padico_topo_getlocalhost, padico_topo_host_getnetworks(), port, profile, r, and rules.
◆ ns_besteffort_selector_serial()
|
static |
Definition at line 651 of file ns-besteffort.c.
References assembly, done, iface, ns_besteffort_selector_2nodes(), nsbe, and profile.
◆ nsbe_binding_select()
|
static |
apply multi-NIC policy in case multiple bindings are available
Definition at line 364 of file ns-besteffort.c.
References b, comp_int(), done, i, n, nodes, NULL, padico_module_attr_multinic_policy_getvalue(), padico_na_rank, padico_topo_getlocalhost, padico_topo_host_getnodes(), padico_topo_node_vect_t, padico_topo_session, padico_topo_session_getrank(), and s.
Referenced by padico_nsbe_rule_resolve().
◆ nsbe_resolved_destructor()
|
static |
Definition at line 99 of file ns-besteffort.c.
◆ nsbe_rule_hash_entry_insert()
|
inlinestatic |
◆ nsbe_rule_hash_entry_lookup()
|
inlinestatic |
◆ nsbe_rule_hash_entry_oldprobe()
|
inlinestatic |
◆ nsbe_rule_hash_entry_rehash_flush()
|
inlinestatic |
◆ nsbe_rule_hash_entry_rehash_n()
|
inlinestatic |
◆ nsbe_rule_hash_entry_rehash_row()
|
inlinestatic |
◆ nsbe_rule_resolved_eq()
|
static |
Definition at line 92 of file ns-besteffort.c.
References done.
◆ nsbe_rule_resolved_hash()
Definition at line 87 of file ns-besteffort.c.
◆ nsbe_rule_resolved_hash_entry_insert()
|
inlinestatic |
◆ nsbe_rule_resolved_hash_entry_lookup()
|
inlinestatic |
◆ nsbe_rule_resolved_hash_entry_oldprobe()
|
inlinestatic |
◆ nsbe_rule_resolved_hash_entry_rehash_flush()
|
inlinestatic |
◆ nsbe_rule_resolved_hash_entry_rehash_n()
|
inlinestatic |
◆ nsbe_rule_resolved_hash_entry_rehash_row()
|
inlinestatic |
◆ padico_module_attr_finalizer__multinic_policy()
Definition at line 55 of file ns-besteffort.c.
◆ padico_module_attr_finalizer__validate()
Definition at line 57 of file ns-besteffort.c.
◆ padico_module_attr_initializer__multinic_policy()
Definition at line 55 of file ns-besteffort.c.
◆ padico_module_attr_initializer__validate()
Definition at line 57 of file ns-besteffort.c.
◆ padico_module_attr_multinic_policy_getvalue()
|
inlinestatic |
Definition at line 55 of file ns-besteffort.c.
Referenced by nsbe_binding_select().
◆ padico_module_attr_multinic_policy_setvalue()
|
inlinestatic |
Definition at line 55 of file ns-besteffort.c.
◆ padico_module_attr_validate_getvalue()
|
inlinestatic |
Definition at line 57 of file ns-besteffort.c.
Referenced by padico_nsbe_new_rule().
◆ padico_module_attr_validate_setvalue()
|
inlinestatic |
Definition at line 57 of file ns-besteffort.c.
◆ padico_module_create_initializer__NetSelector_besteffort()
Definition at line 53 of file ns-besteffort.c.
◆ padico_nsbe_delete_profile()
Definition at line 301 of file ns-besteffort.c.
References done, i, nsbe, nsbe_selector, padico_ns_selector_unregister(), and profile.
Referenced by ns_besteffort_finalize().
◆ padico_nsbe_new_rule()
| void padico_nsbe_new_rule | ( | const char * | profile, |
| const char * | iface_name, | ||
| const char * | network, | ||
| const char * | assembly | ||
| ) |
Definition at line 320 of file ns-besteffort.c.
References assembly, component, done, iface, network, nsbe, NULL, padico_module_attr_validate_getvalue(), padico_nsbe_rule_vect_t, profile, padico_nsbe_rule_s::profile, and v.
Referenced by ns_besteffort_init().
◆ padico_nsbe_rule_resolve()
| puk_component_t padico_nsbe_rule_resolve | ( | struct padico_nsbe_rule_s * | rule_bucket, |
| padico_topo_network_t | network, | ||
| int | rail | ||
| ) |
Definition at line 420 of file ns-besteffort.c.
References assert(), b, component, done, e, host, key, name, network, padico_nsbe_rule_s::network_pattern, nsbe, nsbe_binding_select(), NULL, padico_topo_binding_get_index(), padico_topo_binding_gethwaddr(), padico_topo_binding_vect_t, padico_topo_getlocalhost, padico_topo_host_getbindings(), padico_topo_hwaddr_get(), padico_topo_network_getname(), ns_rule_bucket_s::profile, padico_nsbe_rule_s::profile, r, rc, resolved, and padico_nsbe_rule_s::symbolic.
Referenced by ns_besteffort_selector_2networks(), and ns_besteffort_selector_host().
Variable Documentation
◆ __attribute__
| struct nsbe_rule_resolved_hash_entry_slice_lfstack_s __attribute__ |
◆ _next
◆ block
◆ component
| puk_component_t component |
Definition at line 109 of file ns-besteffort.c.
Referenced by padico_nsbe_new_rule(), and padico_nsbe_rule_resolve().
◆ driver
Definition at line 108 of file ns-besteffort.c.
Referenced by bench_minidriver_connect(), ns_netselector_driver(), ns_selector_insert(), padico_ns_selector_register(), padico_ns_selector_unregister(), padico_vio_dumpvnode(), padico_vnode_close(), padico_vnode_get_vlink_driver(), padico_vnode_read_post(), padico_vnode_write_post(), padico_vsock_active_connect(), padico_vsock_bind(), padico_vsock_create(), padico_vsock_fullshutdown(), padico_vsock_passive_connect(), and vlink_selector_close().
◆ lock
| pthread_mutex_t lock |
Definition at line 117 of file ns-besteffort.c.
◆ [struct]
| struct { ... } nsbe |
◆ nsbe_selector
| nsbe_selector |
Definition at line 107 of file ns-besteffort.c.
Referenced by ns_besteffort_selector_2networks(), and padico_nsbe_delete_profile().
◆ padico_mod_binary__NetSelector_besteffort
| struct puk_mod_binary_s padico_mod_binary__NetSelector_besteffort = { .name = "NetSelector_besteffort", .funcs = &padico_mod_funcs__NetSelector_besteffort , .mod = NULL, .profile = { .total_mem = 0, .max_mem = 0, .num_malloc = 0, .num_free = 0 } , .auto_deps = & puk_mod_dep_NetSelector_besteffort , .n_deps = sizeof((char*[]){ 0, "Topology", "NetSelector" }) / sizeof(char*), .deps = { NULL, "Topology", "NetSelector" } } |
Definition at line 53 of file ns-besteffort.c.
◆ padico_mod_funcs__NetSelector_besteffort
|
static |
Definition at line 53 of file ns-besteffort.c.
◆ padico_module_opt_multinic_policy
|
static |
Definition at line 55 of file ns-besteffort.c.
◆ padico_module_opt_validate
|
static |
Definition at line 57 of file ns-besteffort.c.
◆ plugin
| padico_nsbe_plugin_t plugin |
Definition at line 110 of file ns-besteffort.c.
◆ resolved
| struct nsbe_rule_resolved_hashtable_s resolved |
hash: rule_bucket+network -> resolved component
Definition at line 116 of file ns-besteffort.c.
Referenced by padico_nsbe_rule_resolve().
◆ rules
| struct nsbe_rule_hashtable_s rules |
hash: iface -> rule_vect
Definition at line 115 of file ns-besteffort.c.
Referenced by ns_basic_assembly(), ns_basic_host_assembly(), ns_basic_print_rules(), ns_besteffort_selector_2networks(), and ns_besteffort_selector_host().
◆ selectors
| struct nsbe_selector_list_s selectors |
Definition at line 118 of file ns-besteffort.c.