>From 5638ddc23276e0d83179d01fb0ee7bcd735f4ab0 Mon Sep 17 00:00:00 2001 From: Ira K. Weiny <[EMAIL PROTECTED]> Date: Thu, 10 Jul 2008 17:35:37 -0700 Subject: [PATCH] OpenSM: convert GID prints to use inet_ntop
Signed-off-by: Ira K. Weiny <[EMAIL PROTECTED]> --- opensm/opensm/osm_helper.c | 62 ++++---- opensm/opensm/osm_inform.c | 27 ++-- opensm/opensm/osm_perfmgr.c | 8 +- opensm/opensm/osm_sa_informinfo.c | 8 +- opensm/opensm/osm_sa_mcmember_record.c | 104 ++++++------- opensm/opensm/osm_sa_path_record.c | 8 +- opensm/osmtest/osmt_multicast.c | 268 ++++++++++++++------------------ 7 files changed, 224 insertions(+), 261 deletions(-) diff --git a/opensm/opensm/osm_helper.c b/opensm/opensm/osm_helper.c index 21ff51c..c415321 100644 --- a/opensm/opensm/osm_helper.c +++ b/opensm/opensm/osm_helper.c @@ -45,6 +45,7 @@ #include <stdlib.h> #include <stdio.h> #include <string.h> +#include <arpa/inet.h> #include <complib/cl_debug.h> #include <iba/ib_types.h> #include <opensm/osm_helper.h> @@ -1162,14 +1163,13 @@ osm_dump_mc_record(IN osm_log_t * const p_log, IN const ib_member_rec_t * const p_mcmr, IN const osm_log_level_t log_level) { - + char gid_str[INET6_ADDRSTRLEN]; + char gid_str2[INET6_ADDRSTRLEN]; if (osm_log_is_active(p_log, log_level)) { osm_log(p_log, log_level, "MCMember Record dump:\n" - "\t\t\t\tMGID....................0x%016" PRIx64 " : " - "0x%016" PRIx64 "\n" - "\t\t\t\tPortGid.................0x%016" PRIx64 " : " - "0x%016" PRIx64 "\n" + "\t\t\t\tMGID....................%s\n" + "\t\t\t\tPortGid.................%s\n" "\t\t\t\tqkey....................0x%X\n" "\t\t\t\tmlid....................0x%X\n" "\t\t\t\tmtu.....................0x%X\n" @@ -1181,10 +1181,10 @@ osm_dump_mc_record(IN osm_log_t * const p_log, "\t\t\t\tScopeState..............0x%X\n" "\t\t\t\tProxyJoin...............0x%X\n" "", - cl_ntoh64(p_mcmr->mgid.unicast.prefix), - cl_ntoh64(p_mcmr->mgid.unicast.interface_id), - cl_ntoh64(p_mcmr->port_gid.unicast.prefix), - cl_ntoh64(p_mcmr->port_gid.unicast.interface_id), + inet_ntop(AF_INET6, p_mcmr->mgid.raw, gid_str, + sizeof gid_str), + inet_ntop(AF_INET6, p_mcmr->port_gid.raw, gid_str2, + sizeof gid_str2), cl_ntoh32(p_mcmr->qkey), cl_ntoh16(p_mcmr->mlid), p_mcmr->mtu, @@ -1204,6 +1204,7 @@ osm_dump_service_record(IN osm_log_t * const p_log, IN const ib_service_record_t * const p_sr, IN const osm_log_level_t log_level) { + char gid_str[INET6_ADDRSTRLEN]; char buf_service_key[35]; char buf_service_name[65]; @@ -1231,8 +1232,7 @@ osm_dump_service_record(IN osm_log_t * const p_log, osm_log(p_log, log_level, "Service Record dump:\n" "\t\t\t\tServiceID...............0x%016" PRIx64 "\n" - "\t\t\t\tServiceGID..............0x%016" PRIx64 " : " - "0x%016" PRIx64 "\n" + "\t\t\t\tServiceGID..............%s\n" "\t\t\t\tServiceP_Key............0x%X\n" "\t\t\t\tServiceLease............0x%X\n" "\t\t\t\tServiceKey..............%s\n" @@ -1269,8 +1269,8 @@ osm_dump_service_record(IN osm_log_t * const p_log, "\t\t\t\tServiceData64.2.........0x%016" PRIx64 "\n" "", cl_ntoh64(p_sr->service_id), - cl_ntoh64(p_sr->service_gid.unicast.prefix), - cl_ntoh64(p_sr->service_gid.unicast.interface_id), + inet_ntop(AF_INET6, p_sr->service_gid.raw, gid_str, + sizeof gid_str), cl_ntoh16(p_sr->service_pkey), cl_ntoh32(p_sr->service_lease), buf_service_key, @@ -1376,6 +1376,8 @@ osm_dump_inform_info_record(IN osm_log_t * const p_log, IN const ib_inform_info_record_t * const p_iir, IN const osm_log_level_t log_level) { + char gid_str[INET6_ADDRSTRLEN]; + char gid_str2[INET6_ADDRSTRLEN]; uint32_t qpn; uint8_t resp_time_val; @@ -1389,12 +1391,10 @@ osm_dump_inform_info_record(IN osm_log_t * const p_log, osm_log(p_log, log_level, "InformInfo Record dump:\n" "\t\t\t\tRID\n" - "\t\t\t\tSubscriberGID...........0x%016" PRIx64 - " : " "0x%016" PRIx64 "\n" + "\t\t\t\tSubscriberGID...........%s\n" "\t\t\t\tSubscriberEnum..........0x%X\n" "\t\t\t\tInformInfo dump:\n" - "\t\t\t\tgid.....................0x%016" PRIx64 - " : 0x%016" PRIx64 "\n" + "\t\t\t\tgid.....................%s\n" "\t\t\t\tlid_range_begin.........%u\n" "\t\t\t\tlid_range_end...........%u\n" "\t\t\t\tis_generic..............0x%X\n" @@ -1404,14 +1404,11 @@ osm_dump_inform_info_record(IN osm_log_t * const p_log, "\t\t\t\tqpn.....................0x%06X\n" "\t\t\t\tresp_time_val...........0x%X\n" "\t\t\t\tnode_type...............0x%06X\n" "", - cl_ntoh64(p_iir->subscriber_gid.unicast.prefix), - cl_ntoh64(p_iir->subscriber_gid.unicast. - interface_id), + inet_ntop(AF_INET6, p_iir->subscriber_gid.raw, + gid_str, sizeof gid_str), cl_ntoh16(p_iir->subscriber_enum), - cl_ntoh64(p_iir->inform_info.gid.unicast. - prefix), - cl_ntoh64(p_iir->inform_info.gid.unicast. - interface_id), + inet_ntop(AF_INET6, p_iir->inform_info.gid.raw, + gid_str2, sizeof gid_str2), cl_ntoh16(p_iir->inform_info.lid_range_begin), cl_ntoh16(p_iir->inform_info.lid_range_end), p_iir->inform_info.is_generic, @@ -1427,12 +1424,10 @@ osm_dump_inform_info_record(IN osm_log_t * const p_log, osm_log(p_log, log_level, "InformInfo Record dump:\n" "\t\t\t\tRID\n" - "\t\t\t\tSubscriberGID...........0x%016" PRIx64 - " : " "0x%016" PRIx64 "\n" + "\t\t\t\tSubscriberGID...........%s\n" "\t\t\t\tSubscriberEnum..........0x%X\n" "\t\t\t\tInformInfo dump:\n" - "\t\t\t\tgid.....................0x%016" PRIx64 - " : 0x%016" PRIx64 "\n" + "\t\t\t\tgid.....................%s\n" "\t\t\t\tlid_range_begin.........%u\n" "\t\t\t\tlid_range_end...........%u\n" "\t\t\t\tis_generic..............0x%X\n" @@ -1442,14 +1437,11 @@ osm_dump_inform_info_record(IN osm_log_t * const p_log, "\t\t\t\tqpn.....................0x%06X\n" "\t\t\t\tresp_time_val...........0x%X\n" "\t\t\t\tvendor_id...............0x%06X\n" "", - cl_ntoh64(p_iir->subscriber_gid.unicast.prefix), - cl_ntoh64(p_iir->subscriber_gid.unicast. - interface_id), + inet_ntop(AF_INET6, p_iir->subscriber_gid.raw, + gid_str, sizeof gid_str), cl_ntoh16(p_iir->subscriber_enum), - cl_ntoh64(p_iir->inform_info.gid.unicast. - prefix), - cl_ntoh64(p_iir->inform_info.gid.unicast. - interface_id), + inet_ntop(AF_INET6, p_iir->inform_info.gid.raw, + gid_str2, sizeof gid_str2), cl_ntoh16(p_iir->inform_info.lid_range_begin), cl_ntoh16(p_iir->inform_info.lid_range_end), p_iir->inform_info.is_generic, diff --git a/opensm/opensm/osm_inform.c b/opensm/opensm/osm_inform.c index e6146f7..ad9ae35 100644 --- a/opensm/opensm/osm_inform.c +++ b/opensm/opensm/osm_inform.c @@ -44,6 +44,7 @@ #include <stdlib.h> #include <string.h> +#include <arpa/inet.h> #include <complib/cl_debug.h> #include <opensm/osm_helper.h> #include <opensm/osm_inform.h> @@ -281,14 +282,15 @@ void osm_infr_remove_from_db(IN osm_subn_t * p_subn, IN osm_log_t * p_log, IN osm_infr_t * p_infr) { + char gid_str[INET6_ADDRSTRLEN]; OSM_LOG_ENTER(p_log); OSM_LOG(p_log, OSM_LOG_DEBUG, - "Removing InformInfo Subscribing GID:0x%016" PRIx64 " : 0x%016" - PRIx64 " Enum:0x%X from Database\n", - cl_ntoh64(p_infr->inform_record.subscriber_gid.unicast.prefix), - cl_ntoh64(p_infr->inform_record.subscriber_gid.unicast. - interface_id), p_infr->inform_record.subscriber_enum); + "Removing InformInfo Subscribing GID:%s" + " Enum:0x%X from Database\n", + inet_ntop(AF_INET6, p_infr->inform_record.subscriber_gid.raw, + gid_str, sizeof gid_str), + p_infr->inform_record.subscriber_enum); osm_dump_inform_info(p_log, &(p_infr->inform_record.inform_info), OSM_LOG_DEBUG); @@ -560,6 +562,7 @@ ib_api_status_t osm_report_notice(IN osm_log_t * const p_log, IN osm_subn_t * p_subn, IN ib_mad_notice_attr_t * p_ntc) { + char gid_str[INET6_ADDRSTRLEN]; osm_infr_match_ctxt_t context; cl_list_t infr_to_remove_list; osm_infr_t *p_infr_rec; @@ -582,25 +585,23 @@ osm_report_notice(IN osm_log_t * const p_log, if (ib_notice_is_generic(p_ntc)) { OSM_LOG(p_log, OSM_LOG_INFO, "Reporting Generic Notice type:%u num:%u" - " from LID:%u GID:0x%016" PRIx64 - ",0x%016" PRIx64 "\n", + " from LID:%u GID:%s\n", ib_notice_get_type(p_ntc), cl_ntoh16(p_ntc->g_or_v.generic.trap_num), cl_ntoh16(p_ntc->issuer_lid), - cl_ntoh64(p_ntc->issuer_gid.unicast.prefix), - cl_ntoh64(p_ntc->issuer_gid.unicast.interface_id) + inet_ntop(AF_INET6, p_ntc->issuer_gid.raw, gid_str, + sizeof gid_str) ); } else { OSM_LOG(p_log, OSM_LOG_INFO, "Reporting Vendor Notice type:%u vend:%u dev:%u" - " from LID:%u GID:0x%016" PRIx64 - ",0x%016" PRIx64 "\n", + " from LID:%u GID:%s\n", ib_notice_get_type(p_ntc), cl_ntoh32(ib_notice_get_vend_id(p_ntc)), cl_ntoh16(p_ntc->g_or_v.vend.dev_id), cl_ntoh16(p_ntc->issuer_lid), - cl_ntoh64(p_ntc->issuer_gid.unicast.prefix), - cl_ntoh64(p_ntc->issuer_gid.unicast.interface_id) + inet_ntop(AF_INET6, p_ntc->issuer_gid.raw, gid_str, + sizeof gid_str) ); } diff --git a/opensm/opensm/osm_perfmgr.c b/opensm/opensm/osm_perfmgr.c index 9892335..e283fa7 100644 --- a/opensm/opensm/osm_perfmgr.c +++ b/opensm/opensm/osm_perfmgr.c @@ -55,6 +55,7 @@ #include <sys/time.h> #include <netinet/in.h> #include <float.h> +#include <arpa/inet.h> #include <iba/ib_types.h> #include <complib/cl_debug.h> #include <complib/cl_thread.h> @@ -1072,6 +1073,7 @@ osm_perfmgr_log_events(osm_perfmgr_t * pm, __monitored_node_t *mon_node, uint8_t **********************************************************************/ static void osm_pc_rcv_process(void *context, void *data) { + char gid_str[INET6_ADDRSTRLEN]; osm_perfmgr_t *const pm = (osm_perfmgr_t *) context; osm_madw_t *p_madw = (osm_madw_t *) data; osm_madw_context_t *mad_context = &(p_madw->context); @@ -1114,11 +1116,11 @@ static void osm_pc_rcv_process(void *context, void *data) OSM_LOG(pm->log, OSM_LOG_VERBOSE, "Redirection to LID %u " - "GID 0x%016" PRIx64 " : 0x%016" PRIx64 + "GID %s" " QP 0x%x received\n", cl_ntoh16(cpi->redir_lid), - cl_ntoh64(cpi->redir_gid.unicast.prefix), - cl_ntoh64(cpi->redir_gid.unicast.interface_id), + inet_ntop(AF_INET6, cpi->redir_gid.raw, gid_str, + sizeof gid_str), cl_ntoh32(cpi->redir_qp)); /* LID or GID redirection ? */ diff --git a/opensm/opensm/osm_sa_informinfo.c b/opensm/opensm/osm_sa_informinfo.c index 3bb2295..334d22e 100644 --- a/opensm/opensm/osm_sa_informinfo.c +++ b/opensm/opensm/osm_sa_informinfo.c @@ -46,6 +46,7 @@ #include <string.h> #include <iba/ib_types.h> +#include <arpa/inet.h> #include <complib/cl_qmap.h> #include <complib/cl_passivelock.h> #include <complib/cl_debug.h> @@ -336,6 +337,7 @@ static void osm_infr_rcv_process_get_method(IN osm_sa_t * sa, IN osm_madw_t * const p_madw) { + char gid_str[INET6_ADDRSTRLEN]; ib_sa_mad_t *p_rcvd_mad; const ib_inform_info_record_t *p_rcvd_rec; cl_qlist_t rec_list; @@ -376,10 +378,10 @@ osm_infr_rcv_process_get_method(IN osm_sa_t * sa, context.p_req_physp = p_req_physp; OSM_LOG(sa->p_log, OSM_LOG_DEBUG, - "Query Subscriber GID:0x%016" PRIx64 " : 0x%016" PRIx64 + "Query Subscriber GID:%s" "(%02X) Enum:0x%X(%02X)\n", - cl_ntoh64(p_rcvd_rec->subscriber_gid.unicast.prefix), - cl_ntoh64(p_rcvd_rec->subscriber_gid.unicast.interface_id), + inet_ntop(AF_INET6, p_rcvd_rec->subscriber_gid.raw, + gid_str, sizeof gid_str), (p_rcvd_mad->comp_mask & IB_IIR_COMPMASK_SUBSCRIBERGID) != 0, cl_ntoh16(p_rcvd_rec->subscriber_enum), (p_rcvd_mad->comp_mask & IB_IIR_COMPMASK_ENUM) != 0); diff --git a/opensm/opensm/osm_sa_mcmember_record.c b/opensm/opensm/osm_sa_mcmember_record.c index 086f3a5..871f4c6 100644 --- a/opensm/opensm/osm_sa_mcmember_record.c +++ b/opensm/opensm/osm_sa_mcmember_record.c @@ -47,6 +47,7 @@ #include <stdlib.h> #include <string.h> +#include <arpa/inet.h> #include <iba/ib_types.h> #include <complib/cl_qmap.h> #include <complib/cl_passivelock.h> @@ -830,6 +831,7 @@ osm_mcmr_rcv_create_new_mgrp(IN osm_sa_t * sa, IN const osm_physp_t * const p_physp, OUT osm_mgrp_t ** pp_mgrp) { + char gid_str[INET6_ADDRSTRLEN]; ib_net16_t mlid; uint8_t zero_mgid, valid; uint8_t scope, i; @@ -891,10 +893,9 @@ osm_mcmr_rcv_create_new_mgrp(IN osm_sa_t * sa, memcpy(&p_mgid->raw[10], &mlid, sizeof(uint16_t)); memcpy(&p_mgid->raw[12], &mlid, sizeof(uint16_t)); OSM_LOG(sa->p_log, OSM_LOG_DEBUG, - "Allocated new MGID:0x%016" PRIx64 " : " - "0x%016" PRIx64 "\n", - cl_ntoh64(p_mgid->unicast.prefix), - cl_ntoh64(p_mgid->unicast.interface_id)); + "Allocated new MGID:%s\n", + inet_ntop(AF_INET6, p_mgid->raw, gid_str, + sizeof gid_str)); } else { /* a specific MGID was requested so validate the resulting MGID */ valid = __validate_requested_mgid(sa, &mcm_rec); @@ -978,6 +979,7 @@ typedef struct osm_sa_pr_mcmr_search_ctxt { static void __search_mgrp_by_mgid(IN osm_mgrp_t * const p_mgrp, IN void *context) { + char gid_str[INET6_ADDRSTRLEN]; osm_sa_pr_mcmr_search_ctxt_t *p_ctxt = (osm_sa_pr_mcmr_search_ctxt_t *) context; const ib_gid_t *p_recvd_mgid; @@ -1017,9 +1019,9 @@ __search_mgrp_by_mgid(IN osm_mgrp_t * const p_mgrp, IN void *context) (rcv_interface_id & INT_ID_MASK)) { OSM_LOG(sa->p_log, OSM_LOG_INFO, "Special Case Solicited Node Mcast " - "Join for MGID 0x%016" PRIx64 - " : 0x%016" PRIx64 "\n", - rcv_prefix, rcv_interface_id); + "Join for MGID %s\n", + inet_ntop(AF_INET6, p_recvd_mgid->raw, gid_str, + sizeof gid_str)); } else return; } else @@ -1028,10 +1030,9 @@ __search_mgrp_by_mgid(IN osm_mgrp_t * const p_mgrp, IN void *context) if (p_ctxt->p_mgrp) { OSM_LOG(sa->p_log, OSM_LOG_ERROR, "ERR 1B30: " - "Multiple MC groups for MGID " - "0x%016" PRIx64 " : 0x%016" PRIx64 "\n", - cl_ntoh64(p_mgrp->mcmember_rec.mgid.unicast.prefix), - cl_ntoh64(p_mgrp->mcmember_rec.mgid.unicast.interface_id)); + "Multiple MC groups for MGID %s\n", + inet_ntop(AF_INET6, p_mgrp->mcmember_rec.mgid.raw, + gid_str, sizeof gid_str)); return; } p_ctxt->p_mgrp = p_mgrp; @@ -1093,6 +1094,8 @@ static void __osm_mcmr_rcv_leave_mgrp(IN osm_sa_t * sa, IN osm_madw_t * const p_madw) { + char gid_str[INET6_ADDRSTRLEN]; + char gid_str2[INET6_ADDRSTRLEN]; boolean_t valid; osm_mgrp_t *p_mgrp; ib_api_status_t status; @@ -1176,18 +1179,12 @@ __osm_mcmr_rcv_leave_mgrp(IN osm_sa_t * sa, CL_PLOCK_RELEASE(sa->p_lock); OSM_LOG(sa->p_log, OSM_LOG_ERROR, "ERR 1B25: " "Received an invalid delete request for " - "MGID: 0x%016" PRIx64 " : " - "0x%016" PRIx64 " for " - "PortGID: 0x%016" PRIx64 " : " - "0x%016" PRIx64 "\n", - cl_ntoh64(p_recvd_mcmember_rec->mgid.unicast. - prefix), - cl_ntoh64(p_recvd_mcmember_rec->mgid.unicast. - interface_id), - cl_ntoh64(p_recvd_mcmember_rec->port_gid. - unicast.prefix), - cl_ntoh64(p_recvd_mcmember_rec->port_gid. - unicast.interface_id)); + "MGID: %s for PortGID: %s\n", + inet_ntop(AF_INET6, p_recvd_mcmember_rec->mgid.raw, + gid_str, sizeof gid_str), + inet_ntop(AF_INET6, + p_recvd_mcmember_rec->port_gid.raw, + gid_str2, sizeof gid_str2)); osm_sa_send_error(sa, p_madw, IB_SA_MAD_STATUS_REQ_INVALID); goto Exit; @@ -1195,10 +1192,9 @@ __osm_mcmr_rcv_leave_mgrp(IN osm_sa_t * sa, } else { CL_PLOCK_RELEASE(sa->p_lock); OSM_LOG(sa->p_log, OSM_LOG_DEBUG, - "Failed since multicast group 0x%16" - PRIx64 " : 0x%016" PRIx64 " not present\n", - cl_ntoh64(p_recvd_mcmember_rec->mgid.unicast.prefix), - cl_ntoh64(p_recvd_mcmember_rec->mgid.unicast.interface_id)); + "Failed since multicast group %s not present\n", + inet_ntop(AF_INET6, p_recvd_mcmember_rec->mgid.raw, + gid_str, sizeof gid_str)); osm_sa_send_error(sa, p_madw, IB_SA_MAD_STATUS_REQ_INVALID); goto Exit; } @@ -1217,6 +1213,7 @@ static void __osm_mcmr_rcv_join_mgrp(IN osm_sa_t * sa, IN osm_madw_t * const p_madw) { + char gid_str[INET6_ADDRSTRLEN]; boolean_t valid; osm_mgrp_t *p_mgrp = NULL; ib_api_status_t status; @@ -1296,13 +1293,12 @@ __osm_mcmr_rcv_join_mgrp(IN osm_sa_t * sa, OSM_LOG(sa->p_log, OSM_LOG_ERROR, "ERR 1B10: " "Provided Join State != FullMember - " "required for create, " - "MGID: 0x%016" PRIx64 " : " - "0x%016" PRIx64 " from port 0x%016" PRIx64 + "MGID: %s from port 0x%016" PRIx64 " (%s)\n", - cl_ntoh64(p_recvd_mcmember_rec->mgid.unicast. - prefix), - cl_ntoh64(p_recvd_mcmember_rec->mgid.unicast. - interface_id), cl_ntoh64(portguid), + inet_ntop(AF_INET6, + p_recvd_mcmember_rec->mgid.raw, + gid_str, sizeof gid_str), + cl_ntoh64(portguid), p_port->p_node->print_desc); osm_sa_send_error(sa, p_madw, IB_SA_MAD_STATUS_REQ_INVALID); @@ -1332,16 +1328,15 @@ __osm_mcmr_rcv_join_mgrp(IN osm_sa_t * sa, "method = %s, scope_state = 0x%x, " "component mask = 0x%016" PRIx64 ", " "expected comp mask = 0x%016" PRIx64 ", " - "MGID: 0x%016" PRIx64 " : 0x%016" PRIx64 - " from port 0x%016" PRIx64 " (%s)\n", + "MGID: %s from port 0x%016" PRIx64 " (%s)\n", ib_get_sa_method_str(p_sa_mad->method), p_recvd_mcmember_rec->scope_state, cl_ntoh64(p_sa_mad->comp_mask), CL_NTOH64(REQUIRED_MC_CREATE_COMP_MASK), - cl_ntoh64(p_recvd_mcmember_rec->mgid.unicast. - prefix), - cl_ntoh64(p_recvd_mcmember_rec->mgid.unicast. - interface_id), cl_ntoh64(portguid), + inet_ntop(AF_INET6, + p_recvd_mcmember_rec->mgid.raw, + gid_str, sizeof gid_str), + cl_ntoh64(portguid), p_port->p_node->print_desc); osm_sa_send_error(sa, p_madw, @@ -1534,6 +1529,7 @@ static void __osm_sa_mcm_by_comp_mask_cb(IN osm_mgrp_t * const p_mgrp, IN void *context) { + char gid_str[INET6_ADDRSTRLEN]; osm_sa_mcmr_search_ctxt_t *const p_ctxt = (osm_sa_mcmr_search_ctxt_t *) context; osm_sa_t *sa = p_ctxt->sa; @@ -1671,13 +1667,10 @@ __osm_sa_mcm_by_comp_mask_cb(IN osm_mgrp_t * const p_mgrp, &(p_mcm_port->port_gid), sizeof(ib_gid_t)); OSM_LOG(sa->p_log, OSM_LOG_DEBUG, - "Record of port_gid: 0x%016" PRIx64 - "0x%016" PRIx64 + "Record of port_gid: %s" " in multicast_lid: 0x%X is returned\n", - cl_ntoh64(match_rec.port_gid.unicast. - prefix), - cl_ntoh64(match_rec.port_gid.unicast. - interface_id), + inet_ntop(AF_INET6, match_rec.port_gid.raw, + gid_str, sizeof gid_str), cl_ntoh16(p_mgrp->mlid)); match_rec.proxy_join = @@ -1797,6 +1790,8 @@ Exit: **********************************************************************/ void osm_mcmr_rcv_process(IN void *context, IN void *data) { + char gid_str[INET6_ADDRSTRLEN]; + char gid_str2[INET6_ADDRSTRLEN]; osm_sa_t *sa = context; osm_madw_t *p_madw = data; ib_sa_mad_t *p_sa_mad; @@ -1822,18 +1817,15 @@ void osm_mcmr_rcv_process(IN void *context, IN void *data) OSM_LOG(sa->p_log, OSM_LOG_ERROR, "ERR 1B18: " "component mask = 0x%016" PRIx64 ", " "expected comp mask = 0x%016" PRIx64 ", " - "MGID: 0x%016" PRIx64 " : 0x%016" PRIx64 - " for PortGID: 0x%016" PRIx64 " : 0x%016" - PRIx64 "\n", cl_ntoh64(p_sa_mad->comp_mask), + "MGID: %s for PortGID: %s\n", + cl_ntoh64(p_sa_mad->comp_mask), CL_NTOH64(JOIN_MC_COMP_MASK), - cl_ntoh64(p_recvd_mcmember_rec->mgid.unicast. - prefix), - cl_ntoh64(p_recvd_mcmember_rec->mgid.unicast. - interface_id), - cl_ntoh64(p_recvd_mcmember_rec->port_gid. - unicast.prefix), - cl_ntoh64(p_recvd_mcmember_rec->port_gid. - unicast.interface_id)); + inet_ntop(AF_INET6, + p_recvd_mcmember_rec->mgid.raw, + gid_str, sizeof gid_str), + inet_ntop(AF_INET6, + p_recvd_mcmember_rec->port_gid.raw, + gid_str2, sizeof gid_str2)); osm_sa_send_error(sa, p_madw, IB_SA_MAD_STATUS_REQ_INVALID); diff --git a/opensm/opensm/osm_sa_path_record.c b/opensm/opensm/osm_sa_path_record.c index f863735..4fe491c 100644 --- a/opensm/opensm/osm_sa_path_record.c +++ b/opensm/opensm/osm_sa_path_record.c @@ -46,6 +46,7 @@ #endif /* HAVE_CONFIG_H */ #include <string.h> +#include <arpa/inet.h> #include <iba/ib_types.h> #include <complib/cl_qmap.h> #include <complib/cl_passivelock.h> @@ -1474,6 +1475,7 @@ static void __osm_pr_get_mgrp(IN osm_sa_t * sa, IN const osm_madw_t * const p_madw, OUT osm_mgrp_t ** pp_mgrp) { + char gid_str[INET6_ADDRSTRLEN]; ib_path_rec_t *p_pr; const ib_sa_mad_t *p_sa_mad; ib_net64_t comp_mask; @@ -1491,9 +1493,9 @@ __osm_pr_get_mgrp(IN osm_sa_t * sa, if (status != IB_SUCCESS) { OSM_LOG(sa->p_log, OSM_LOG_ERROR, "ERR 1F09: " "No MC group found for PathRecord destination " - "GID 0x%016" PRIx64 " : " "0x%016" PRIx64 "\n", - cl_ntoh64(p_pr->dgid.unicast.prefix), - cl_ntoh64(p_pr->dgid.unicast.interface_id)); + "GID %s\n", + inet_ntop(AF_INET6, p_pr->dgid.raw, gid_str, + sizeof gid_str)); goto Exit; } } diff --git a/opensm/osmtest/osmt_multicast.c b/opensm/osmtest/osmt_multicast.c index 15b656f..e1ca3e5 100644 --- a/opensm/osmtest/osmt_multicast.c +++ b/opensm/osmtest/osmt_multicast.c @@ -45,6 +45,7 @@ #include <stdio.h> #include <stdlib.h> #include <string.h> +#include <arpa/inet.h> #include <complib/cl_debug.h> #include <complib/cl_map.h> #include <complib/cl_list.h> @@ -149,6 +150,7 @@ __match_mgids(IN const void *const p_object, IN void *context) ib_api_status_t osmt_query_mcast(IN osmtest_t * const p_osmt) { + char gid_str[INET6_ADDRSTRLEN]; ib_api_status_t status = IB_SUCCESS; osmv_user_query_t user; osmv_query_req_t req; @@ -240,10 +242,9 @@ ib_api_status_t osmt_query_mcast(IN osmtest_t * const p_osmt) if (p_mgids_res != cl_list_end(p_mgids_list)) { osm_log(&p_osmt->log, OSM_LOG_ERROR, "osmt_query_mcast: ERR 0265: " - "MCG MGIDs are the same - invalid MGID : 0x%016" - PRIx64 " 0x%016" PRIx64 "\n", - cl_ntoh64(p_rec->mgid.unicast.prefix), - cl_ntoh64(p_rec->mgid.unicast.interface_id)); + "MCG MGIDs are the same - invalid MGID : %s\n", + inet_ntop(AF_INET6, p_rec->mgid.raw, gid_str, + sizeof gid_str)); status = IB_ERROR; goto Exit; @@ -477,6 +478,8 @@ osmt_init_mc_query_rec(IN osmtest_t * const p_osmt, ib_api_status_t osmt_run_mcast_flow(IN osmtest_t * const p_osmt) { + char gid_str[INET6_ADDRSTRLEN]; + char gid_str2[INET6_ADDRSTRLEN]; ib_api_status_t status; ib_member_rec_t mc_req_rec; ib_member_rec_t *p_mc_res; @@ -595,12 +598,10 @@ ib_api_status_t osmt_run_mcast_flow(IN osmtest_t * const p_osmt) } else { osm_log(&p_osmt->log, OSM_LOG_INFO, "osmt_run_mcast_flow: " - "Non-IPoIB MC Groups exist: mgid=0x%016" PRIx64 - ":0x%016" PRIx64 "\n", - cl_ntoh64(p_mgrp->mcmember_rec.mgid.unicast. - prefix), - cl_ntoh64(p_mgrp->mcmember_rec.mgid.unicast. - interface_id)); + "Non-IPoIB MC Groups exist: mgid=%s\n", + inet_ntop(AF_INET6, + p_mgrp->mcmember_rec.mgid.raw, + gid_str, sizeof gid_str)); mcg_outside_test_cnt++; } @@ -635,13 +636,13 @@ ib_api_status_t osmt_run_mcast_flow(IN osmtest_t * const p_osmt) "Joining an existing IPoIB multicast group\n"); osm_log(&p_osmt->log, OSM_LOG_INFO, "osmt_run_mcast_flow: " - "Sent Join request with :\n\t\tport_gid=0x%016" PRIx64 - ":0x%016" PRIx64 ", mgid=0x%016" PRIx64 ":0x%016" PRIx64 - "\n\t\tjoin state= 0x%x, response is : %s\n", - cl_ntoh64(mc_req_rec.port_gid.unicast.prefix), - cl_ntoh64(mc_req_rec.port_gid.unicast.interface_id), - cl_ntoh64(mc_req_rec.mgid.unicast.prefix), - cl_ntoh64(mc_req_rec.mgid.unicast.interface_id), + "Sent Join request with :\n\t\tport_gid=%s" + ", mgid=%s\n" + "\t\tjoin state= 0x%x, response is : %s\n", + inet_ntop(AF_INET6, mc_req_rec.port_gid.raw, + gid_str, sizeof gid_str), + inet_ntop(AF_INET6, mc_req_rec.mgid.raw, + gid_str2, sizeof gid_str2), (mc_req_rec.scope_state & 0x0F), ib_get_err_str(status)); if (status != IB_SUCCESS) { @@ -699,11 +700,10 @@ ib_api_status_t osmt_run_mcast_flow(IN osmtest_t * const p_osmt) if (status != IB_SUCCESS) { osm_log(&p_osmt->log, OSM_LOG_ERROR, "osmt_run_mcast_flow: ERR 02EF: " - "Query as Full Member of already existing ipoib group 0x%016" - PRIx64 ":0x%016" PRIx64 " has failed\n", - cl_ntoh64(mc_req_rec.mgid.unicast.prefix), - cl_ntoh64(mc_req_rec.mgid.unicast. - interface_id)); + "Query as Full Member of already existing " + "ipoib group gid %s has failed\n", + inet_ntop(AF_INET6, mc_req_rec.mgid.raw, + gid_str, sizeof gid_str)); goto Exit; } @@ -1382,10 +1382,9 @@ ib_api_status_t osmt_run_mcast_flow(IN osmtest_t * const p_osmt) p_recvd_rec = (ib_member_rec_t *) ib_sa_mad_get_payload_ptr(&res_sa_mad); osm_log(&p_osmt->log, OSM_LOG_VERBOSE, - "osmt_run_mcast_flow: " "created MGID:0x%016" PRIx64 " : " - "0x%016" PRIx64 " MLID:0x%04X\n", - cl_ntoh64(p_recvd_rec->mgid.unicast.prefix), - cl_ntoh64(p_recvd_rec->mgid.unicast.interface_id), + "osmt_run_mcast_flow: " "created MGID:%s MLID:0x%04X\n", + inet_ntop(AF_INET6, p_recvd_rec->mgid.raw, gid_str, + sizeof gid_str), cl_ntoh16(p_recvd_rec->mlid)); cl_map_insert(&test_created_mlids, cl_ntoh16(p_recvd_rec->mlid), p_recvd_rec); @@ -1414,10 +1413,9 @@ ib_api_status_t osmt_run_mcast_flow(IN osmtest_t * const p_osmt) p_recvd_rec = (ib_member_rec_t *) ib_sa_mad_get_payload_ptr(&res_sa_mad); osm_log(&p_osmt->log, OSM_LOG_VERBOSE, - "osmt_run_mcast_flow: " "Created MGID:0x%016" PRIx64 " : " - "0x%016" PRIx64 " MLID:0x%04X\n", - cl_ntoh64(p_recvd_rec->mgid.unicast.prefix), - cl_ntoh64(p_recvd_rec->mgid.unicast.interface_id), + "osmt_run_mcast_flow: " "Created MGID:%s MLID:0x%04X\n", + inet_ntop(AF_INET6, p_recvd_rec->mgid.raw, gid_str, + sizeof gid_str), cl_ntoh16(p_recvd_rec->mlid)); cl_map_insert(&test_created_mlids, cl_ntoh16(p_recvd_rec->mlid), p_recvd_rec); @@ -1445,10 +1443,9 @@ ib_api_status_t osmt_run_mcast_flow(IN osmtest_t * const p_osmt) p_recvd_rec = (ib_member_rec_t *) ib_sa_mad_get_payload_ptr(&res_sa_mad); osm_log(&p_osmt->log, OSM_LOG_VERBOSE, - "osmt_run_mcast_flow: " "Created MGID:0x%016" PRIx64 " : " - "0x%016" PRIx64 " MLID:0x%04X\n", - cl_ntoh64(p_recvd_rec->mgid.unicast.prefix), - cl_ntoh64(p_recvd_rec->mgid.unicast.interface_id), + "osmt_run_mcast_flow: " "Created MGID:%s MLID:0x%04X\n", + inet_ntop(AF_INET6, p_recvd_rec->mgid.raw, gid_str, + sizeof gid_str), cl_ntoh16(p_recvd_rec->mlid)); cl_map_insert(&test_created_mlids, cl_ntoh16(p_recvd_rec->mlid), p_recvd_rec); @@ -1475,10 +1472,9 @@ ib_api_status_t osmt_run_mcast_flow(IN osmtest_t * const p_osmt) p_recvd_rec = (ib_member_rec_t *) ib_sa_mad_get_payload_ptr(&res_sa_mad); osm_log(&p_osmt->log, OSM_LOG_VERBOSE, - "osmt_run_mcast_flow: " "Created MGID:0x%016" PRIx64 " : " - "0x%016" PRIx64 " MLID:0x%04X\n", - cl_ntoh64(p_recvd_rec->mgid.unicast.prefix), - cl_ntoh64(p_recvd_rec->mgid.unicast.interface_id), + "osmt_run_mcast_flow: " "Created MGID:%s MLID:0x%04X\n", + inet_ntop(AF_INET6, p_recvd_rec->mgid.raw, gid_str, + sizeof gid_str), cl_ntoh16(p_recvd_rec->mlid)); cl_map_insert(&test_created_mlids, cl_ntoh16(p_recvd_rec->mlid), p_recvd_rec); @@ -1516,10 +1512,9 @@ ib_api_status_t osmt_run_mcast_flow(IN osmtest_t * const p_osmt) p_recvd_rec = (ib_member_rec_t *) ib_sa_mad_get_payload_ptr(&res_sa_mad); osm_log(&p_osmt->log, OSM_LOG_VERBOSE, - "osmt_run_mcast_flow: " "Created MGID:0x%016" PRIx64 " : " - "0x%016" PRIx64 " MLID:0x%04X\n", - cl_ntoh64(p_recvd_rec->mgid.unicast.prefix), - cl_ntoh64(p_recvd_rec->mgid.unicast.interface_id), + "osmt_run_mcast_flow: " "Created MGID:%s MLID:0x%04X\n", + inet_ntop(AF_INET6, p_recvd_rec->mgid.raw, gid_str, + sizeof gid_str), cl_ntoh16(p_recvd_rec->mlid)); cl_map_insert(&test_created_mlids, cl_ntoh16(p_recvd_rec->mlid), p_recvd_rec); @@ -1552,10 +1547,9 @@ ib_api_status_t osmt_run_mcast_flow(IN osmtest_t * const p_osmt) p_recvd_rec = (ib_member_rec_t *) ib_sa_mad_get_payload_ptr(&res_sa_mad); osm_log(&p_osmt->log, OSM_LOG_VERBOSE, - "osmt_run_mcast_flow: " "Created MGID:0x%016" PRIx64 " : " - "0x%016" PRIx64 " MLID:0x%04X\n", - cl_ntoh64(p_recvd_rec->mgid.unicast.prefix), - cl_ntoh64(p_recvd_rec->mgid.unicast.interface_id), + "osmt_run_mcast_flow: " "Created MGID:%s MLID:0x%04X\n", + inet_ntop(AF_INET6, p_recvd_rec->mgid.raw, gid_str, + sizeof gid_str), cl_ntoh16(p_recvd_rec->mlid)); cl_map_insert(&test_created_mlids, cl_ntoh16(p_recvd_rec->mlid), p_recvd_rec); @@ -1588,10 +1582,9 @@ ib_api_status_t osmt_run_mcast_flow(IN osmtest_t * const p_osmt) p_recvd_rec = (ib_member_rec_t *) ib_sa_mad_get_payload_ptr(&res_sa_mad); osm_log(&p_osmt->log, OSM_LOG_VERBOSE, - "osmt_run_mcast_flow: " "Created MGID:0x%016" PRIx64 " : " - "0x%016" PRIx64 " MLID:0x%04X\n", - cl_ntoh64(p_recvd_rec->mgid.unicast.prefix), - cl_ntoh64(p_recvd_rec->mgid.unicast.interface_id), + "osmt_run_mcast_flow: " "Created MGID:%s MLID:0x%04X\n", + inet_ntop(AF_INET6, p_recvd_rec->mgid.raw, gid_str, + sizeof gid_str), cl_ntoh16(p_recvd_rec->mlid)); cl_map_insert(&test_created_mlids, cl_ntoh16(p_recvd_rec->mlid), p_recvd_rec); @@ -1610,9 +1603,9 @@ ib_api_status_t osmt_run_mcast_flow(IN osmtest_t * const p_osmt) (p_mc_res->mgid.multicast.raw_group_id[1] != 0x1B)) { osm_log(&p_osmt->log, OSM_LOG_ERROR, "osmt_run_mcast_flow: ERR 0209: " - "Validating MGID failed. MGID:0x%016" PRIx64 ":%016" - PRIx64 "\n", cl_ntoh64(p_mc_res->mgid.unicast.prefix), - cl_ntoh64(p_mc_res->mgid.unicast.interface_id) + "Validating MGID failed. MGID:%s\n", + inet_ntop(AF_INET6, p_mc_res->mgid.raw, gid_str, + sizeof gid_str) ); status = IB_ERROR; goto Exit; @@ -1656,10 +1649,9 @@ ib_api_status_t osmt_run_mcast_flow(IN osmtest_t * const p_osmt) p_recvd_rec = (ib_member_rec_t *) ib_sa_mad_get_payload_ptr(&res_sa_mad); osm_log(&p_osmt->log, OSM_LOG_VERBOSE, - "osmt_run_mcast_flow: " "Created MGID:0x%016" PRIx64 " : " - "0x%016" PRIx64 " MLID:0x%04X\n", - cl_ntoh64(p_recvd_rec->mgid.unicast.prefix), - cl_ntoh64(p_recvd_rec->mgid.unicast.interface_id), + "osmt_run_mcast_flow: " "Created MGID:%s MLID:0x%04X\n", + inet_ntop(AF_INET6, p_recvd_rec->mgid.raw, gid_str, + sizeof gid_str), cl_ntoh16(p_recvd_rec->mlid)); cl_map_insert(&test_created_mlids, cl_ntoh16(p_recvd_rec->mlid), p_recvd_rec); @@ -1671,10 +1663,9 @@ ib_api_status_t osmt_run_mcast_flow(IN osmtest_t * const p_osmt) osm_log(&p_osmt->log, OSM_LOG_INFO, "osmt_run_mcast_flow: " - "Checking Create given valid MGID=0x%016" PRIx64 " : " - "0x%016" PRIx64 " (o15.0.1.6)...\n", - cl_ntoh64(mc_req_rec.mgid.unicast.prefix), - cl_ntoh64(mc_req_rec.mgid.unicast.interface_id)); + "Checking Create given valid MGID=%s (o15.0.1.6)...\n", + inet_ntop(AF_INET6, mc_req_rec.mgid.raw, gid_str, + sizeof gid_str)); /* Before creation, need to check that this group doesn't exist */ osm_log(&p_osmt->log, OSM_LOG_INFO, @@ -1707,20 +1698,18 @@ ib_api_status_t osmt_run_mcast_flow(IN osmtest_t * const p_osmt) osm_log(&p_osmt->log, OSM_LOG_INFO, "osmt_run_mcast_flow: " - "Now creating group with given valid MGID=0x%016" PRIx64 " : " - "0x%016" PRIx64 " (o15.0.1.6)...\n", - cl_ntoh64(mc_req_rec.mgid.unicast.prefix), - cl_ntoh64(mc_req_rec.mgid.unicast.interface_id)); + "Now creating group with given valid MGID=%s (o15.0.1.6)...\n", + inet_ntop(AF_INET6, mc_req_rec.mgid.raw, gid_str, + sizeof gid_str)); status = osmt_send_mcast_request(p_osmt, 1, &mc_req_rec, comp_mask, &res_sa_mad); if (status != IB_SUCCESS) { osm_log(&p_osmt->log, OSM_LOG_ERROR, "osmt_run_mcast_flow: ERR 0211: " - "Failed to create MCG for MGID=0x%016" PRIx64 " : " - "0x%016" PRIx64 " (o15.0.1.6) - got %s/%s\n", - cl_ntoh64(good_mgid.unicast.prefix), - cl_ntoh64(good_mgid.unicast.interface_id), + "Failed to create MCG for MGID=%s (o15.0.1.6) - got %s/%s\n", + inet_ntop(AF_INET6, good_mgid.raw, gid_str, + sizeof gid_str), ib_get_err_str(status), ib_get_mad_status_str((ib_mad_t *) (&res_sa_mad))); goto Exit; @@ -1730,10 +1719,9 @@ ib_api_status_t osmt_run_mcast_flow(IN osmtest_t * const p_osmt) p_recvd_rec = (ib_member_rec_t *) ib_sa_mad_get_payload_ptr(&res_sa_mad); osm_log(&p_osmt->log, OSM_LOG_VERBOSE, - "osmt_run_mcast_flow: " "Created MGID:0x%016" PRIx64 " : " - "0x%016" PRIx64 " MLID:0x%04X\n", - cl_ntoh64(p_recvd_rec->mgid.unicast.prefix), - cl_ntoh64(p_recvd_rec->mgid.unicast.interface_id), + "osmt_run_mcast_flow: " "Created MGID:%s MLID:0x%04X\n", + inet_ntop(AF_INET6, p_recvd_rec->mgid.raw, gid_str, + sizeof gid_str), cl_ntoh16(p_recvd_rec->mlid)); cl_map_insert(&test_created_mlids, cl_ntoh16(p_recvd_rec->mlid), p_recvd_rec); @@ -1747,9 +1735,9 @@ ib_api_status_t osmt_run_mcast_flow(IN osmtest_t * const p_osmt) (p_mc_res->mgid.multicast.raw_group_id[1] != 0x1C)) { osm_log(&p_osmt->log, OSM_LOG_ERROR, "osmt_run_mcast_flow: ERR 0212: " - "Validating MGID failed. MGID:0x%016" PRIx64 ":%016" - PRIx64 "\n", cl_ntoh64(p_mc_res->mgid.unicast.prefix), - cl_ntoh64(p_mc_res->mgid.unicast.interface_id) + "Validating MGID failed. MGID:%s\n", + inet_ntop(AF_INET6, p_mc_res->mgid.raw, gid_str, + sizeof gid_str) ); status = IB_ERROR; goto Exit; @@ -1842,10 +1830,10 @@ ib_api_status_t osmt_run_mcast_flow(IN osmtest_t * const p_osmt) osm_log(&p_osmt->log, OSM_LOG_INFO, "osmt_run_mcast_flow: " - "Checking local scope with full member \n\t\tand valid mgid 0x%016" - PRIx64 ":0x%016" PRIx64 " ... (o15.0.1.6)...\n", - cl_ntoh64(mc_req_rec.mgid.unicast.prefix), - cl_ntoh64(mc_req_rec.mgid.unicast.interface_id)); + "Checking local scope with full member \n\t\tand valid mgid %s" + " ... (o15.0.1.6)...\n", + inet_ntop(AF_INET6, mc_req_rec.mgid.raw, gid_str, + sizeof gid_str)); mc_req_rec.mgid = good_mgid; @@ -1856,10 +1844,9 @@ ib_api_status_t osmt_run_mcast_flow(IN osmtest_t * const p_osmt) if (status != IB_SUCCESS) { osm_log(&p_osmt->log, OSM_LOG_ERROR, "osmt_run_mcast_flow: ERR 0216: " - "Failed to create MCG for MGID=0x%016" PRIx64 " : " - "0x%016" PRIx64 " - got %s/%s\n", - cl_ntoh64(good_mgid.unicast.prefix), - cl_ntoh64(good_mgid.unicast.interface_id), + "Failed to create MCG for MGID=%s - got %s/%s\n", + inet_ntop(AF_INET6, good_mgid.raw, gid_str, + sizeof gid_str), ib_get_err_str(status), ib_get_mad_status_str((ib_mad_t *) (&res_sa_mad))); goto Exit; @@ -1869,10 +1856,9 @@ ib_api_status_t osmt_run_mcast_flow(IN osmtest_t * const p_osmt) p_recvd_rec = (ib_member_rec_t *) ib_sa_mad_get_payload_ptr(&res_sa_mad); osm_log(&p_osmt->log, OSM_LOG_VERBOSE, - "osmt_run_mcast_flow: " "Created MGID:0x%016" PRIx64 " : " - "0x%016" PRIx64 " MLID:0x%04X\n", - cl_ntoh64(p_recvd_rec->mgid.unicast.prefix), - cl_ntoh64(p_recvd_rec->mgid.unicast.interface_id), + "osmt_run_mcast_flow: " "Created MGID:%s MLID:0x%04X\n", + inet_ntop(AF_INET6, p_recvd_rec->mgid.raw, gid_str, + sizeof gid_str), cl_ntoh16(p_recvd_rec->mlid)); cl_map_insert(&test_created_mlids, cl_ntoh16(p_recvd_rec->mlid), p_recvd_rec); @@ -1932,10 +1918,9 @@ ib_api_status_t osmt_run_mcast_flow(IN osmtest_t * const p_osmt) p_recvd_rec = (ib_member_rec_t *) ib_sa_mad_get_payload_ptr(&res_sa_mad); osm_log(&p_osmt->log, OSM_LOG_VERBOSE, - "osmt_run_mcast_flow: " "Created MGID:0x%016" PRIx64 " : " - "0x%016" PRIx64 " MLID:0x%04X\n", - cl_ntoh64(p_recvd_rec->mgid.unicast.prefix), - cl_ntoh64(p_recvd_rec->mgid.unicast.interface_id), + "osmt_run_mcast_flow: " "Created MGID:%s MLID:0x%04X\n", + inet_ntop(AF_INET6, p_recvd_rec->mgid.raw, gid_str, + sizeof gid_str), cl_ntoh16(p_recvd_rec->mlid)); cl_map_insert(&test_created_mlids, cl_ntoh16(p_recvd_rec->mlid), p_recvd_rec); @@ -1999,10 +1984,9 @@ ib_api_status_t osmt_run_mcast_flow(IN osmtest_t * const p_osmt) p_recvd_rec = (ib_member_rec_t *) ib_sa_mad_get_payload_ptr(&res_sa_mad); osm_log(&p_osmt->log, OSM_LOG_VERBOSE, - "osmt_run_mcast_flow: " "Created MGID:0x%016" PRIx64 " : " - "0x%016" PRIx64 " MLID:0x%04X\n", - cl_ntoh64(p_recvd_rec->mgid.unicast.prefix), - cl_ntoh64(p_recvd_rec->mgid.unicast.interface_id), + "osmt_run_mcast_flow: " "Created MGID:%s MLID:0x%04X\n", + inet_ntop(AF_INET6, p_recvd_rec->mgid.raw, gid_str, + sizeof gid_str), cl_ntoh16(p_recvd_rec->mlid)); cl_map_insert(&test_created_mlids, cl_ntoh16(p_recvd_rec->mlid), p_recvd_rec); @@ -2065,10 +2049,9 @@ ib_api_status_t osmt_run_mcast_flow(IN osmtest_t * const p_osmt) p_recvd_rec = (ib_member_rec_t *) ib_sa_mad_get_payload_ptr(&res_sa_mad); osm_log(&p_osmt->log, OSM_LOG_VERBOSE, - "osmt_run_mcast_flow: " "Created MGID:0x%016" PRIx64 " : " - "0x%016" PRIx64 " MLID:0x%04X\n", - cl_ntoh64(p_recvd_rec->mgid.unicast.prefix), - cl_ntoh64(p_recvd_rec->mgid.unicast.interface_id), + "osmt_run_mcast_flow: " "Created MGID:%s MLID:0x%04X\n", + inet_ntop(AF_INET6, p_recvd_rec->mgid.raw, gid_str, + sizeof gid_str), cl_ntoh16(p_recvd_rec->mlid)); cl_map_insert(&test_created_mlids, cl_ntoh16(p_recvd_rec->mlid), p_recvd_rec); @@ -2476,10 +2459,9 @@ ib_api_status_t osmt_run_mcast_flow(IN osmtest_t * const p_osmt) /* Prepare another MCG for the following tests : */ osm_log(&p_osmt->log, OSM_LOG_INFO, "osmt_run_mcast_flow: " - "Checking Create given MGID=0x%016" PRIx64 " : " - "0x%016" PRIx64 "\n\t\t(o15.0.1.4)...\n", - cl_ntoh64(osm_ipoib_mgid.unicast.prefix), - cl_ntoh64(osm_ipoib_mgid.unicast.interface_id)); + "Checking Create given MGID=%s\n\t\t(o15.0.1.4)...\n", + inet_ntop(AF_INET6, osm_ipoib_mgid.raw, gid_str, + sizeof gid_str)); mc_req_rec.mgid = good_mgid; mc_req_rec.mgid.raw[12] = 0xAA; @@ -2493,10 +2475,9 @@ ib_api_status_t osmt_run_mcast_flow(IN osmtest_t * const p_osmt) if (status != IB_SUCCESS) { osm_log(&p_osmt->log, OSM_LOG_ERROR, "osmt_run_mcast_flow: ERR 02BE: " - "Failed to create MCG for 0x%016" PRIx64 " : " - "0x%016" PRIx64 " - got %s/%s\n", - cl_ntoh64(good_mgid.unicast.prefix), - cl_ntoh64(good_mgid.unicast.interface_id), + "Failed to create MCG for %s - got %s/%s\n", + inet_ntop(AF_INET6, good_mgid.raw, gid_str, + sizeof gid_str), ib_get_err_str(status), ib_get_mad_status_str((ib_mad_t *) (&res_sa_mad))); goto Exit; @@ -2706,12 +2687,11 @@ ib_api_status_t osmt_run_mcast_flow(IN osmtest_t * const p_osmt) osm_log(&p_osmt->log, OSM_LOG_ERROR, "osmt_run_mcast_flow: ERR 02A9: " "Successful deletion of remote port guid with local one MGID : " - "0x%016" PRIx64 " : 0x%016" PRIx64 - ", Got : %s/%s\n", - cl_ntoh64(p_mgrp->mcmember_rec.mgid.unicast. - prefix), - cl_ntoh64(p_mgrp->mcmember_rec.mgid.unicast. - interface_id), ib_get_err_str(status), + "%s, Got : %s/%s\n", + inet_ntop(AF_INET6, + p_mgrp->mcmember_rec.mgid.raw, + gid_str, sizeof gid_str), + ib_get_err_str(status), ib_get_mad_status_str((ib_mad_t *) (&res_sa_mad))); status = IB_ERROR; @@ -2737,12 +2717,11 @@ ib_api_status_t osmt_run_mcast_flow(IN osmtest_t * const p_osmt) osm_log(&p_osmt->log, OSM_LOG_ERROR, "osmt_run_mcast_flow: ERR 02B0: " "Failed to delete mgid with remote port guid MGID : " - "0x%016" PRIx64 " : 0x%016" PRIx64 - ", Got : %s/%s\n", - cl_ntoh64(p_mgrp->mcmember_rec.mgid.unicast. - prefix), - cl_ntoh64(p_mgrp->mcmember_rec.mgid.unicast. - interface_id), ib_get_err_str(status), + "%s, Got : %s/%s\n", + inet_ntop(AF_INET6, + p_mgrp->mcmember_rec.mgid.raw, + gid_str, sizeof gid_str), + ib_get_err_str(status), ib_get_mad_status_str((ib_mad_t *) (&res_sa_mad))); goto Exit; @@ -2816,12 +2795,10 @@ ib_api_status_t osmt_run_mcast_flow(IN osmtest_t * const p_osmt) ib_sa_mad_get_payload_ptr(&res_sa_mad); osm_log(&p_osmt->log, OSM_LOG_VERBOSE, "osmt_run_mcast_flow : " - "Created MGID:0x%016" PRIx64 " : " - "0x%016" PRIx64 " MLID:0x%04X\n", - cl_ntoh64(p_recvd_rec->mgid.unicast. - prefix), - cl_ntoh64(p_recvd_rec->mgid.unicast. - interface_id), + "Created MGID:%s MLID:0x%04X\n", + inet_ntop(AF_INET6, + p_recvd_rec->mgid.raw, + gid_str, sizeof gid_str), cl_ntoh16(p_recvd_rec->mlid)); cl_map_insert(&test_created_mlids, cl_ntoh16(p_recvd_rec->mlid), @@ -2881,10 +2858,10 @@ ib_api_status_t osmt_run_mcast_flow(IN osmtest_t * const p_osmt) osm_log(&p_osmt->log, OSM_LOG_VERBOSE, "osmt_run_mcast_flow : " - "Sending request to delete MGID : 0x%016" PRIx64 - " : 0x%016" PRIx64 ", scope_state : 0x%02X\n", - cl_ntoh64(mc_req_rec.mgid.unicast.prefix), - cl_ntoh64(mc_req_rec.mgid.unicast.interface_id), + "Sending request to delete MGID : %s" + ", scope_state : 0x%02X\n", + inet_ntop(AF_INET6, mc_req_rec.mgid.raw, + gid_str, sizeof gid_str), mc_req_rec.scope_state); status = osmt_send_mcast_request(p_osmt, 0, /* delete flag */ &mc_req_rec, @@ -2893,13 +2870,11 @@ ib_api_status_t osmt_run_mcast_flow(IN osmtest_t * const p_osmt) if (status != IB_SUCCESS) { osm_log(&p_osmt->log, OSM_LOG_ERROR, "osmt_run_mcast_flow: ERR 02FF: " - "Failed to delete MGID : 0x%016" PRIx64 - " : 0x%016" PRIx64 + "Failed to delete MGID : %s" " ,\n\t\t it is not our MCG, Status : %s/%s\n", - cl_ntoh64(p_mgrp->mcmember_rec.mgid. - unicast.prefix), - cl_ntoh64(p_mgrp->mcmember_rec.mgid. - unicast.interface_id), + inet_ntop(AF_INET6, + p_mgrp->mcmember_rec.mgid.raw, + gid_str, sizeof gid_str), ib_get_err_str(status), ib_get_mad_status_str((ib_mad_t *) @@ -2963,26 +2938,23 @@ ib_api_status_t osmt_run_mcast_flow(IN osmtest_t * const p_osmt) /* This means that we still have an mgrp that we created!! */ osm_log(&p_osmt->log, OSM_LOG_ERROR, "osmt_run_mcast_flow: ERR 02FE: " - "Wasn't able to erase mgrp with MGID:0x%016" - PRIx64 " : 0x%016" PRIx64 + "Wasn't able to erase mgrp with MGID:%s" " MLID:0x%04X\n", - cl_ntoh64(p_mgrp->mcmember_rec.mgid. - unicast.prefix), - cl_ntoh64(p_mgrp->mcmember_rec.mgid. - unicast.interface_id), mlid); + inet_ntop(AF_INET6, + p_mgrp->mcmember_rec.mgid.raw, + gid_str, sizeof gid_str), + mlid); got_error = TRUE; } else { osm_log(&p_osmt->log, OSM_LOG_INFO, "osmt_run_mcast_flow: " - "Still exists %s MGID:0x%016" PRIx64 - " : 0x%016" PRIx64 "\n", + "Still exists %s MGID:%s\n", (IS_IPOIB_MGID (&p_mgrp->mcmember_rec. mgid)) ? "IPoIB" : "non-IPoIB", - cl_ntoh64(p_mgrp->mcmember_rec.mgid. - unicast.prefix), - cl_ntoh64(p_mgrp->mcmember_rec.mgid. - unicast.interface_id)); + inet_ntop(AF_INET6, + p_mgrp->mcmember_rec.mgid.raw, + gid_str, sizeof gid_str)); } p_mgrp = (osmtest_mgrp_t *) cl_qmap_next(&p_mgrp->map_item); -- 1.5.4.5 _______________________________________________ general mailing list general@lists.openfabrics.org http://lists.openfabrics.org/cgi-bin/mailman/listinfo/general To unsubscribe, please visit http://openib.org/mailman/listinfo/openib-general