david/ipxe
david
/
ipxe
Archived
1
0
Fork 0

[infiniband] Assign names to Infiniband devices for debug messages

Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
Michael Brown 2016-03-04 09:17:08 +00:00
parent ff13eeb747
commit d7794dcac7
8 changed files with 140 additions and 118 deletions

View File

@ -388,6 +388,9 @@ struct ib_device_operations {
union ib_mad *mad );
};
/** Maximum length of an Infiniband device name */
#define IBDEV_NAME_LEN 8
/** An Infiniband device */
struct ib_device {
/** Reference counter */
@ -396,6 +399,10 @@ struct ib_device {
struct list_head list;
/** List of open Infiniband devices */
struct list_head open_list;
/** Index of this Infiniband device */
unsigned int index;
/** Name of this Infiniband device */
char name[IBDEV_NAME_LEN];
/** Underlying device */
struct device *dev;
/** List of completion queues */

View File

@ -54,6 +54,9 @@ struct list_head ib_devices = LIST_HEAD_INIT ( ib_devices );
/** List of open Infiniband devices, in reverse order of opening */
static struct list_head open_ib_devices = LIST_HEAD_INIT ( open_ib_devices );
/** Infiniband device index */
static unsigned int ibdev_index = 0;
/** Post send work queue entry profiler */
static struct profiler ib_post_send_profiler __profiler =
{ .name = "ib.post_send" };
@ -97,7 +100,7 @@ ib_create_cq ( struct ib_device *ibdev, unsigned int num_cqes,
struct ib_completion_queue *cq;
int rc;
DBGC ( ibdev, "IBDEV %p creating completion queue\n", ibdev );
DBGC ( ibdev, "IBDEV %s creating completion queue\n", ibdev->name );
/* Allocate and initialise data structure */
cq = zalloc ( sizeof ( *cq ) );
@ -111,13 +114,13 @@ ib_create_cq ( struct ib_device *ibdev, unsigned int num_cqes,
/* Perform device-specific initialisation and get CQN */
if ( ( rc = ibdev->op->create_cq ( ibdev, cq ) ) != 0 ) {
DBGC ( ibdev, "IBDEV %p could not initialise completion "
"queue: %s\n", ibdev, strerror ( rc ) );
DBGC ( ibdev, "IBDEV %s could not initialise completion "
"queue: %s\n", ibdev->name, strerror ( rc ) );
goto err_dev_create_cq;
}
DBGC ( ibdev, "IBDEV %p created %d-entry completion queue %p (%p) "
"with CQN %#lx\n", ibdev, num_cqes, cq,
DBGC ( ibdev, "IBDEV %s created %d-entry completion queue %p (%p) "
"with CQN %#lx\n", ibdev->name, num_cqes, cq,
ib_cq_get_drvdata ( cq ), cq->cqn );
return cq;
@ -137,8 +140,8 @@ ib_create_cq ( struct ib_device *ibdev, unsigned int num_cqes,
*/
void ib_destroy_cq ( struct ib_device *ibdev,
struct ib_completion_queue *cq ) {
DBGC ( ibdev, "IBDEV %p destroying completion queue %#lx\n",
ibdev, cq->cqn );
DBGC ( ibdev, "IBDEV %s destroying completion queue %#lx\n",
ibdev->name, cq->cqn );
assert ( list_empty ( &cq->work_queues ) );
ibdev->op->destroy_cq ( ibdev, cq );
list_del ( &cq->list );
@ -198,7 +201,7 @@ struct ib_queue_pair * ib_create_qp ( struct ib_device *ibdev,
size_t total_size;
int rc;
DBGC ( ibdev, "IBDEV %p creating queue pair\n", ibdev );
DBGC ( ibdev, "IBDEV %s creating queue pair\n", ibdev->name );
/* Allocate and initialise data structure */
total_size = ( sizeof ( *qp ) +
@ -229,17 +232,17 @@ struct ib_queue_pair * ib_create_qp ( struct ib_device *ibdev,
/* Perform device-specific initialisation and get QPN */
if ( ( rc = ibdev->op->create_qp ( ibdev, qp ) ) != 0 ) {
DBGC ( ibdev, "IBDEV %p could not initialise queue pair: "
"%s\n", ibdev, strerror ( rc ) );
DBGC ( ibdev, "IBDEV %s could not initialise queue pair: "
"%s\n", ibdev->name, strerror ( rc ) );
goto err_dev_create_qp;
}
DBGC ( ibdev, "IBDEV %p created queue pair %p (%p) with QPN %#lx\n",
ibdev, qp, ib_qp_get_drvdata ( qp ), qp->qpn );
DBGC ( ibdev, "IBDEV %p QPN %#lx has %d send entries at [%p,%p)\n",
ibdev, qp->qpn, num_send_wqes, qp->send.iobufs,
DBGC ( ibdev, "IBDEV %s created queue pair %p (%p) with QPN %#lx\n",
ibdev->name, qp, ib_qp_get_drvdata ( qp ), qp->qpn );
DBGC ( ibdev, "IBDEV %s QPN %#lx has %d send entries at [%p,%p)\n",
ibdev->name, qp->qpn, num_send_wqes, qp->send.iobufs,
qp->recv.iobufs );
DBGC ( ibdev, "IBDEV %p QPN %#lx has %d receive entries at [%p,%p)\n",
ibdev, qp->qpn, num_recv_wqes, qp->recv.iobufs,
DBGC ( ibdev, "IBDEV %s QPN %#lx has %d receive entries at [%p,%p)\n",
ibdev->name, qp->qpn, num_recv_wqes, qp->recv.iobufs,
( ( ( void * ) qp ) + total_size ) );
/* Calculate externally-visible QPN */
@ -255,8 +258,8 @@ struct ib_queue_pair * ib_create_qp ( struct ib_device *ibdev,
break;
}
if ( qp->ext_qpn != qp->qpn ) {
DBGC ( ibdev, "IBDEV %p QPN %#lx has external QPN %#lx\n",
ibdev, qp->qpn, qp->ext_qpn );
DBGC ( ibdev, "IBDEV %s QPN %#lx has external QPN %#lx\n",
ibdev->name, qp->qpn, qp->ext_qpn );
}
return qp;
@ -281,11 +284,11 @@ struct ib_queue_pair * ib_create_qp ( struct ib_device *ibdev,
int ib_modify_qp ( struct ib_device *ibdev, struct ib_queue_pair *qp ) {
int rc;
DBGC ( ibdev, "IBDEV %p modifying QPN %#lx\n", ibdev, qp->qpn );
DBGC ( ibdev, "IBDEV %s modifying QPN %#lx\n", ibdev->name, qp->qpn );
if ( ( rc = ibdev->op->modify_qp ( ibdev, qp ) ) != 0 ) {
DBGC ( ibdev, "IBDEV %p could not modify QPN %#lx: %s\n",
ibdev, qp->qpn, strerror ( rc ) );
DBGC ( ibdev, "IBDEV %s could not modify QPN %#lx: %s\n",
ibdev->name, qp->qpn, strerror ( rc ) );
return rc;
}
@ -302,8 +305,8 @@ void ib_destroy_qp ( struct ib_device *ibdev, struct ib_queue_pair *qp ) {
struct io_buffer *iobuf;
unsigned int i;
DBGC ( ibdev, "IBDEV %p destroying QPN %#lx\n",
ibdev, qp->qpn );
DBGC ( ibdev, "IBDEV %s destroying QPN %#lx\n",
ibdev->name, qp->qpn );
assert ( list_empty ( &qp->mgids ) );
@ -411,8 +414,8 @@ int ib_post_send ( struct ib_device *ibdev, struct ib_queue_pair *qp,
/* Check queue fill level */
if ( qp->send.fill >= qp->send.num_wqes ) {
DBGC ( ibdev, "IBDEV %p QPN %#lx send queue full\n",
ibdev, qp->qpn );
DBGC ( ibdev, "IBDEV %s QPN %#lx send queue full\n",
ibdev->name, qp->qpn );
return -ENOBUFS;
}
@ -432,8 +435,8 @@ int ib_post_send ( struct ib_device *ibdev, struct ib_queue_pair *qp,
/* Post to hardware */
if ( ( rc = ibdev->op->post_send ( ibdev, qp, dest, iobuf ) ) != 0 ) {
DBGC ( ibdev, "IBDEV %p QPN %#lx could not post send WQE: "
"%s\n", ibdev, qp->qpn, strerror ( rc ) );
DBGC ( ibdev, "IBDEV %s QPN %#lx could not post send WQE: "
"%s\n", ibdev->name, qp->qpn, strerror ( rc ) );
return rc;
}
@ -463,22 +466,22 @@ int ib_post_recv ( struct ib_device *ibdev, struct ib_queue_pair *qp,
/* Check packet length */
if ( iob_tailroom ( iobuf ) < IB_MAX_PAYLOAD_SIZE ) {
DBGC ( ibdev, "IBDEV %p QPN %#lx wrong RX buffer size (%zd)\n",
ibdev, qp->qpn, iob_tailroom ( iobuf ) );
DBGC ( ibdev, "IBDEV %s QPN %#lx wrong RX buffer size (%zd)\n",
ibdev->name, qp->qpn, iob_tailroom ( iobuf ) );
return -EINVAL;
}
/* Check queue fill level */
if ( qp->recv.fill >= qp->recv.num_wqes ) {
DBGC ( ibdev, "IBDEV %p QPN %#lx receive queue full\n",
ibdev, qp->qpn );
DBGC ( ibdev, "IBDEV %s QPN %#lx receive queue full\n",
ibdev->name, qp->qpn );
return -ENOBUFS;
}
/* Post to hardware */
if ( ( rc = ibdev->op->post_recv ( ibdev, qp, iobuf ) ) != 0 ) {
DBGC ( ibdev, "IBDEV %p QPN %#lx could not post receive WQE: "
"%s\n", ibdev, qp->qpn, strerror ( rc ) );
DBGC ( ibdev, "IBDEV %s QPN %#lx could not post receive WQE: "
"%s\n", ibdev->name, qp->qpn, strerror ( rc ) );
return rc;
}
@ -556,8 +559,8 @@ void ib_refill_recv ( struct ib_device *ibdev, struct ib_queue_pair *qp ) {
/* Post I/O buffer */
if ( ( rc = ib_post_recv ( ibdev, qp, iobuf ) ) != 0 ) {
DBGC ( ibdev, "IBDEV %p could not refill: %s\n",
ibdev, strerror ( rc ) );
DBGC ( ibdev, "IBDEV %s could not refill: %s\n",
ibdev->name, strerror ( rc ) );
free_iob ( iobuf );
/* Give up */
return;
@ -623,8 +626,8 @@ static void ib_notify ( struct ib_device *ibdev ) {
*/
void ib_link_state_changed ( struct ib_device *ibdev ) {
DBGC ( ibdev, "IBDEV %p link state is %s\n",
ibdev, ib_link_state_text ( ibdev ) );
DBGC ( ibdev, "IBDEV %s link state is %s\n",
ibdev->name, ib_link_state_text ( ibdev ) );
/* Notify drivers of link state change */
ib_notify ( ibdev );
@ -647,30 +650,30 @@ int ib_open ( struct ib_device *ibdev ) {
/* Open device */
if ( ( rc = ibdev->op->open ( ibdev ) ) != 0 ) {
DBGC ( ibdev, "IBDEV %p could not open: %s\n",
ibdev, strerror ( rc ) );
DBGC ( ibdev, "IBDEV %s could not open: %s\n",
ibdev->name, strerror ( rc ) );
goto err_open;
}
/* Create subnet management interface */
ibdev->smi = ib_create_mi ( ibdev, IB_QPT_SMI );
if ( ! ibdev->smi ) {
DBGC ( ibdev, "IBDEV %p could not create SMI\n", ibdev );
DBGC ( ibdev, "IBDEV %s could not create SMI\n", ibdev->name );
rc = -ENOMEM;
goto err_create_smi;
}
/* Create subnet management agent */
if ( ( rc = ib_create_sma ( ibdev, ibdev->smi ) ) != 0 ) {
DBGC ( ibdev, "IBDEV %p could not create SMA: %s\n",
ibdev, strerror ( rc ) );
DBGC ( ibdev, "IBDEV %s could not create SMA: %s\n",
ibdev->name, strerror ( rc ) );
goto err_create_sma;
}
/* Create general services interface */
ibdev->gsi = ib_create_mi ( ibdev, IB_QPT_GSI );
if ( ! ibdev->gsi ) {
DBGC ( ibdev, "IBDEV %p could not create GSI\n", ibdev );
DBGC ( ibdev, "IBDEV %s could not create GSI\n", ibdev->name );
rc = -ENOMEM;
goto err_create_gsi;
}
@ -833,14 +836,14 @@ int ib_set_port_info ( struct ib_device *ibdev, union ib_mad *mad ) {
/* Adapters with embedded SMAs do not need to support this method */
if ( ! ibdev->op->set_port_info ) {
DBGC ( ibdev, "IBDEV %p does not support setting port "
"information\n", ibdev );
DBGC ( ibdev, "IBDEV %s does not support setting port "
"information\n", ibdev->name );
return -ENOTSUP;
}
if ( ( rc = ibdev->op->set_port_info ( ibdev, mad ) ) != 0 ) {
DBGC ( ibdev, "IBDEV %p could not set port information: %s\n",
ibdev, strerror ( rc ) );
DBGC ( ibdev, "IBDEV %s could not set port information: %s\n",
ibdev->name, strerror ( rc ) );
return rc;
}
@ -858,14 +861,14 @@ int ib_set_pkey_table ( struct ib_device *ibdev, union ib_mad *mad ) {
/* Adapters with embedded SMAs do not need to support this method */
if ( ! ibdev->op->set_pkey_table ) {
DBGC ( ibdev, "IBDEV %p does not support setting partition "
"key table\n", ibdev );
DBGC ( ibdev, "IBDEV %s does not support setting partition "
"key table\n", ibdev->name );
return -ENOTSUP;
}
if ( ( rc = ibdev->op->set_pkey_table ( ibdev, mad ) ) != 0 ) {
DBGC ( ibdev, "IBDEV %p could not set partition key table: "
"%s\n", ibdev, strerror ( rc ) );
DBGC ( ibdev, "IBDEV %s could not set partition key table: "
"%s\n", ibdev->name, strerror ( rc ) );
return rc;
}
@ -954,17 +957,24 @@ int register_ibdev ( struct ib_device *ibdev ) {
struct ib_driver *driver;
int rc;
/* Record device index and create device name */
if ( ibdev->name[0] == '\0' ) {
snprintf ( ibdev->name, sizeof ( ibdev->name ), "inf%d",
ibdev_index );
}
ibdev->index = ++ibdev_index;
/* Add to device list */
ibdev_get ( ibdev );
list_add_tail ( &ibdev->list, &ib_devices );
DBGC ( ibdev, "IBDEV %p registered (phys %s)\n", ibdev,
DBGC ( ibdev, "IBDEV %s registered (phys %s)\n", ibdev->name,
ibdev->dev->name );
/* Probe device */
for_each_table_entry ( driver, IB_DRIVERS ) {
if ( ( rc = driver->probe ( ibdev ) ) != 0 ) {
DBGC ( ibdev, "IBDEV %p could not add %s device: %s\n",
ibdev, driver->name, strerror ( rc ) );
DBGC ( ibdev, "IBDEV %s could not add %s device: %s\n",
ibdev->name, driver->name, strerror ( rc ) );
goto err_probe;
}
}
@ -994,7 +1004,11 @@ void unregister_ibdev ( struct ib_device *ibdev ) {
/* Remove from device list */
list_del ( &ibdev->list );
ibdev_put ( ibdev );
DBGC ( ibdev, "IBDEV %p unregistered\n", ibdev );
DBGC ( ibdev, "IBDEV %s unregistered\n", ibdev->name );
/* Reset device index if no devices remain */
if ( list_empty ( &ib_devices ) )
ibdev_index = 0;
}
/**

View File

@ -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 ) );

View File

@ -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 ) );
}
}

View File

@ -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 ) ) ),

View File

@ -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 );

View File

@ -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;
}

View File

@ -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;
}