/freebsd/contrib/ofed/opensm/include/opensm/ |
H A D | osm_switch.h | 266 static inline uint8_t osm_switch_get_hop_count(IN const osm_switch_t * p_sw, in osm_switch_get_hop_count() argument 270 return (lid_ho > p_sw->max_lid_ho || !p_sw->hops[lid_ho]) ? in osm_switch_get_hop_count() 271 OSM_NO_PATH : p_sw->hops[lid_ho][port_num]; in osm_switch_get_hop_count() 301 cl_status_t osm_switch_set_hops(IN osm_switch_t * p_sw, IN uint16_t lid_ho, 334 void osm_switch_clear_hops(IN osm_switch_t * p_sw); 355 static inline uint8_t osm_switch_get_least_hops(IN const osm_switch_t * p_sw, in osm_switch_get_least_hops() argument 358 return (lid_ho > p_sw->max_lid_ho || !p_sw->hops[lid_ho]) ? in osm_switch_get_least_hops() 359 OSM_NO_PATH : p_sw->hops[lid_ho][0]; in osm_switch_get_least_hops() 389 uint8_t osm_switch_get_port_least_hops(IN const osm_switch_t * p_sw, 434 static inline uint8_t osm_switch_get_port_by_lid(IN const osm_switch_t * p_sw, in osm_switch_get_port_by_lid() argument [all …]
|
H A D | osm_mtree.h | 101 const osm_switch_t *p_sw; member 140 osm_mtree_node_t *osm_mtree_node_new(IN const osm_switch_t * p_sw); 254 return p_mtn->p_sw; in osm_mtree_node_get_switch_ptr()
|
H A D | osm_ucast_lash.h | 74 osm_switch_t *p_sw; member
|
H A D | osm_event_plugin.h | 104 osm_switch_t *p_sw; member
|
/freebsd/contrib/ofed/opensm/opensm/ |
H A D | osm_switch.c | 64 cl_status_t osm_switch_set_hops(IN osm_switch_t * p_sw, IN uint16_t lid_ho, in osm_switch_set_hops() argument 67 if (!lid_ho || lid_ho > p_sw->max_lid_ho) in osm_switch_set_hops() 69 if (port_num >= p_sw->num_ports) in osm_switch_set_hops() 71 if (!p_sw->hops[lid_ho]) { in osm_switch_set_hops() 72 p_sw->hops[lid_ho] = malloc(p_sw->num_ports); in osm_switch_set_hops() 73 if (!p_sw->hops[lid_ho]) in osm_switch_set_hops() 75 memset(p_sw->hops[lid_ho], OSM_NO_PATH, p_sw->num_ports); in osm_switch_set_hops() 78 p_sw->hops[lid_ho][port_num] = num_hops; in osm_switch_set_hops() 79 if (p_sw->hops[lid_ho][0] > num_hops) in osm_switch_set_hops() 80 p_sw->hops[lid_ho][0] = num_hops; in osm_switch_set_hops() [all …]
|
H A D | osm_ucast_ftree.c | 114 struct ftree_sw_t_ *p_sw; member 139 struct ftree_sw_t_ *p_sw; member 261 compare_switches_by_index(&((*pp_g1)->remote_hca_or_sw.p_sw), in compare_port_groups_by_remote_switch_index() 262 &((*pp_g2)->remote_hca_or_sw.p_sw)); in compare_port_groups_by_remote_switch_index() 335 static ftree_sw_tbl_element_t *sw_tbl_element_create(IN ftree_sw_t * p_sw) in sw_tbl_element_create() argument 343 p_element->p_sw = p_sw; in sw_tbl_element_create() 421 p_group->hca_or_sw.p_sw = (ftree_sw_t *) p_hca_or_sw; in port_group_create() 435 p_group->remote_hca_or_sw.p_sw = in port_group_create() 548 ftree_sw_t *p_sw; in sw_create() local 555 p_sw = (ftree_sw_t *) malloc(sizeof(ftree_sw_t)); in sw_create() [all …]
|
H A D | osm_mcast_mgr.c | 265 osm_switch_t *p_sw, *p_best_sw = NULL; in mcast_mgr_find_optimal_switch() local 274 for (p_sw = (osm_switch_t *) cl_qmap_head(p_sw_tbl); in mcast_mgr_find_optimal_switch() 275 p_sw != (osm_switch_t *) cl_qmap_end(p_sw_tbl); in mcast_mgr_find_optimal_switch() 276 p_sw = (osm_switch_t *) cl_qmap_next(&p_sw->map_item)) { in mcast_mgr_find_optimal_switch() 277 if (!osm_switch_supports_mcast(p_sw)) in mcast_mgr_find_optimal_switch() 281 hops = mcast_mgr_compute_avg_hops(sm, &mgrp_sw_map, p_sw); in mcast_mgr_find_optimal_switch() 283 hops = mcast_mgr_compute_max_hops(sm, &mgrp_sw_map, p_sw); in mcast_mgr_find_optimal_switch() 288 cl_ntoh64(osm_node_get_node_guid(p_sw->p_node)), hops); in mcast_mgr_find_optimal_switch() 291 p_best_sw = p_sw; in mcast_mgr_find_optimal_switch() 315 osm_switch_t *p_sw = NULL; in osm_mcast_mgr_find_root_switch() local [all …]
|
H A D | osm_ucast_cache.c | 81 static uint16_t cache_sw_get_base_lid_ho(cache_switch_t * p_sw) in cache_sw_get_base_lid_ho() argument 83 return p_sw->ports[0].remote_lid_ho; in cache_sw_get_base_lid_ho() 86 static boolean_t cache_sw_is_leaf(cache_switch_t * p_sw) in cache_sw_is_leaf() argument 88 return p_sw->ports[0].is_leaf; in cache_sw_is_leaf() 91 static void cache_sw_set_leaf(cache_switch_t * p_sw) in cache_sw_set_leaf() argument 93 p_sw->ports[0].is_leaf = TRUE; in cache_sw_set_leaf() 115 static void cache_sw_destroy(cache_switch_t * p_sw) in cache_sw_destroy() argument 119 if (!p_sw) in cache_sw_destroy() 122 if (p_sw->lft) in cache_sw_destroy() 123 free(p_sw->lft); in cache_sw_destroy() [all …]
|
H A D | osm_ucast_dnup.c | 106 IN osm_switch_t * p_sw, IN uint8_t prune_weight, in dnup_bfs_by_node() argument 117 lid = osm_node_get_base_lid(p_sw->p_node, 0); in dnup_bfs_by_node() 119 osm_switch_set_hops(p_sw, lid, 0, 0); in dnup_bfs_by_node() 123 cl_ntoh64(p_sw->p_node->node_info.port_guid), lid); in dnup_bfs_by_node() 125 u = p_sw->priv; in dnup_bfs_by_node() 222 osm_switch_t *p_sw; in dnup_subn_rank() local 238 p_sw = (osm_switch_t *)item; in dnup_subn_rank() 239 u = p_sw->priv; in dnup_subn_rank() 248 p_sw = u->sw; in dnup_subn_rank() 249 num_ports = p_sw->num_ports; in dnup_subn_rank() [all …]
|
H A D | osm_ucast_file.c | 81 osm_switch_t * p_sw, uint16_t lid, uint8_t port_num, in add_path() argument 88 old_port = osm_switch_get_port_by_lid(p_sw, new_lid, OSM_LFT); in add_path() 93 cl_ntoh64(osm_node_get_node_guid(p_sw->p_node)), in add_path() 97 p_sw->new_lft[new_lid] = port_num; in add_path() 100 osm_switch_count_path(p_sw, port_num); in add_path() 106 cl_ntoh64(osm_node_get_node_guid(p_sw->p_node))); in add_path() 109 static void add_lid_hops(osm_opensm_t * p_osm, osm_switch_t * p_sw, in add_lid_hops() argument 115 if (len > p_sw->num_ports) in add_lid_hops() 116 len = p_sw->num_ports; in add_lid_hops() 119 osm_switch_set_hops(p_sw, lid, i, hops[i]); in add_lid_hops() [all …]
|
H A D | osm_ucast_mgr.c | 108 osm_switch_t * p_sw = (osm_switch_t *) p_map_item; in ucast_mgr_process_hop_0_1() local 113 lid = cl_ntoh16(osm_node_get_base_lid(p_sw->p_node, 0)); in ucast_mgr_process_hop_0_1() 114 osm_switch_set_hops(p_sw, lid, 0, 0); in ucast_mgr_process_hop_0_1() 116 for (i = 1; i < p_sw->num_ports; i++) { in ucast_mgr_process_hop_0_1() 117 osm_physp_t *p = osm_node_get_physp_ptr(p_sw->p_node, i); in ucast_mgr_process_hop_0_1() 122 p_remote_node != p_sw->p_node) { in ucast_mgr_process_hop_0_1() 125 osm_switch_set_hops(p_sw, remote_lid, i, p->hop_wf); in ucast_mgr_process_hop_0_1() 136 osm_switch_t *p_sw; in ucast_mgr_process_neighbor() local 156 p_sw = (osm_switch_t *) item; in ucast_mgr_process_neighbor() 157 lid_ho = cl_ntoh16(osm_node_get_base_lid(p_sw->p_node, 0)); in ucast_mgr_process_neighbor() [all …]
|
H A D | osm_sw_info_rcv.c | 65 static void si_rcv_get_fwd_tbl(IN osm_sm_t * sm, IN osm_switch_t * p_sw) 77 CL_ASSERT(p_sw); 79 p_node = p_sw->p_node; 86 max_block_id_ho = osm_switch_get_max_block_id_in_use(p_sw); 111 static void si_rcv_get_mcast_fwd_tbl(IN osm_sm_t * sm, IN osm_switch_t * p_sw) 127 CL_ASSERT(p_sw); 129 p_node = p_sw->p_node; 133 if (osm_switch_get_mcast_fwd_tbl_size(p_sw) == 0) { 143 p_tbl = osm_switch_get_mcast_tbl_ptr(p_sw); 199 osm_switch_t *p_sw; in si_rcv_process_new() local [all …]
|
H A D | osm_ucast_updn.c | 112 IN osm_switch_t * p_sw) in updn_bfs_by_node() argument 122 lid = osm_node_get_base_lid(p_sw->p_node, 0); in updn_bfs_by_node() 124 osm_switch_set_hops(p_sw, lid, 0, 0); in updn_bfs_by_node() 128 cl_ntoh64(p_sw->p_node->node_info.port_guid), lid); in updn_bfs_by_node() 130 u = p_sw->priv; in updn_bfs_by_node() 211 osm_switch_t *p_sw; in updn_subn_rank() local 227 p_sw = (osm_switch_t *)item; in updn_subn_rank() 228 u = p_sw->priv; in updn_subn_rank() 237 p_sw = u->sw; in updn_subn_rank() 238 num_ports = p_sw->num_ports; in updn_subn_rank() [all …]
|
H A D | osm_sa_mft_record.c | 71 IN osm_switch_t * p_sw, in mftr_rcv_new_mftr() argument 93 cl_ntoh64(osm_node_get_node_guid(p_sw->p_node)), in mftr_rcv_new_mftr() 105 osm_switch_get_mft_block(p_sw, block, position, p_rec_item->resp.mft_rec.mft); in mftr_rcv_new_mftr() 117 osm_switch_t *p_sw = (osm_switch_t *) p_map_item; in mftr_rcv_by_comp_mask() local 131 osm_get_port_by_guid(sa->p_subn, p_sw->p_node->node_info.port_guid); in mftr_rcv_by_comp_mask() 135 "\n", cl_ntoh64(p_sw->p_node->node_info.node_guid)); in mftr_rcv_by_comp_mask() 146 cl_ntoh64(p_sw->p_node->node_info.node_guid)); in mftr_rcv_by_comp_mask() 167 if (!osm_switch_supports_mcast(p_sw)) in mftr_rcv_by_comp_mask() 171 if (osm_switch_get_mft_max_block_in_use(p_sw) == -1) in mftr_rcv_by_comp_mask() 180 if (max_block > osm_switch_get_mft_max_block_in_use(p_sw)) in mftr_rcv_by_comp_mask() [all …]
|
H A D | osm_dump.c | 72 osm_switch_t *p_sw = (osm_switch_t *) item; in dump_ucast_path_distribution() local 74 p_node = p_sw->p_node; in dump_ucast_path_distribution() 75 num_ports = p_sw->num_ports; in dump_ucast_path_distribution() 82 num_paths = osm_switch_path_count_get(p_sw, i); in dump_ucast_path_distribution() 129 osm_switch_t *p_sw = (osm_switch_t *) item; in dump_ucast_routes() local 132 p_node = p_sw->p_node; in dump_ucast_routes() 134 max_lid_ho = p_sw->max_lid_ho; in dump_ucast_routes() 152 port_num = osm_switch_get_port_by_lid(p_sw, lid_ho, in dump_ucast_routes() 176 osm_switch_get_hop_count(p_sw, base_lid, port_num); in dump_ucast_routes() 181 osm_switch_get_hop_count(p_sw, lid_ho, port_num); in dump_ucast_routes() [all …]
|
H A D | osm_lin_fwd_rcv.c | 64 osm_switch_t *p_sw; in osm_lft_rcv_process() local 95 p_sw = osm_get_switch_by_guid(sm->p_subn, node_guid); in osm_lft_rcv_process() 97 if (!p_sw) { in osm_lft_rcv_process() 102 status = osm_switch_set_lft_block(p_sw, p_block, block_num); in osm_lft_rcv_process() 105 lft_change.p_sw = p_sw; in osm_lft_rcv_process() 118 p_sw->p_node->print_desc); in osm_lft_rcv_process()
|
H A D | osm_ucast_lash.c | 607 static switch_t *switch_create(lash_t * p_lash, unsigned id, osm_switch_t * p_sw) in switch_create() argument 610 unsigned num_ports = p_sw->num_ports; in switch_create() 631 sw->p_sw = p_sw; in switch_create() 632 p_sw->priv = sw; in switch_create() 966 static unsigned get_lash_id(osm_switch_t * p_sw) in get_lash_id() argument 968 return ((switch_t *) p_sw->priv)->id; in get_lash_id() 990 osm_switch_t *p_sw, *p_next_sw, *p_dst_sw; in populate_fwd_tbls() local 1002 p_sw = p_next_sw; in populate_fwd_tbls() 1003 p_next_sw = (osm_switch_t *) cl_qmap_next(&p_sw->map_item); in populate_fwd_tbls() 1005 max_lid_ho = p_sw->max_lid_ho; in populate_fwd_tbls() [all …]
|
H A D | osm_mtree.c | 52 osm_mtree_node_t *osm_mtree_node_new(IN const osm_switch_t * p_sw) in osm_mtree_node_new() argument 58 sizeof(void *) * (p_sw->num_ports - 1)); in osm_mtree_node_new() 63 p_mtn->p_sw = p_sw; in osm_mtree_node_new() 64 p_mtn->max_children = p_sw->num_ports; in osm_mtree_node_new() 95 cl_ntoh64(p_mtn->p_sw->p_node->node_info.node_guid),
|
H A D | osm_sa_sw_info_record.c | 71 IN const osm_switch_t * p_sw, in sir_rcv_new_sir() argument 94 p_rec_item->resp.swinfo_rec.switch_info = p_sw->switch_info; in sir_rcv_new_sir() 103 static void sir_rcv_create_sir(IN osm_sa_t * sa, IN const osm_switch_t * p_sw, in sir_rcv_create_sir() argument 121 osm_get_port_by_guid(sa->p_subn, p_sw->p_node->node_info.port_guid); in sir_rcv_create_sir() 125 "\n", cl_ntoh64(p_sw->p_node->node_info.node_guid)); in sir_rcv_create_sir() 136 cl_ntoh64(p_sw->p_node->node_info.node_guid)); in sir_rcv_create_sir() 160 sir_rcv_new_sir(sa, p_sw, p_list, osm_port_get_base_lid(p_port)); in sir_rcv_create_sir() 169 const osm_switch_t *p_sw = (osm_switch_t *) p_map_item; in sir_rcv_by_comp_mask() local 178 osm_dump_switch_info_v2(p_ctxt->sa->p_log, &p_sw->switch_info, in sir_rcv_by_comp_mask() 187 sir_rcv_create_sir(sa, p_sw, p_ctxt->p_list, match_lid, p_req_physp); in sir_rcv_by_comp_mask()
|
H A D | osm_sa_lft_record.c | 71 IN const osm_switch_t * p_sw, in lftr_rcv_new_lftr() argument 91 cl_ntoh64(osm_node_get_node_guid(p_sw->p_node)), in lftr_rcv_new_lftr() 100 osm_switch_get_lft_block(p_sw, block, p_rec_item->resp.lft_rec.lft); in lftr_rcv_new_lftr() 112 const osm_switch_t *p_sw = (osm_switch_t *) p_map_item; in lftr_rcv_by_comp_mask() local 124 p_sw->p_node->node_info.port_guid); in lftr_rcv_by_comp_mask() 128 "\n", cl_ntoh64(p_sw->p_node->node_info.node_guid)); in lftr_rcv_by_comp_mask() 139 cl_ntoh64(p_sw->p_node->node_info.node_guid)); in lftr_rcv_by_comp_mask() 161 max_block = osm_switch_get_max_block_id_in_use(p_sw); in lftr_rcv_by_comp_mask() 172 lftr_rcv_new_lftr(sa, p_sw, p_ctxt->p_list, in lftr_rcv_by_comp_mask()
|
H A D | osm_mcast_fwd_rcv.c | 68 osm_switch_t *p_sw; in osm_mft_rcv_process() local 107 p_sw = osm_get_switch_by_guid(sm->p_subn, node_guid); in osm_mft_rcv_process() 109 if (!p_sw) { in osm_mft_rcv_process() 114 status = osm_switch_set_mft_block(p_sw, p_block, in osm_mft_rcv_process() 123 p_sw->p_node->print_desc, block_num, position); in osm_mft_rcv_process()
|
H A D | osm_console.c | 1040 osm_switch_t * p_sw, FILE * out, int verbose) in switchbalance_check() argument 1077 port_num = osm_switch_get_port_by_lid(p_sw, lid_ho, in switchbalance_check() 1086 num_ports = p_sw->num_ports; in switchbalance_check() 1088 p_physp = osm_node_get_physp_ptr(p_sw->p_node, port_num); in switchbalance_check() 1119 cl_ntoh64(p_sw->p_node->node_info.node_guid), in switchbalance_check() 1120 p_sw->p_node->print_desc); in switchbalance_check() 1124 cl_ntoh64(p_sw->p_node->node_info.node_guid), in switchbalance_check() 1125 p_sw->p_node->print_desc); in switchbalance_check() 1139 osm_switch_t *p_sw; in switchbalance_parse() local 1163 p_sw = osm_get_switch_by_guid(&p_osm->subn, cl_hton64(guid)); in switchbalance_parse() [all …]
|
H A D | osm_ucast_dfsssp.c | 1579 osm_switch_t *p_sw = NULL; in update_lft() local 1591 p_sw = adj_list[i].sw; in update_lft() 1603 (p_sw->p_node))); in update_lft() 1613 (p_sw->p_node))); in update_lft() 1615 p = osm_node_get_physp_ptr(p_sw->p_node, port); in update_lft() 1620 cl_ntoh64(osm_node_get_node_guid(p_sw->p_node))); in update_lft() 1646 p_sw->new_lft[lid] = port; in update_lft() 1649 osm_switch_count_path(p_sw, port); in update_lft() 1652 ret = osm_switch_set_hops(p_sw, lid, port, hops); in update_lft() 1658 (p_sw->p_node))); in update_lft() [all …]
|
H A D | osm_state_mgr.c | 118 osm_switch_t *p_sw = (osm_switch_t *) p_map_item; in state_mgr_reset_switch_count() local 120 if (p_sw->max_lid_ho != 0) in state_mgr_reset_switch_count() 121 p_sw->need_update = 1; in state_mgr_reset_switch_count() 130 osm_switch_t *const p_sw = (osm_switch_t *) p_object; in state_mgr_get_sw_info() local 136 p_node = p_sw->p_node; in state_mgr_get_sw_info() 646 osm_switch_t *p_sw = (osm_switch_t *) obj; in state_mgr_reset_state_change_bit() local 656 CL_ASSERT(p_sw); in state_mgr_reset_state_change_bit() 658 p_node = p_sw->p_node; in state_mgr_reset_state_change_bit() 665 if (!ib_switch_info_get_state_change(&p_sw->switch_info)) in state_mgr_reset_state_change_bit() 668 si = p_sw->switch_info; in state_mgr_reset_state_change_bit()
|
H A D | osm_drop_mgr.c | 308 osm_switch_t *p_sw; in drop_mgr_remove_switch() local 317 p_sw = (osm_switch_t *) cl_qmap_remove(p_sw_guid_tbl, node_guid); in drop_mgr_remove_switch() 318 if (p_sw == (osm_switch_t *) cl_qmap_end(p_sw_guid_tbl)) { in drop_mgr_remove_switch() 324 osm_switch_delete(&p_sw); in drop_mgr_remove_switch()
|