void fi_ibv_log_ep_conn(struct fi_ibv_xrc_ep *ep, char *desc) { struct sockaddr *addr; char buf[OFI_ADDRSTRLEN]; size_t len = sizeof(buf); if (!fi_log_enabled(&fi_ibv_prov, FI_LOG_INFO, FI_LOG_FABRIC)) return; VERBS_INFO(FI_LOG_FABRIC, "EP %p, %s\n", ep, desc); VERBS_INFO(FI_LOG_FABRIC, "EP %p, CM ID %p, TGT CM ID %p, SRQN %d Peer SRQN %d\n", ep, ep->base_ep.id, ep->tgt_id, ep->srqn, ep->peer_srqn); assert(ep->base_ep.id); addr = rdma_get_local_addr(ep->base_ep.id); if (addr) { ofi_straddr(buf, &len, ep->base_ep.info->addr_format, addr); VERBS_INFO(FI_LOG_FABRIC, "EP %p src_addr: %s\n", ep, buf); } addr = rdma_get_peer_addr(ep->base_ep.id); if (addr) { len = sizeof(buf); ofi_straddr(buf, &len, ep->base_ep.info->addr_format, addr); VERBS_INFO(FI_LOG_FABRIC, "EP %p dst_addr: %s\n", ep, buf); } if (ep->base_ep.ibv_qp) { VERBS_INFO(FI_LOG_FABRIC, "EP %p, INI QP Num %d\n", ep, ep->base_ep.ibv_qp->qp_num); VERBS_INFO(FI_LOG_FABRIC, "EP %p, Remote TGT QP Num %d\n", ep, ep->ini_conn->tgt_qpn); } if (ep->tgt_ibv_qp) VERBS_INFO(FI_LOG_FABRIC, "EP %p, TGT QP Num %d\n", ep, ep->tgt_ibv_qp->qp_num); if (ep->conn_setup && ep->conn_setup->rsvd_ini_qpn) VERBS_INFO(FI_LOG_FABRIC, "EP %p, Reserved INI QPN %d\n", ep, ep->conn_setup->rsvd_ini_qpn->qp_num); if (ep->conn_setup && ep->conn_setup->rsvd_tgt_qpn) VERBS_INFO(FI_LOG_FABRIC, "EP %p, Reserved TGT QPN %d\n", ep, ep->conn_setup->rsvd_tgt_qpn->qp_num); }
void *psmx2_ep_name_to_string(const struct psmx2_ep_name *name, size_t *len) { char *s; if (!name) return NULL; *len = PSMX2_MAX_STRING_NAME_LEN; s = calloc(*len, 1); if (!s) return NULL; if (!ofi_straddr((void *)s, len, FI_ADDR_PSMX2, name)) { free(s); return NULL; } return s; }
static const char *efa_av_straddr(struct fid_av *av_fid, const void *addr, char *buf, size_t *len) { return ofi_straddr(buf, len, FI_ADDR_EFA, addr); }