Lines Matching refs:p_osm
241 void osm_opensm_construct(IN osm_opensm_t * p_osm) in osm_opensm_construct() argument
243 memset(p_osm, 0, sizeof(*p_osm)); in osm_opensm_construct()
244 p_osm->osm_version = OSM_VERSION; in osm_opensm_construct()
245 osm_subn_construct(&p_osm->subn); in osm_opensm_construct()
246 osm_db_construct(&p_osm->db); in osm_opensm_construct()
247 osm_log_construct(&p_osm->log); in osm_opensm_construct()
250 void osm_opensm_construct_finish(IN osm_opensm_t * p_osm) in osm_opensm_construct_finish() argument
252 osm_sm_construct(&p_osm->sm); in osm_opensm_construct_finish()
253 osm_sa_construct(&p_osm->sa); in osm_opensm_construct_finish()
254 osm_mad_pool_construct(&p_osm->mad_pool); in osm_opensm_construct_finish()
255 p_osm->mad_pool_constructed = TRUE; in osm_opensm_construct_finish()
256 osm_vl15_construct(&p_osm->vl15); in osm_opensm_construct_finish()
257 p_osm->vl15_constructed = TRUE; in osm_opensm_construct_finish()
285 void osm_opensm_destroy(IN osm_opensm_t * p_osm) in osm_opensm_destroy() argument
293 if (p_osm->sm.mad_ctrl.h_bind) in osm_opensm_destroy()
294 osm_vendor_set_sm(p_osm->sm.mad_ctrl.h_bind, FALSE); in osm_opensm_destroy()
298 osm_perfmgr_shutdown(&p_osm->perfmgr); in osm_opensm_destroy()
301 osm_congestion_control_shutdown(&p_osm->cc); in osm_opensm_destroy()
307 osm_sm_shutdown(&p_osm->sm); in osm_opensm_destroy()
312 osm_sa_shutdown(&p_osm->sa); in osm_opensm_destroy()
315 osm_vl15_shutdown(&p_osm->vl15, &p_osm->mad_pool); in osm_opensm_destroy()
318 cl_disp_shutdown(&p_osm->disp); in osm_opensm_destroy()
319 if (p_osm->sa_set_disp_initialized) in osm_opensm_destroy()
320 cl_disp_shutdown(&p_osm->sa_set_disp); in osm_opensm_destroy()
323 if ((p_osm->sm.p_subn->sm_state == IB_SMINFO_STATE_MASTER) && in osm_opensm_destroy()
324 p_osm->subn.opt.sa_db_dump) in osm_opensm_destroy()
325 osm_sa_db_file_dump(p_osm); in osm_opensm_destroy()
328 destroy_plugins(p_osm); in osm_opensm_destroy()
329 destroy_routing_engines(p_osm); in osm_opensm_destroy()
330 osm_sa_destroy(&p_osm->sa); in osm_opensm_destroy()
331 osm_sm_destroy(&p_osm->sm); in osm_opensm_destroy()
333 osm_perfmgr_destroy(&p_osm->perfmgr); in osm_opensm_destroy()
335 osm_congestion_control_destroy(&p_osm->cc); in osm_opensm_destroy()
338 void osm_opensm_destroy_finish(IN osm_opensm_t * p_osm) in osm_opensm_destroy_finish() argument
340 osm_db_destroy(&p_osm->db); in osm_opensm_destroy_finish()
341 if (p_osm->vl15_constructed && p_osm->mad_pool_constructed) in osm_opensm_destroy_finish()
342 osm_vl15_destroy(&p_osm->vl15, &p_osm->mad_pool); in osm_opensm_destroy_finish()
343 if (p_osm->mad_pool_constructed) in osm_opensm_destroy_finish()
344 osm_mad_pool_destroy(&p_osm->mad_pool); in osm_opensm_destroy_finish()
345 p_osm->vl15_constructed = FALSE; in osm_opensm_destroy_finish()
346 p_osm->mad_pool_constructed = FALSE; in osm_opensm_destroy_finish()
347 osm_vendor_delete(&p_osm->p_vendor); in osm_opensm_destroy_finish()
348 osm_subn_destroy(&p_osm->subn); in osm_opensm_destroy_finish()
349 cl_disp_destroy(&p_osm->disp); in osm_opensm_destroy_finish()
350 if (p_osm->sa_set_disp_initialized) in osm_opensm_destroy_finish()
351 cl_disp_destroy(&p_osm->sa_set_disp); in osm_opensm_destroy_finish()
353 pthread_cond_destroy(&p_osm->stats.cond); in osm_opensm_destroy_finish()
354 pthread_mutex_destroy(&p_osm->stats.mutex); in osm_opensm_destroy_finish()
356 cl_event_destroy(&p_osm->stats.event); in osm_opensm_destroy_finish()
358 if (p_osm->node_name_map) in osm_opensm_destroy_finish()
359 close_node_name_map(p_osm->node_name_map); in osm_opensm_destroy_finish()
360 cl_plock_destroy(&p_osm->lock); in osm_opensm_destroy_finish()
362 osm_log_destroy(&p_osm->log); in osm_opensm_destroy_finish()
385 ib_api_status_t osm_opensm_init(IN osm_opensm_t * p_osm, in osm_opensm_init() argument
391 osm_opensm_construct(p_osm); in osm_opensm_init()
394 p_osm->log.daemon = 1; in osm_opensm_init()
396 status = osm_log_init_v2(&p_osm->log, p_opt->force_log_flush, in osm_opensm_init()
401 p_osm->log.log_prefix = p_opt->log_prefix; in osm_opensm_init()
404 osm_log_v2(&p_osm->log, in osm_opensm_init()
405 osm_log_get_level(&p_osm->log) & (OSM_LOG_SYS ^ 0xFF), in osm_opensm_init()
406 FILE_ID, "%s\n", p_osm->osm_version); in osm_opensm_init()
408 osm_log_v2(&p_osm->log, OSM_LOG_SYS, FILE_ID, "%s\n", p_osm->osm_version); /* Format Waived */ in osm_opensm_init()
410 OSM_LOG(&p_osm->log, OSM_LOG_FUNCS, "[\n"); /* Format Waived */ in osm_opensm_init()
412 status = cl_plock_init(&p_osm->lock); in osm_opensm_init()
417 pthread_mutex_init(&p_osm->stats.mutex, NULL); in osm_opensm_init()
418 pthread_cond_init(&p_osm->stats.cond, NULL); in osm_opensm_init()
420 status = cl_event_init(&p_osm->stats.event, FALSE); in osm_opensm_init()
426 OSM_LOG(&p_osm->log, OSM_LOG_INFO, in osm_opensm_init()
428 status = cl_disp_init(&p_osm->disp, 1, "opensm"); in osm_opensm_init()
434 status = cl_disp_init(&p_osm->disp, 0, "opensm"); in osm_opensm_init()
442 p_osm->sa_set_disp_initialized = FALSE; in osm_opensm_init()
444 status = cl_disp_init(&p_osm->sa_set_disp, 1, "subnadmin_set"); in osm_opensm_init()
447 p_osm->sa_set_disp_initialized = TRUE; in osm_opensm_init()
451 status = osm_db_init(&p_osm->db, &p_osm->log); in osm_opensm_init()
455 status = osm_subn_init(&p_osm->subn, p_osm, p_opt); in osm_opensm_init()
459 p_osm->p_vendor = in osm_opensm_init()
460 osm_vendor_new(&p_osm->log, p_opt->transaction_timeout); in osm_opensm_init()
461 if (p_osm->p_vendor == NULL) in osm_opensm_init()
465 OSM_LOG(&p_osm->log, OSM_LOG_FUNCS, "]\n"); /* Format Waived */ in osm_opensm_init()
469 ib_api_status_t osm_opensm_init_finish(IN osm_opensm_t * p_osm, in osm_opensm_init_finish() argument
474 osm_opensm_construct_finish(p_osm); in osm_opensm_init_finish()
476 p_osm->subn.sm_port_guid = p_opt->guid; in osm_opensm_init_finish()
478 status = osm_mad_pool_init(&p_osm->mad_pool); in osm_opensm_init_finish()
482 status = osm_vl15_init(&p_osm->vl15, p_osm->p_vendor, in osm_opensm_init_finish()
483 &p_osm->log, &p_osm->stats, &p_osm->subn, in osm_opensm_init_finish()
489 status = osm_sm_init(&p_osm->sm, &p_osm->subn, &p_osm->db, in osm_opensm_init_finish()
490 p_osm->p_vendor, &p_osm->mad_pool, &p_osm->vl15, in osm_opensm_init_finish()
491 &p_osm->log, &p_osm->stats, &p_osm->disp, in osm_opensm_init_finish()
492 &p_osm->lock); in osm_opensm_init_finish()
496 status = osm_sa_init(&p_osm->sm, &p_osm->sa, &p_osm->subn, in osm_opensm_init_finish()
497 p_osm->p_vendor, &p_osm->mad_pool, &p_osm->log, in osm_opensm_init_finish()
498 &p_osm->stats, &p_osm->disp, in osm_opensm_init_finish()
499 p_opt->single_thread ? NULL : &p_osm->sa_set_disp, in osm_opensm_init_finish()
500 &p_osm->lock); in osm_opensm_init_finish()
504 cl_qlist_init(&p_osm->plugin_list); in osm_opensm_init_finish()
507 load_plugins(p_osm, p_opt->event_plugin_name); in osm_opensm_init_finish()
510 status = osm_perfmgr_init(&p_osm->perfmgr, p_osm, p_opt); in osm_opensm_init_finish()
515 status = osm_congestion_control_init(&p_osm->cc, in osm_opensm_init_finish()
516 p_osm, p_opt); in osm_opensm_init_finish()
520 p_osm->no_fallback_routing_engine = FALSE; in osm_opensm_init_finish()
522 setup_routing_engines(p_osm, p_opt->routing_engine_names); in osm_opensm_init_finish()
524 p_osm->routing_engine_used = NULL /* OSM_ROUTING_ENGINE_TYPE_NONE */; in osm_opensm_init_finish()
526 p_osm->node_name_map = open_node_name_map(p_opt->node_name_map_name); in osm_opensm_init_finish()
529 OSM_LOG(&p_osm->log, OSM_LOG_FUNCS, "]\n"); /* Format Waived */ in osm_opensm_init_finish()
533 ib_api_status_t osm_opensm_bind(IN osm_opensm_t * p_osm, IN ib_net64_t guid) in osm_opensm_bind() argument
537 OSM_LOG_ENTER(&p_osm->log); in osm_opensm_bind()
539 status = osm_sm_bind(&p_osm->sm, guid); in osm_opensm_bind()
543 status = osm_sa_bind(&p_osm->sa, guid); in osm_opensm_bind()
548 status = osm_perfmgr_bind(&p_osm->perfmgr, guid); in osm_opensm_bind()
553 status = osm_congestion_control_bind(&p_osm->cc, guid); in osm_opensm_bind()
558 OSM_LOG(&p_osm->log, OSM_LOG_INFO, "Setting IS_SM on port 0x%016" PRIx64 "\n", in osm_opensm_bind()
560 osm_vendor_set_sm(p_osm->sm.mad_ctrl.h_bind, TRUE); in osm_opensm_bind()
563 OSM_LOG_EXIT(&p_osm->log); in osm_opensm_bind()