Lines Matching full:pm
125 static void init_monitored_nodes(osm_perfmgr_t * pm) in init_monitored_nodes() argument
127 cl_qmap_init(&pm->monitored_map); in init_monitored_nodes()
128 pm->remove_list = NULL; in init_monitored_nodes()
129 cl_event_construct(&pm->sig_query); in init_monitored_nodes()
130 cl_event_init(&pm->sig_query, FALSE); in init_monitored_nodes()
133 static void mark_for_removal(osm_perfmgr_t * pm, monitored_node_t * node) in mark_for_removal() argument
135 if (pm->remove_list) { in mark_for_removal()
136 node->next = pm->remove_list; in mark_for_removal()
137 pm->remove_list = node; in mark_for_removal()
140 pm->remove_list = node; in mark_for_removal()
144 static void remove_marked_nodes(osm_perfmgr_t * pm) in remove_marked_nodes() argument
146 while (pm->remove_list) { in remove_marked_nodes()
147 monitored_node_t *next = pm->remove_list->next; in remove_marked_nodes()
150 cl_qmap_remove_item(&pm->monitored_map, in remove_marked_nodes()
151 (cl_map_item_t *) (pm->remove_list)); in remove_marked_nodes()
153 if (pm->rm_nodes) in remove_marked_nodes()
154 perfmgr_db_delete_entry(pm->db, pm->remove_list->guid); in remove_marked_nodes()
156 perfmgr_db_mark_active(pm->db, pm->remove_list->guid, FALSE); in remove_marked_nodes()
158 if (pm->remove_list->name) in remove_marked_nodes()
159 free(pm->remove_list->name); in remove_marked_nodes()
161 for (port = pm->remove_list->esp0 ? 0 : 1; in remove_marked_nodes()
162 port < pm->remove_list->num_ports; in remove_marked_nodes()
164 if (pm->remove_list->port[port].remote_name) in remove_marked_nodes()
165 free(pm->remove_list->port[port].remote_name); in remove_marked_nodes()
168 free(pm->remove_list); in remove_marked_nodes()
169 pm->remove_list = next; in remove_marked_nodes()
173 static inline void decrement_outstanding_queries(osm_perfmgr_t * pm) in decrement_outstanding_queries() argument
175 cl_atomic_dec(&pm->outstanding_queries); in decrement_outstanding_queries()
177 if (!pm->outstanding_queries) { in decrement_outstanding_queries()
178 cl_spinlock_acquire(&pm->lock); in decrement_outstanding_queries()
179 if (pm->sweep_state == PERFMGR_SWEEP_POST_PROCESSING) { in decrement_outstanding_queries()
180 pm->sweep_state = PERFMGR_SWEEP_SLEEP; in decrement_outstanding_queries()
181 OSM_LOG(pm->log, OSM_LOG_INFO, in decrement_outstanding_queries()
182 "PM sweep state exiting Post Processing\n"); in decrement_outstanding_queries()
184 cl_spinlock_release(&pm->lock); in decrement_outstanding_queries()
187 cl_event_signal(&pm->sig_query); in decrement_outstanding_queries()
197 osm_perfmgr_t *pm = (osm_perfmgr_t *) bind_context; in perfmgr_mad_recv_callback() local
199 OSM_LOG_ENTER(pm->log); in perfmgr_mad_recv_callback()
205 osm_mad_pool_put(pm->mad_pool, p_req_madw); in perfmgr_mad_recv_callback()
207 decrement_outstanding_queries(pm); in perfmgr_mad_recv_callback()
210 if (cl_disp_post(pm->pc_disp_h, OSM_MSG_MAD_PORT_COUNTERS, in perfmgr_mad_recv_callback()
212 OSM_LOG(pm->log, OSM_LOG_ERROR, "ERR 5401: " in perfmgr_mad_recv_callback()
214 osm_mad_pool_put(pm->mad_pool, p_madw); in perfmgr_mad_recv_callback()
216 OSM_LOG_EXIT(pm->log); in perfmgr_mad_recv_callback()
225 osm_perfmgr_t *pm = (osm_perfmgr_t *) bind_context; in perfmgr_mad_send_err_callback() local
233 OSM_LOG_ENTER(pm->log); in perfmgr_mad_send_err_callback()
239 if ((p_node = cl_qmap_get(&pm->monitored_map, node_guid)) == in perfmgr_mad_send_err_callback()
240 cl_qmap_end(&pm->monitored_map)) { in perfmgr_mad_send_err_callback()
241 OSM_LOG(pm->log, OSM_LOG_ERROR, "ERR 5415: GUID 0x%016" in perfmgr_mad_send_err_callback()
247 OSM_LOG(pm->log, OSM_LOG_ERROR, "ERR 5402: %s (0x%" PRIx64 in perfmgr_mad_send_err_callback()
253 if (pm->subn->opt.perfmgr_redir && p_madw->status == IB_TIMEOUT) { in perfmgr_mad_send_err_callback()
255 cl_plock_acquire(&pm->osm->lock); in perfmgr_mad_send_err_callback()
258 cl_plock_release(&pm->osm->lock); in perfmgr_mad_send_err_callback()
259 OSM_LOG(pm->log, OSM_LOG_ERROR, "ERR 5416: " in perfmgr_mad_send_err_callback()
271 cl_plock_release(&pm->osm->lock); in perfmgr_mad_send_err_callback()
275 osm_mad_pool_put(pm->mad_pool, p_madw); in perfmgr_mad_send_err_callback()
277 decrement_outstanding_queries(pm); in perfmgr_mad_send_err_callback()
279 OSM_LOG_EXIT(pm->log); in perfmgr_mad_send_err_callback()
285 ib_api_status_t osm_perfmgr_bind(osm_perfmgr_t * pm, ib_net64_t port_guid) in osm_perfmgr_bind() argument
290 OSM_LOG_ENTER(pm->log); in osm_perfmgr_bind()
292 if (pm->bind_handle != OSM_BIND_INVALID_HANDLE) { in osm_perfmgr_bind()
293 OSM_LOG(pm->log, OSM_LOG_ERROR, in osm_perfmgr_bind()
299 bind_info.port_guid = pm->port_guid = port_guid; in osm_perfmgr_bind()
307 bind_info.timeout = pm->subn->opt.transaction_timeout; in osm_perfmgr_bind()
308 bind_info.retries = pm->subn->opt.transaction_retries; in osm_perfmgr_bind()
310 OSM_LOG(pm->log, OSM_LOG_VERBOSE, in osm_perfmgr_bind()
313 pm->bind_handle = osm_vendor_bind(pm->vendor, &bind_info, pm->mad_pool, in osm_perfmgr_bind()
315 perfmgr_mad_send_err_callback, pm); in osm_perfmgr_bind()
317 if (pm->bind_handle == OSM_BIND_INVALID_HANDLE) { in osm_perfmgr_bind()
319 OSM_LOG(pm->log, OSM_LOG_ERROR, in osm_perfmgr_bind()
325 OSM_LOG_EXIT(pm->log); in osm_perfmgr_bind()
332 static void perfmgr_mad_unbind(osm_perfmgr_t * pm) in perfmgr_mad_unbind() argument
334 OSM_LOG_ENTER(pm->log); in perfmgr_mad_unbind()
335 if (pm->bind_handle == OSM_BIND_INVALID_HANDLE) { in perfmgr_mad_unbind()
336 OSM_LOG(pm->log, OSM_LOG_ERROR, "ERR 5405: No previous bind\n"); in perfmgr_mad_unbind()
339 osm_vendor_unbind(pm->bind_handle); in perfmgr_mad_unbind()
341 OSM_LOG_EXIT(pm->log); in perfmgr_mad_unbind()
466 "PM sweep state going into Post Processing\n"); in perfmgr_send_mad()
531 osm_perfmgr_t *pm = (osm_perfmgr_t *) context; in collect_guids() local
536 OSM_LOG_ENTER(pm->log); in collect_guids()
538 if (cl_qmap_get(&pm->monitored_map, node_guid) == in collect_guids()
539 cl_qmap_end(&pm->monitored_map)) { in collect_guids()
541 if (pm->ignore_cas && in collect_guids()
550 OSM_LOG(pm->log, OSM_LOG_ERROR, "PerfMgr: ERR 5406: " in collect_guids()
588 cl_qmap_insert(&pm->monitored_map, node_guid, in collect_guids()
593 OSM_LOG_EXIT(pm->log); in collect_guids()
599 static ib_api_status_t perfmgr_send_cpi_mad(osm_perfmgr_t * pm, in perfmgr_send_cpi_mad() argument
610 OSM_LOG_ENTER(pm->log); in perfmgr_send_cpi_mad()
613 p_madw = perfmgr_build_mad(pm, dest_lid, sl, dest_qp, in perfmgr_send_cpi_mad()
620 status = perfmgr_send_mad(pm, p_madw); in perfmgr_send_cpi_mad()
622 OSM_LOG_EXIT(pm->log); in perfmgr_send_cpi_mad()
699 osm_perfmgr_t *pm = context; in perfmgr_query_counters() local
707 OSM_LOG_ENTER(pm->log); in perfmgr_query_counters()
709 cl_plock_acquire(&pm->osm->lock); in perfmgr_query_counters()
710 node = osm_get_node_by_guid(pm->subn, cl_hton64(mon_node->guid)); in perfmgr_query_counters()
712 OSM_LOG(pm->log, OSM_LOG_ERROR, in perfmgr_query_counters()
716 mark_for_removal(pm, mon_node); in perfmgr_query_counters()
724 if (perfmgr_db_create_entry(pm->db, node_guid, mon_node->esp0, in perfmgr_query_counters()
727 OSM_LOG(pm->log, OSM_LOG_ERROR, in perfmgr_query_counters()
734 perfmgr_db_mark_active(pm->db, node_guid, TRUE); in perfmgr_query_counters()
748 OSM_LOG(pm->log, OSM_LOG_DEBUG, "WARN: node 0x%" PRIx64 in perfmgr_query_counters()
761 if (pm->query_cpi && !mon_node->port[port].cpi_valid) { in perfmgr_query_counters()
762 status = perfmgr_send_cpi_mad(pm, lid, remote_qp, in perfmgr_query_counters()
767 OSM_LOG(pm->log, OSM_LOG_ERROR, "ERR 5410: " in perfmgr_query_counters()
781 OSM_LOG(pm->log, OSM_LOG_VERBOSE, "Getting stats for node 0x%" in perfmgr_query_counters()
785 status = perfmgr_send_pc_mad(pm, lid, remote_qp, in perfmgr_query_counters()
793 OSM_LOG(pm->log, OSM_LOG_ERROR, "ERR 5409: " in perfmgr_query_counters()
804 status = perfmgr_send_pce_mad(pm, lid, remote_qp, in perfmgr_query_counters()
811 OSM_LOG(pm->log, OSM_LOG_ERROR, in perfmgr_query_counters()
823 cl_plock_release(&pm->osm->lock); in perfmgr_query_counters()
824 OSM_LOG_EXIT(pm->log); in perfmgr_query_counters()
1049 void osm_perfmgr_process(osm_perfmgr_t * pm) in osm_perfmgr_process() argument
1055 if (pm->state != PERFMGR_STATE_ENABLED) in osm_perfmgr_process()
1058 cl_spinlock_acquire(&pm->lock); in osm_perfmgr_process()
1059 if (pm->sweep_state == PERFMGR_SWEEP_ACTIVE || in osm_perfmgr_process()
1060 pm->sweep_state == PERFMGR_SWEEP_SUSPENDED || in osm_perfmgr_process()
1061 pm->sweep_state == PERFMGR_SWEEP_POST_PROCESSING) { in osm_perfmgr_process()
1062 cl_spinlock_release(&pm->lock); in osm_perfmgr_process()
1063 OSM_LOG(pm->log, OSM_LOG_INFO, in osm_perfmgr_process()
1064 "PM sweep state %d, skipping sweep\n", in osm_perfmgr_process()
1065 pm->sweep_state); in osm_perfmgr_process()
1069 pm->sweep_state = PERFMGR_SWEEP_ACTIVE; in osm_perfmgr_process()
1070 cl_spinlock_release(&pm->lock); in osm_perfmgr_process()
1072 if (pm->subn->sm_state == IB_SMINFO_STATE_STANDBY || in osm_perfmgr_process()
1073 pm->subn->sm_state == IB_SMINFO_STATE_NOTACTIVE) in osm_perfmgr_process()
1074 perfmgr_discovery(pm->subn->p_osm); in osm_perfmgr_process()
1077 if (pm->subn->opt.perfmgr_redir && pm->local_port == -1) { in osm_perfmgr_process()
1081 CL_PLOCK_ACQUIRE(pm->sm->p_lock); in osm_perfmgr_process()
1082 p_port = osm_get_port_by_guid(pm->subn, pm->port_guid); in osm_perfmgr_process()
1086 pm->local_port = in osm_perfmgr_process()
1089 OSM_LOG(pm->log, OSM_LOG_ERROR, in osm_perfmgr_process()
1092 cl_ntoh64(pm->port_guid)); in osm_perfmgr_process()
1093 CL_PLOCK_RELEASE(pm->sm->p_lock); in osm_perfmgr_process()
1103 OSM_LOG(pm->log, OSM_LOG_VERBOSE, "Gathering PerfMgr stats\n"); in osm_perfmgr_process()
1104 cl_plock_acquire(&pm->osm->lock); in osm_perfmgr_process()
1105 cl_qmap_apply_func(&pm->subn->node_guid_tbl, collect_guids, pm); in osm_perfmgr_process()
1106 cl_plock_release(&pm->osm->lock); in osm_perfmgr_process()
1109 cl_qmap_apply_func(&pm->monitored_map, perfmgr_query_counters, pm); in osm_perfmgr_process()
1112 remove_marked_nodes(pm); in osm_perfmgr_process()
1117 osm_log_v2(pm->log, OSM_LOG_INFO, FILE_ID, in osm_perfmgr_process()
1127 cl_spinlock_acquire(&pm->lock); in osm_perfmgr_process()
1128 pm->sweep_state = PERFMGR_SWEEP_SLEEP; in osm_perfmgr_process()
1129 cl_spinlock_release(&pm->lock); in osm_perfmgr_process()
1138 osm_perfmgr_t *pm = arg; in perfmgr_sweep() local
1140 osm_sm_signal(pm->sm, OSM_SIGNAL_PERFMGR_SWEEP); in perfmgr_sweep()
1141 cl_timer_start(&pm->sweep_timer, pm->sweep_time_s * 1000); in perfmgr_sweep()
1144 void osm_perfmgr_shutdown(osm_perfmgr_t * pm) in osm_perfmgr_shutdown() argument
1146 OSM_LOG_ENTER(pm->log); in osm_perfmgr_shutdown()
1147 cl_timer_stop(&pm->sweep_timer); in osm_perfmgr_shutdown()
1148 cl_disp_unregister(pm->pc_disp_h); in osm_perfmgr_shutdown()
1149 perfmgr_mad_unbind(pm); in osm_perfmgr_shutdown()
1150 OSM_LOG_EXIT(pm->log); in osm_perfmgr_shutdown()
1153 void osm_perfmgr_destroy(osm_perfmgr_t * pm) in osm_perfmgr_destroy() argument
1155 OSM_LOG_ENTER(pm->log); in osm_perfmgr_destroy()
1156 perfmgr_db_destroy(pm->db); in osm_perfmgr_destroy()
1157 cl_timer_destroy(&pm->sweep_timer); in osm_perfmgr_destroy()
1158 OSM_LOG_EXIT(pm->log); in osm_perfmgr_destroy()
1170 static void perfmgr_check_oob_clear(osm_perfmgr_t * pm, in perfmgr_check_oob_clear() argument
1176 if (perfmgr_db_get_prev_err(pm->db, mon_node->guid, port, &prev_err) in perfmgr_check_oob_clear()
1178 OSM_LOG(pm->log, OSM_LOG_VERBOSE, "Failed to find previous " in perfmgr_check_oob_clear()
1184 OSM_LOG(pm->log, OSM_LOG_DEBUG, in perfmgr_check_oob_clear()
1228 OSM_LOG(pm->log, OSM_LOG_ERROR, "PerfMgr: ERR 540A: " in perfmgr_check_oob_clear()
1232 perfmgr_db_clear_prev_err(pm->db, mon_node->guid, port); in perfmgr_check_oob_clear()
1269 static void perfmgr_check_overflow(osm_perfmgr_t * pm, in perfmgr_check_overflow() argument
1280 OSM_LOG_ENTER(pm->log); in perfmgr_check_overflow()
1306 osm_log_v2(pm->log, OSM_LOG_VERBOSE, FILE_ID, in perfmgr_check_overflow()
1311 cl_plock_acquire(&pm->osm->lock); in perfmgr_check_overflow()
1313 osm_get_node_by_guid(pm->subn, cl_hton64(mon_node->guid)); in perfmgr_check_overflow()
1315 OSM_LOG(pm->log, OSM_LOG_ERROR, in perfmgr_check_overflow()
1323 cl_plock_release(&pm->osm->lock); in perfmgr_check_overflow()
1325 OSM_LOG(pm->log, OSM_LOG_ERROR, "PerfMgr: ERR 540C: " in perfmgr_check_overflow()
1353 status = perfmgr_send_pc_mad(pm, lid, remote_qp, pkey_ix, in perfmgr_check_overflow()
1360 OSM_LOG(pm->log, OSM_LOG_ERROR, "PerfMgr: ERR 5411: " in perfmgr_check_overflow()
1365 perfmgr_db_clear_prev_err(pm->db, mon_node->guid, port); in perfmgr_check_overflow()
1367 perfmgr_db_clear_prev_dc(pm->db, mon_node->guid, port); in perfmgr_check_overflow()
1371 OSM_LOG_EXIT(pm->log); in perfmgr_check_overflow()
1378 static void perfmgr_check_pce_overflow(osm_perfmgr_t * pm, in perfmgr_check_pce_overflow() argument
1388 OSM_LOG_ENTER(pm->log); in perfmgr_check_pce_overflow()
1405 osm_log(pm->log, OSM_LOG_VERBOSE, in perfmgr_check_pce_overflow()
1410 cl_plock_acquire(&pm->osm->lock); in perfmgr_check_pce_overflow()
1412 osm_get_node_by_guid(pm->subn, cl_hton64(mon_node->guid)); in perfmgr_check_pce_overflow()
1414 OSM_LOG(pm->log, OSM_LOG_ERROR, in perfmgr_check_pce_overflow()
1422 cl_plock_release(&pm->osm->lock); in perfmgr_check_pce_overflow()
1424 OSM_LOG(pm->log, OSM_LOG_ERROR, "PerfMgr: ERR 5418: " in perfmgr_check_pce_overflow()
1437 status = perfmgr_send_pce_mad(pm, lid, remote_qp, pkey_ix, in perfmgr_check_pce_overflow()
1442 OSM_LOG(pm->log, OSM_LOG_ERROR, "PerfMgr: ERR 5419: " in perfmgr_check_pce_overflow()
1447 perfmgr_db_clear_prev_dc(pm->db, mon_node->guid, port); in perfmgr_check_pce_overflow()
1451 OSM_LOG_EXIT(pm->log); in perfmgr_check_pce_overflow()
1457 static void perfmgr_log_errors(osm_perfmgr_t * pm, in perfmgr_log_errors() argument
1463 perfmgr_db_get_prev_err(pm->db, mon_node->guid, port, &prev_read); in perfmgr_log_errors()
1467 OSM_LOG(pm->log, OSM_LOG_VERBOSE, "Failed to find previous " in perfmgr_log_errors()
1476 OSM_LOG(pm->log, OSM_LOG_ERROR, "ERR %s: " \ in perfmgr_log_errors()
1487 OSM_LOG(pm->log, OSM_LOG_ERROR, "ERR %s: " \ in perfmgr_log_errors()
1510 if (pm->xmit_wait_log && cur > prev && in perfmgr_log_errors()
1511 (cur - prev) >= pm->xmit_wait_threshold) { in perfmgr_log_errors()
1512 OSM_LOG(pm->log, OSM_LOG_ERROR, "ERR 543D: XmitWait : %" PRIu64 in perfmgr_log_errors()
1518 static int16_t validate_redir_pkey(osm_perfmgr_t *pm, ib_net16_t pkey) in validate_redir_pkey() argument
1527 OSM_LOG_ENTER(pm->log); in validate_redir_pkey()
1529 CL_PLOCK_ACQUIRE(pm->sm->p_lock); in validate_redir_pkey()
1530 p_port = osm_get_port_by_guid(pm->subn, pm->port_guid); in validate_redir_pkey()
1532 CL_PLOCK_RELEASE(pm->sm->p_lock); in validate_redir_pkey()
1533 OSM_LOG(pm->log, OSM_LOG_ERROR, in validate_redir_pkey()
1540 CL_PLOCK_RELEASE(pm->sm->p_lock); in validate_redir_pkey()
1541 OSM_LOG(pm->log, OSM_LOG_VERBOSE, in validate_redir_pkey()
1548 CL_PLOCK_RELEASE(pm->sm->p_lock); in validate_redir_pkey()
1549 OSM_LOG(pm->log, OSM_LOG_VERBOSE, in validate_redir_pkey()
1556 CL_PLOCK_RELEASE(pm->sm->p_lock); in validate_redir_pkey()
1559 CL_PLOCK_RELEASE(pm->sm->p_lock); in validate_redir_pkey()
1560 OSM_LOG(pm->log, OSM_LOG_ERROR, in validate_redir_pkey()
1566 CL_PLOCK_RELEASE(pm->sm->p_lock); in validate_redir_pkey()
1567 OSM_LOG(pm->log, OSM_LOG_ERROR, in validate_redir_pkey()
1572 OSM_LOG_EXIT(pm->log); in validate_redir_pkey()
1576 static boolean_t handle_redirect(osm_perfmgr_t *pm, in handle_redirect() argument
1588 OSM_LOG(pm->log, OSM_LOG_VERBOSE, in handle_redirect()
1594 if (!pm->subn->opt.perfmgr_redir) { in handle_redirect()
1595 OSM_LOG(pm->log, OSM_LOG_VERBOSE, in handle_redirect()
1603 OSM_LOG(pm->log, OSM_LOG_VERBOSE, in handle_redirect()
1610 OSM_LOG(pm->log, OSM_LOG_VERBOSE, "Invalid RedirectQP\n"); in handle_redirect()
1614 OSM_LOG(pm->log, OSM_LOG_VERBOSE, "Invalid RedirectP_Key\n"); in handle_redirect()
1618 OSM_LOG(pm->log, OSM_LOG_VERBOSE, "Invalid RedirectQ_Key\n"); in handle_redirect()
1622 pkey_ix = validate_redir_pkey(pm, cpi->redir_pkey); in handle_redirect()
1624 OSM_LOG(pm->log, OSM_LOG_VERBOSE, in handle_redirect()
1632 OSM_LOG(pm->log, OSM_LOG_VERBOSE, in handle_redirect()
1641 cl_plock_acquire(&pm->osm->lock); in handle_redirect()
1651 cl_plock_release(&pm->osm->lock); in handle_redirect()
1654 if (pm->query_cpi) in handle_redirect()
1659 status = perfmgr_send_cpi_mad(pm, cpi->redir_lid, in handle_redirect()
1675 status = perfmgr_send_pc_mad(pm, cpi->redir_lid, in handle_redirect()
1684 status = perfmgr_send_pce_mad(pm, cpi->redir_lid, in handle_redirect()
1693 OSM_LOG(pm->log, OSM_LOG_ERROR, "ERR 5414: " in handle_redirect()
1711 static void perfmgr_check_data_cnt_oob_clear(osm_perfmgr_t * pm, in perfmgr_check_data_cnt_oob_clear() argument
1718 if (perfmgr_db_get_prev_dc(pm->db, mon_node->guid, port, &prev_dc) in perfmgr_check_data_cnt_oob_clear()
1720 OSM_LOG(pm->log, OSM_LOG_VERBOSE, in perfmgr_check_data_cnt_oob_clear()
1727 OSM_LOG(pm->log, OSM_LOG_DEBUG, in perfmgr_check_data_cnt_oob_clear()
1757 OSM_LOG(pm->log, OSM_LOG_ERROR, in perfmgr_check_data_cnt_oob_clear()
1762 perfmgr_db_clear_prev_dc(pm->db, mon_node->guid, port); in perfmgr_check_data_cnt_oob_clear()
1772 osm_perfmgr_t *pm = context; in pc_recv_process() local
1784 OSM_LOG_ENTER(pm->log); in pc_recv_process()
1790 if ((p_node = cl_qmap_get(&pm->monitored_map, node_guid)) == in pc_recv_process()
1791 cl_qmap_end(&pm->monitored_map)) { in pc_recv_process()
1792 OSM_LOG(pm->log, OSM_LOG_ERROR, "ERR 5412: GUID 0x%016" in pc_recv_process()
1798 OSM_LOG(pm->log, OSM_LOG_VERBOSE, in pc_recv_process()
1806 cl_plock_acquire(&pm->osm->lock); in pc_recv_process()
1809 cl_plock_release(&pm->osm->lock); in pc_recv_process()
1810 OSM_LOG(pm->log, OSM_LOG_ERROR, "ERR 5413: " in pc_recv_process()
1816 cl_plock_release(&pm->osm->lock); in pc_recv_process()
1827 cpi_valid = handle_redirect(pm, cpi, p_mon_node, port, in pc_recv_process()
1830 if (pm->query_cpi && cpi_valid) { in pc_recv_process()
1831 cl_plock_acquire(&pm->osm->lock); in pc_recv_process()
1844 cl_plock_release(&pm->osm->lock); in pc_recv_process()
1863 perfmgr_check_data_cnt_oob_clear(pm, p_mon_node, port, in pc_recv_process()
1866 perfmgr_db_add_dc_reading(pm->db, node_guid, port, in pc_recv_process()
1871 perfmgr_db_clear_prev_dc(pm->db, node_guid, port); in pc_recv_process()
1874 perfmgr_check_pce_overflow(pm, p_mon_node, in pc_recv_process()
1890 perfmgr_check_oob_clear(pm, p_mon_node, port, &err_reading); in pc_recv_process()
1892 perfmgr_check_data_cnt_oob_clear(pm, p_mon_node, port, in pc_recv_process()
1896 if (pm->subn->opt.perfmgr_log_errors) in pc_recv_process()
1897 perfmgr_log_errors(pm, p_mon_node, port, &err_reading); in pc_recv_process()
1899 perfmgr_db_add_err_reading(pm->db, node_guid, port, in pc_recv_process()
1902 perfmgr_db_add_dc_reading(pm->db, node_guid, port, in pc_recv_process()
1905 perfmgr_db_clear_prev_err(pm->db, node_guid, port); in pc_recv_process()
1907 perfmgr_db_clear_prev_dc(pm->db, node_guid, port); in pc_recv_process()
1910 perfmgr_check_overflow(pm, p_mon_node, p_mon_node->port[port].pkey_ix, in pc_recv_process()
1926 osm_mad_pool_put(pm->mad_pool, p_madw); in pc_recv_process()
1928 OSM_LOG_EXIT(pm->log); in pc_recv_process()
1934 ib_api_status_t osm_perfmgr_init(osm_perfmgr_t * pm, osm_opensm_t * osm, in osm_perfmgr_init() argument
1943 memset(pm, 0, sizeof(*pm)); in osm_perfmgr_init()
1945 pm->subn = &osm->subn; in osm_perfmgr_init()
1946 pm->sm = &osm->sm; in osm_perfmgr_init()
1947 pm->log = &osm->log; in osm_perfmgr_init()
1948 pm->mad_pool = &osm->mad_pool; in osm_perfmgr_init()
1949 pm->vendor = osm->p_vendor; in osm_perfmgr_init()
1950 pm->trans_id = PERFMGR_INITIAL_TID_VALUE; in osm_perfmgr_init()
1951 pm->state = in osm_perfmgr_init()
1953 pm->sweep_state = PERFMGR_SWEEP_SLEEP; in osm_perfmgr_init()
1954 status = cl_spinlock_init(&pm->lock); in osm_perfmgr_init()
1957 pm->sweep_time_s = p_opt->perfmgr_sweep_time_s; in osm_perfmgr_init()
1958 pm->max_outstanding_queries = p_opt->perfmgr_max_outstanding_queries; in osm_perfmgr_init()
1959 pm->ignore_cas = p_opt->perfmgr_ignore_cas; in osm_perfmgr_init()
1960 pm->osm = osm; in osm_perfmgr_init()
1961 pm->local_port = -1; in osm_perfmgr_init()
1963 status = cl_timer_init(&pm->sweep_timer, perfmgr_sweep, pm); in osm_perfmgr_init()
1968 pm->db = perfmgr_db_construct(pm); in osm_perfmgr_init()
1969 if (!pm->db) { in osm_perfmgr_init()
1970 pm->state = PERFMGR_STATE_NO_DB; in osm_perfmgr_init()
1974 pm->pc_disp_h = cl_disp_register(&osm->disp, OSM_MSG_MAD_PORT_COUNTERS, in osm_perfmgr_init()
1975 pc_recv_process, pm); in osm_perfmgr_init()
1976 if (pm->pc_disp_h == CL_DISP_INVALID_HANDLE) { in osm_perfmgr_init()
1977 perfmgr_db_destroy(pm->db); in osm_perfmgr_init()
1981 init_monitored_nodes(pm); in osm_perfmgr_init()
1983 if (pm->state == PERFMGR_STATE_ENABLED) in osm_perfmgr_init()
1984 cl_timer_start(&pm->sweep_timer, pm->sweep_time_s * 1000); in osm_perfmgr_init()
1986 pm->rm_nodes = p_opt->perfmgr_rm_nodes; in osm_perfmgr_init()
1987 pm->query_cpi = p_opt->perfmgr_query_cpi; in osm_perfmgr_init()
1988 pm->xmit_wait_log = p_opt->perfmgr_xmit_wait_log; in osm_perfmgr_init()
1989 pm->xmit_wait_threshold = p_opt->perfmgr_xmit_wait_threshold; in osm_perfmgr_init()
1992 OSM_LOG_EXIT(pm->log); in osm_perfmgr_init()
1999 void osm_perfmgr_clear_counters(osm_perfmgr_t * pm) in osm_perfmgr_clear_counters() argument
2004 perfmgr_db_clear_counters(pm->db); in osm_perfmgr_clear_counters()
2005 osm_log_v2(pm->log, OSM_LOG_INFO, FILE_ID, "PerfMgr counters cleared\n"); in osm_perfmgr_clear_counters()
2011 void osm_perfmgr_dump_counters(osm_perfmgr_t * pm, perfmgr_db_dump_t dump_type) in osm_perfmgr_dump_counters() argument
2015 if (pm->subn->opt.event_db_dump_file) in osm_perfmgr_dump_counters()
2016 file_name = pm->subn->opt.event_db_dump_file; in osm_perfmgr_dump_counters()
2019 pm->subn->opt.dump_files_dir, in osm_perfmgr_dump_counters()
2023 if (perfmgr_db_dump(pm->db, file_name, dump_type) != 0) in osm_perfmgr_dump_counters()
2024 OSM_LOG(pm->log, OSM_LOG_ERROR, "Failed to dump file %s : %s", in osm_perfmgr_dump_counters()
2031 void osm_perfmgr_print_counters(osm_perfmgr_t * pm, char *nodename, FILE * fp, in osm_perfmgr_print_counters() argument
2038 perfmgr_db_print_by_name(pm->db, nodename, fp, port, in osm_perfmgr_print_counters()
2041 perfmgr_db_print_by_guid(pm->db, guid, fp, port, in osm_perfmgr_print_counters()
2044 perfmgr_db_print_all(pm->db, fp, err_only); in osm_perfmgr_print_counters()
2047 void osm_perfmgr_update_nodename(osm_perfmgr_t *pm, uint64_t node_guid, in osm_perfmgr_update_nodename() argument
2050 if (pm->db) in osm_perfmgr_update_nodename()
2051 perfmgr_db_update_name(pm->db, node_guid, nodename); in osm_perfmgr_update_nodename()