[infiniband] Assign names to Infiniband devices for debug messages
Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
@@ -466,8 +466,8 @@ ib_create_conn ( struct ib_device *ibdev, struct ib_queue_pair *qp,
|
||||
/* Add to list of connections */
|
||||
list_add ( &conn->list, &ib_cm_conns );
|
||||
|
||||
DBGC ( conn, "CM %p created for IBDEV %p QPN %lx\n",
|
||||
conn, ibdev, qp->qpn );
|
||||
DBGC ( conn, "CM %p created for IBDEV %s QPN %lx\n",
|
||||
conn, ibdev->name, qp->qpn );
|
||||
DBGC ( conn, "CM %p connecting to " IB_GID_FMT " " IB_GUID_FMT "\n",
|
||||
conn, IB_GID_ARGS ( dgid ), IB_GUID_ARGS ( service_id ) );
|
||||
|
||||
|
||||
@@ -94,23 +94,23 @@ static void ib_mcast_complete ( struct ib_device *ibdev,
|
||||
if ( ( rc == 0 ) && ( mad->hdr.status != htons ( IB_MGMT_STATUS_OK ) ))
|
||||
rc = -ENOTCONN;
|
||||
if ( rc != 0 ) {
|
||||
DBGC ( ibdev, "IBDEV %p QPN %lx join failed: %s\n",
|
||||
ibdev, qp->qpn, strerror ( rc ) );
|
||||
DBGC ( ibdev, "IBDEV %s QPN %lx join failed: %s\n",
|
||||
ibdev->name, qp->qpn, strerror ( rc ) );
|
||||
goto out;
|
||||
}
|
||||
|
||||
/* Extract values from MAD */
|
||||
joined = ( mad->hdr.method == IB_MGMT_METHOD_GET_RESP );
|
||||
qkey = ntohl ( mc_member_record->qkey );
|
||||
DBGC ( ibdev, "IBDEV %p QPN %lx %s " IB_GID_FMT " qkey %lx\n",
|
||||
ibdev, qp->qpn, ( joined ? "joined" : "left" ),
|
||||
DBGC ( ibdev, "IBDEV %s QPN %lx %s " IB_GID_FMT " qkey %lx\n",
|
||||
ibdev->name, qp->qpn, ( joined ? "joined" : "left" ),
|
||||
IB_GID_ARGS ( gid ), qkey );
|
||||
|
||||
/* Set queue key */
|
||||
qp->qkey = qkey;
|
||||
if ( ( rc = ib_modify_qp ( ibdev, qp ) ) != 0 ) {
|
||||
DBGC ( ibdev, "IBDEV %p QPN %lx could not modify qkey: %s\n",
|
||||
ibdev, qp->qpn, strerror ( rc ) );
|
||||
DBGC ( ibdev, "IBDEV %s QPN %lx could not modify qkey: %s\n",
|
||||
ibdev->name, qp->qpn, strerror ( rc ) );
|
||||
goto out;
|
||||
}
|
||||
|
||||
@@ -147,8 +147,8 @@ int ib_mcast_join ( struct ib_device *ibdev, struct ib_queue_pair *qp,
|
||||
union ib_mad mad;
|
||||
int rc;
|
||||
|
||||
DBGC ( ibdev, "IBDEV %p QPN %lx joining " IB_GID_FMT "\n",
|
||||
ibdev, qp->qpn, IB_GID_ARGS ( gid ) );
|
||||
DBGC ( ibdev, "IBDEV %s QPN %lx joining " IB_GID_FMT "\n",
|
||||
ibdev->name, qp->qpn, IB_GID_ARGS ( gid ) );
|
||||
|
||||
/* Sanity check */
|
||||
assert ( qp != NULL );
|
||||
@@ -160,8 +160,8 @@ int ib_mcast_join ( struct ib_device *ibdev, struct ib_queue_pair *qp,
|
||||
|
||||
/* Attach queue pair to multicast GID */
|
||||
if ( ( rc = ib_mcast_attach ( ibdev, qp, gid ) ) != 0 ) {
|
||||
DBGC ( ibdev, "IBDEV %p QPN %lx could not attach: %s\n",
|
||||
ibdev, qp->qpn, strerror ( rc ) );
|
||||
DBGC ( ibdev, "IBDEV %s QPN %lx could not attach: %s\n",
|
||||
ibdev->name, qp->qpn, strerror ( rc ) );
|
||||
goto err_mcast_attach;
|
||||
}
|
||||
|
||||
@@ -170,8 +170,8 @@ int ib_mcast_join ( struct ib_device *ibdev, struct ib_queue_pair *qp,
|
||||
membership->madx = ib_create_madx ( ibdev, ibdev->gsi, &mad, NULL,
|
||||
&ib_mcast_op );
|
||||
if ( ! membership->madx ) {
|
||||
DBGC ( ibdev, "IBDEV %p QPN %lx could not create join "
|
||||
"transaction\n", ibdev, qp->qpn );
|
||||
DBGC ( ibdev, "IBDEV %s QPN %lx could not create join "
|
||||
"transaction\n", ibdev->name, qp->qpn );
|
||||
rc = -ENOMEM;
|
||||
goto err_create_madx;
|
||||
}
|
||||
@@ -199,8 +199,8 @@ void ib_mcast_leave ( struct ib_device *ibdev, struct ib_queue_pair *qp,
|
||||
union ib_mad mad;
|
||||
int rc;
|
||||
|
||||
DBGC ( ibdev, "IBDEV %p QPN %lx leaving " IB_GID_FMT "\n",
|
||||
ibdev, qp->qpn, IB_GID_ARGS ( gid ) );
|
||||
DBGC ( ibdev, "IBDEV %s QPN %lx leaving " IB_GID_FMT "\n",
|
||||
ibdev->name, qp->qpn, IB_GID_ARGS ( gid ) );
|
||||
|
||||
/* Sanity check */
|
||||
assert ( qp != NULL );
|
||||
@@ -217,7 +217,7 @@ void ib_mcast_leave ( struct ib_device *ibdev, struct ib_queue_pair *qp,
|
||||
/* Send a single group leave MAD */
|
||||
ib_mcast_mad ( ibdev, &membership->gid, 0, &mad );
|
||||
if ( ( rc = ib_mi_send ( ibdev, ibdev->gsi, &mad, NULL ) ) != 0 ) {
|
||||
DBGC ( ibdev, "IBDEV %p QPN %lx could not send leave request: "
|
||||
"%s\n", ibdev, qp->qpn, strerror ( rc ) );
|
||||
DBGC ( ibdev, "IBDEV %s QPN %lx could not send leave request: "
|
||||
"%s\n", ibdev->name, qp->qpn, strerror ( rc ) );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -63,8 +63,8 @@ int ib_push ( struct ib_device *ibdev, struct io_buffer *iobuf,
|
||||
unsigned int vl;
|
||||
unsigned int lnh;
|
||||
|
||||
DBGC2 ( ibdev, "IBDEV %p TX %04x:%08lx => %04x:%08lx (key %08lx)\n",
|
||||
ibdev, ibdev->lid, qp->ext_qpn, dest->lid, dest->qpn,
|
||||
DBGC2 ( ibdev, "IBDEV %s TX %04x:%08lx => %04x:%08lx (key %08lx)\n",
|
||||
ibdev->name, ibdev->lid, qp->ext_qpn, dest->lid, dest->qpn,
|
||||
dest->qkey );
|
||||
|
||||
/* Calculate packet length */
|
||||
@@ -152,8 +152,8 @@ int ib_pull ( struct ib_device *ibdev, struct io_buffer *iobuf,
|
||||
|
||||
/* Extract LRH */
|
||||
if ( iob_len ( iobuf ) < sizeof ( *lrh ) ) {
|
||||
DBGC ( ibdev, "IBDEV %p RX too short (%zd bytes) for LRH\n",
|
||||
ibdev, iob_len ( iobuf ) );
|
||||
DBGC ( ibdev, "IBDEV %s RX too short (%zd bytes) for LRH\n",
|
||||
ibdev->name, iob_len ( iobuf ) );
|
||||
return -EINVAL;
|
||||
}
|
||||
lrh = iobuf->data;
|
||||
@@ -166,16 +166,16 @@ int ib_pull ( struct ib_device *ibdev, struct io_buffer *iobuf,
|
||||
|
||||
/* Reject unsupported packets */
|
||||
if ( ! ( ( lnh == IB_LNH_BTH ) || ( lnh == IB_LNH_GRH ) ) ) {
|
||||
DBGC ( ibdev, "IBDEV %p RX unsupported LNH %x\n",
|
||||
ibdev, lnh );
|
||||
DBGC ( ibdev, "IBDEV %s RX unsupported LNH %x\n",
|
||||
ibdev->name, lnh );
|
||||
return -ENOTSUP;
|
||||
}
|
||||
|
||||
/* Extract GRH, if present */
|
||||
if ( lnh == IB_LNH_GRH ) {
|
||||
if ( iob_len ( iobuf ) < sizeof ( *grh ) ) {
|
||||
DBGC ( ibdev, "IBDEV %p RX too short (%zd bytes) "
|
||||
"for GRH\n", ibdev, iob_len ( iobuf ) );
|
||||
DBGC ( ibdev, "IBDEV %s RX too short (%zd bytes) "
|
||||
"for GRH\n", ibdev->name, iob_len ( iobuf ) );
|
||||
return -EINVAL;
|
||||
}
|
||||
grh = iobuf->data;
|
||||
@@ -190,23 +190,23 @@ int ib_pull ( struct ib_device *ibdev, struct io_buffer *iobuf,
|
||||
|
||||
/* Extract BTH */
|
||||
if ( iob_len ( iobuf ) < sizeof ( *bth ) ) {
|
||||
DBGC ( ibdev, "IBDEV %p RX too short (%zd bytes) for BTH\n",
|
||||
ibdev, iob_len ( iobuf ) );
|
||||
DBGC ( ibdev, "IBDEV %s RX too short (%zd bytes) for BTH\n",
|
||||
ibdev->name, iob_len ( iobuf ) );
|
||||
return -EINVAL;
|
||||
}
|
||||
bth = iobuf->data;
|
||||
iob_pull ( iobuf, sizeof ( *bth ) );
|
||||
if ( bth->opcode != BTH_OPCODE_UD_SEND ) {
|
||||
DBGC ( ibdev, "IBDEV %p unsupported BTH opcode %x\n",
|
||||
ibdev, bth->opcode );
|
||||
DBGC ( ibdev, "IBDEV %s unsupported BTH opcode %x\n",
|
||||
ibdev->name, bth->opcode );
|
||||
return -ENOTSUP;
|
||||
}
|
||||
dest->qpn = ntohl ( bth->dest_qp );
|
||||
|
||||
/* Extract DETH */
|
||||
if ( iob_len ( iobuf ) < sizeof ( *deth ) ) {
|
||||
DBGC ( ibdev, "IBDEV %p RX too short (%zd bytes) for DETH\n",
|
||||
ibdev, iob_len ( iobuf ) );
|
||||
DBGC ( ibdev, "IBDEV %s RX too short (%zd bytes) for DETH\n",
|
||||
ibdev->name, iob_len ( iobuf ) );
|
||||
return -EINVAL;
|
||||
}
|
||||
deth = iobuf->data;
|
||||
@@ -226,24 +226,25 @@ int ib_pull ( struct ib_device *ibdev, struct io_buffer *iobuf,
|
||||
if ( qp ) {
|
||||
if ( IB_LID_MULTICAST ( dest->lid ) && grh ) {
|
||||
if ( ! ( *qp = ib_find_qp_mgid ( ibdev, &grh->dgid ))){
|
||||
DBGC ( ibdev, "IBDEV %p RX for unknown MGID "
|
||||
IB_GID_FMT "\n",
|
||||
ibdev, IB_GID_ARGS ( &grh->dgid ) );
|
||||
DBGC ( ibdev, "IBDEV %s RX for unknown MGID "
|
||||
IB_GID_FMT "\n", ibdev->name,
|
||||
IB_GID_ARGS ( &grh->dgid ) );
|
||||
return -ENODEV;
|
||||
}
|
||||
} else {
|
||||
if ( ! ( *qp = ib_find_qp_qpn ( ibdev, dest->qpn ) ) ) {
|
||||
DBGC ( ibdev, "IBDEV %p RX for nonexistent "
|
||||
"QPN %lx\n", ibdev, dest->qpn );
|
||||
DBGC ( ibdev, "IBDEV %s RX for nonexistent "
|
||||
"QPN %lx\n", ibdev->name, dest->qpn );
|
||||
return -ENODEV;
|
||||
}
|
||||
}
|
||||
assert ( *qp );
|
||||
}
|
||||
|
||||
DBGC2 ( ibdev, "IBDEV %p RX %04x:%08lx <= %04x:%08lx (key %08x)\n",
|
||||
ibdev, dest->lid, ( IB_LID_MULTICAST ( dest->lid ) ?
|
||||
( qp ? (*qp)->ext_qpn : -1UL ) : dest->qpn ),
|
||||
DBGC2 ( ibdev, "IBDEV %s RX %04x:%08lx <= %04x:%08lx (key %08x)\n",
|
||||
ibdev->name, dest->lid,
|
||||
( IB_LID_MULTICAST ( dest->lid ) ?
|
||||
( qp ? (*qp)->ext_qpn : -1UL ) : dest->qpn ),
|
||||
source->lid, source->qpn, ntohl ( deth->qkey ) );
|
||||
DBGCP_HDA ( ibdev, 0,
|
||||
( iobuf->data - ( orig_iob_len - iob_len ( iobuf ) ) ),
|
||||
|
||||
@@ -61,9 +61,9 @@ static void ib_path_complete ( struct ib_device *ibdev,
|
||||
if ( ( rc == 0 ) && ( mad->hdr.status != htons ( IB_MGMT_STATUS_OK ) ))
|
||||
rc = -ENETUNREACH;
|
||||
if ( rc != 0 ) {
|
||||
DBGC ( ibdev, "IBDEV %p path lookup for " IB_GID_FMT
|
||||
DBGC ( ibdev, "IBDEV %s path lookup for " IB_GID_FMT
|
||||
" failed: %s\n",
|
||||
ibdev, IB_GID_ARGS ( dgid ), strerror ( rc ) );
|
||||
ibdev->name, IB_GID_ARGS ( dgid ), strerror ( rc ) );
|
||||
goto out;
|
||||
}
|
||||
|
||||
@@ -71,9 +71,9 @@ static void ib_path_complete ( struct ib_device *ibdev,
|
||||
path->av.lid = ntohs ( pathrec->dlid );
|
||||
path->av.sl = ( pathrec->reserved__sl & 0x0f );
|
||||
path->av.rate = ( pathrec->rate_selector__rate & 0x3f );
|
||||
DBGC ( ibdev, "IBDEV %p path to " IB_GID_FMT " is %04x sl %d rate "
|
||||
"%d\n", ibdev, IB_GID_ARGS ( dgid ), path->av.lid, path->av.sl,
|
||||
path->av.rate );
|
||||
DBGC ( ibdev, "IBDEV %s path to " IB_GID_FMT " is %04x sl %d rate "
|
||||
"%d\n", ibdev->name, IB_GID_ARGS ( dgid ), path->av.lid,
|
||||
path->av.sl, path->av.rate );
|
||||
|
||||
out:
|
||||
/* Destroy the completed transaction */
|
||||
@@ -247,8 +247,8 @@ int ib_resolve_path ( struct ib_device *ibdev, struct ib_address_vector *av ) {
|
||||
|
||||
/* Sanity check */
|
||||
if ( ! av->gid_present ) {
|
||||
DBGC ( ibdev, "IBDEV %p attempt to look up path without GID\n",
|
||||
ibdev );
|
||||
DBGC ( ibdev, "IBDEV %s attempt to look up path without GID\n",
|
||||
ibdev->name );
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
@@ -259,11 +259,11 @@ int ib_resolve_path ( struct ib_device *ibdev, struct ib_address_vector *av ) {
|
||||
av->lid = cached->path->av.lid;
|
||||
av->rate = cached->path->av.rate;
|
||||
av->sl = cached->path->av.sl;
|
||||
DBGC2 ( ibdev, "IBDEV %p cache hit for " IB_GID_FMT "\n",
|
||||
ibdev, IB_GID_ARGS ( gid ) );
|
||||
DBGC2 ( ibdev, "IBDEV %s cache hit for " IB_GID_FMT "\n",
|
||||
ibdev->name, IB_GID_ARGS ( gid ) );
|
||||
return 0;
|
||||
}
|
||||
DBGC ( ibdev, "IBDEV %p cache miss for " IB_GID_FMT "%s\n", ibdev,
|
||||
DBGC ( ibdev, "IBDEV %s cache miss for " IB_GID_FMT "%s\n", ibdev->name,
|
||||
IB_GID_ARGS ( gid ), ( cached ? " (in progress)" : "" ) );
|
||||
|
||||
/* If lookup is already in progress, do nothing */
|
||||
@@ -282,8 +282,8 @@ int ib_resolve_path ( struct ib_device *ibdev, struct ib_address_vector *av ) {
|
||||
/* Create new path */
|
||||
cached->path = ib_create_path ( ibdev, av, &ib_cached_path_op );
|
||||
if ( ! cached->path ) {
|
||||
DBGC ( ibdev, "IBDEV %p could not create path\n",
|
||||
ibdev );
|
||||
DBGC ( ibdev, "IBDEV %s could not create path\n",
|
||||
ibdev->name );
|
||||
return -ENOMEM;
|
||||
}
|
||||
ib_path_set_ownerdata ( cached->path, cached );
|
||||
|
||||
@@ -358,7 +358,7 @@ struct ib_mad_agent ib_sma_agent[] __ib_mad_agent = {
|
||||
int ib_create_sma ( struct ib_device *ibdev, struct ib_mad_interface *mi ) {
|
||||
|
||||
/* Nothing to do */
|
||||
DBGC ( ibdev, "IBDEV %p SMA using SMI %p\n", ibdev, mi );
|
||||
DBGC ( ibdev, "IBDEV %s SMA using SMI %p\n", ibdev->name, mi );
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
+10
-10
@@ -86,8 +86,8 @@ static int ib_smc_get_node_info ( struct ib_device *ibdev,
|
||||
/* Issue MAD */
|
||||
if ( ( rc = ib_smc_mad ( ibdev, htons ( IB_SMP_ATTR_NODE_INFO ), 0,
|
||||
local_mad, mad ) ) != 0 ) {
|
||||
DBGC ( ibdev, "IBDEV %p could not get node info: %s\n",
|
||||
ibdev, strerror ( rc ) );
|
||||
DBGC ( ibdev, "IBDEV %s could not get node info: %s\n",
|
||||
ibdev->name, strerror ( rc ) );
|
||||
return rc;
|
||||
}
|
||||
return 0;
|
||||
@@ -109,8 +109,8 @@ static int ib_smc_get_port_info ( struct ib_device *ibdev,
|
||||
/* Issue MAD */
|
||||
if ( ( rc = ib_smc_mad ( ibdev, htons ( IB_SMP_ATTR_PORT_INFO ),
|
||||
htonl ( ibdev->port ), local_mad, mad )) !=0){
|
||||
DBGC ( ibdev, "IBDEV %p could not get port info: %s\n",
|
||||
ibdev, strerror ( rc ) );
|
||||
DBGC ( ibdev, "IBDEV %s could not get port info: %s\n",
|
||||
ibdev->name, strerror ( rc ) );
|
||||
return rc;
|
||||
}
|
||||
return 0;
|
||||
@@ -132,8 +132,8 @@ static int ib_smc_get_guid_info ( struct ib_device *ibdev,
|
||||
/* Issue MAD */
|
||||
if ( ( rc = ib_smc_mad ( ibdev, htons ( IB_SMP_ATTR_GUID_INFO ), 0,
|
||||
local_mad, mad ) ) != 0 ) {
|
||||
DBGC ( ibdev, "IBDEV %p could not get GUID info: %s\n",
|
||||
ibdev, strerror ( rc ) );
|
||||
DBGC ( ibdev, "IBDEV %s could not get GUID info: %s\n",
|
||||
ibdev->name, strerror ( rc ) );
|
||||
return rc;
|
||||
}
|
||||
return 0;
|
||||
@@ -155,8 +155,8 @@ static int ib_smc_get_pkey_table ( struct ib_device *ibdev,
|
||||
/* Issue MAD */
|
||||
if ( ( rc = ib_smc_mad ( ibdev, htons ( IB_SMP_ATTR_PKEY_TABLE ), 0,
|
||||
local_mad, mad ) ) != 0 ) {
|
||||
DBGC ( ibdev, "IBDEV %p could not get pkey table: %s\n",
|
||||
ibdev, strerror ( rc ) );
|
||||
DBGC ( ibdev, "IBDEV %s could not get pkey table: %s\n",
|
||||
ibdev->name, strerror ( rc ) );
|
||||
return rc;
|
||||
}
|
||||
return 0;
|
||||
@@ -216,8 +216,8 @@ static int ib_smc_get ( struct ib_device *ibdev, ib_local_mad_t local_mad ) {
|
||||
return rc;
|
||||
ibdev->pkey = ntohs ( pkey_table->pkey[0] );
|
||||
|
||||
DBGC ( ibdev, "IBDEV %p port GID is " IB_GID_FMT "\n",
|
||||
ibdev, IB_GID_ARGS ( &ibdev->gid ) );
|
||||
DBGC ( ibdev, "IBDEV %s port GID is " IB_GID_FMT "\n",
|
||||
ibdev->name, IB_GID_ARGS ( &ibdev->gid ) );
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user