@@ -247,6 +247,8 @@ void osm_perfmgr_dump_counters(osm_perfmgr_t * p_perfmgr,
perfmgr_db_dump_t dump_type);
void osm_perfmgr_print_counters(osm_perfmgr_t *pm, char *nodename, FILE *fp,
char *port, int err_only);
+void osm_perfmgr_update_nodename(osm_perfmgr_t *pm, uint64_t node_guid,
+ char *nodename);
ib_api_status_t osm_perfmgr_bind(osm_perfmgr_t * p_perfmgr,
ib_net64_t port_guid);
@@ -164,6 +164,9 @@ perfmgr_db_err_t perfmgr_db_create_entry(perfmgr_db_t * db, uint64_t guid,
perfmgr_db_err_t perfmgr_db_delete_entry(perfmgr_db_t * db, uint64_t guid);
perfmgr_db_err_t perfmgr_db_delete_inactive(perfmgr_db_t * db, unsigned *cnt);
+perfmgr_db_err_t perfmgr_db_update_name(perfmgr_db_t * db, uint64_t node_guid,
+ char *name);
+
perfmgr_db_err_t perfmgr_db_add_err_reading(perfmgr_db_t * db, uint64_t guid,
uint8_t port,
perfmgr_db_err_reading_t * reading);
@@ -79,6 +79,13 @@ static void nd_rcv_process_nd(IN osm_sm_t * sm, IN osm_node_t * p_node,
free(p_node->print_desc);
p_node->print_desc = tmp_desc;
+#ifdef ENABLE_OSM_PERF_MGR
+ /* update the perfmgr entry if available */
+ osm_perfmgr_update_nodename(&sm->p_subn->p_osm->perfmgr,
+ cl_ntoh64(osm_node_get_node_guid(p_node)),
+ p_node->print_desc);
+#endif /* ENABLE_OSM_PERF_MGR */
+
OSM_LOG(sm->p_log, OSM_LOG_VERBOSE,
"Node 0x%" PRIx64 "\n\t\t\t\tDescription = %s\n",
cl_ntoh64(osm_node_get_node_guid(p_node)), p_node->print_desc);
@@ -1459,4 +1459,10 @@ void osm_perfmgr_print_counters(osm_perfmgr_t * pm, char *nodename, FILE * fp,
} else
perfmgr_db_print_all(pm->db, fp, err_only);
}
+void osm_perfmgr_update_nodename(osm_perfmgr_t *pm, uint64_t node_guid,
+ char *nodename)
+{
+ if (pm->db)
+ perfmgr_db_update_name(pm->db, node_guid, nodename);
+}
#endif /* ENABLE_OSM_PERF_MGR */
@@ -197,6 +197,19 @@ Exit:
}
perfmgr_db_err_t
+perfmgr_db_update_name(perfmgr_db_t * db, uint64_t node_guid, char *name)
+{
+ db_node_t *node = NULL;
+
+ cl_plock_excl_acquire(&db->lock);
+ node = get(db, node_guid);
+ if (node)
+ snprintf(node->node_name, sizeof(node->node_name), "%s", name);
+ cl_plock_release(&db->lock);
+ return (PERFMGR_EVENT_DB_SUCCESS);
+}
+
+perfmgr_db_err_t
perfmgr_db_delete_entry(perfmgr_db_t * db, uint64_t guid)
{
cl_map_item_t * rc = cl_qmap_remove(&db->pc_data, guid);
Changes since V1: Fix use of parens nit from Hal Signed-off-by: Ira Weiny <weiny2@llnl.gov> --- include/opensm/osm_perfmgr.h | 2 ++ include/opensm/osm_perfmgr_db.h | 3 +++ opensm/osm_node_desc_rcv.c | 7 +++++++ opensm/osm_perfmgr.c | 6 ++++++ opensm/osm_perfmgr_db.c | 13 +++++++++++++ 5 files changed, 31 insertions(+), 0 deletions(-)