ソースを参照

[infiniband] Assign names to Infiniband devices for debug messages

Signed-off-by: Michael Brown <mcb30@ipxe.org>
tags/v1.20.1
Michael Brown 8年前
コミット
d7794dcac7

+ 7
- 0
src/include/ipxe/infiniband.h ファイルの表示

@@ -388,6 +388,9 @@ struct ib_device_operations {
388 388
 				   union ib_mad *mad );
389 389
 };
390 390
 
391
+/** Maximum length of an Infiniband device name */
392
+#define IBDEV_NAME_LEN 8
393
+
391 394
 /** An Infiniband device */
392 395
 struct ib_device {
393 396
 	/** Reference counter */
@@ -396,6 +399,10 @@ struct ib_device {
396 399
 	struct list_head list;
397 400
 	/** List of open Infiniband devices */
398 401
 	struct list_head open_list;
402
+	/** Index of this Infiniband device */
403
+	unsigned int index;
404
+	/** Name of this Infiniband device */
405
+	char name[IBDEV_NAME_LEN];
399 406
 	/** Underlying device */
400 407
 	struct device *dev;
401 408
 	/** List of completion queues */

+ 69
- 55
src/net/infiniband.c ファイルの表示

@@ -54,6 +54,9 @@ struct list_head ib_devices = LIST_HEAD_INIT ( ib_devices );
54 54
 /** List of open Infiniband devices, in reverse order of opening */
55 55
 static struct list_head open_ib_devices = LIST_HEAD_INIT ( open_ib_devices );
56 56
 
57
+/** Infiniband device index */
58
+static unsigned int ibdev_index = 0;
59
+
57 60
 /** Post send work queue entry profiler */
58 61
 static struct profiler ib_post_send_profiler __profiler =
59 62
 	{ .name = "ib.post_send" };
@@ -97,7 +100,7 @@ ib_create_cq ( struct ib_device *ibdev, unsigned int num_cqes,
97 100
 	struct ib_completion_queue *cq;
98 101
 	int rc;
99 102
 
100
-	DBGC ( ibdev, "IBDEV %p creating completion queue\n", ibdev );
103
+	DBGC ( ibdev, "IBDEV %s creating completion queue\n", ibdev->name );
101 104
 
102 105
 	/* Allocate and initialise data structure */
103 106
 	cq = zalloc ( sizeof ( *cq ) );
@@ -111,13 +114,13 @@ ib_create_cq ( struct ib_device *ibdev, unsigned int num_cqes,
111 114
 
112 115
 	/* Perform device-specific initialisation and get CQN */
113 116
 	if ( ( rc = ibdev->op->create_cq ( ibdev, cq ) ) != 0 ) {
114
-		DBGC ( ibdev, "IBDEV %p could not initialise completion "
115
-		       "queue: %s\n", ibdev, strerror ( rc ) );
117
+		DBGC ( ibdev, "IBDEV %s could not initialise completion "
118
+		       "queue: %s\n", ibdev->name, strerror ( rc ) );
116 119
 		goto err_dev_create_cq;
117 120
 	}
118 121
 
119
-	DBGC ( ibdev, "IBDEV %p created %d-entry completion queue %p (%p) "
120
-	       "with CQN %#lx\n", ibdev, num_cqes, cq,
122
+	DBGC ( ibdev, "IBDEV %s created %d-entry completion queue %p (%p) "
123
+	       "with CQN %#lx\n", ibdev->name, num_cqes, cq,
121 124
 	       ib_cq_get_drvdata ( cq ), cq->cqn );
122 125
 	return cq;
123 126
 
@@ -137,8 +140,8 @@ ib_create_cq ( struct ib_device *ibdev, unsigned int num_cqes,
137 140
  */
138 141
 void ib_destroy_cq ( struct ib_device *ibdev,
139 142
 		     struct ib_completion_queue *cq ) {
140
-	DBGC ( ibdev, "IBDEV %p destroying completion queue %#lx\n",
141
-	       ibdev, cq->cqn );
143
+	DBGC ( ibdev, "IBDEV %s destroying completion queue %#lx\n",
144
+	       ibdev->name, cq->cqn );
142 145
 	assert ( list_empty ( &cq->work_queues ) );
143 146
 	ibdev->op->destroy_cq ( ibdev, cq );
144 147
 	list_del ( &cq->list );
@@ -198,7 +201,7 @@ struct ib_queue_pair * ib_create_qp ( struct ib_device *ibdev,
198 201
 	size_t total_size;
199 202
 	int rc;
200 203
 
201
-	DBGC ( ibdev, "IBDEV %p creating queue pair\n", ibdev );
204
+	DBGC ( ibdev, "IBDEV %s creating queue pair\n", ibdev->name );
202 205
 
203 206
 	/* Allocate and initialise data structure */
204 207
 	total_size = ( sizeof ( *qp ) +
@@ -229,17 +232,17 @@ struct ib_queue_pair * ib_create_qp ( struct ib_device *ibdev,
229 232
 
230 233
 	/* Perform device-specific initialisation and get QPN */
231 234
 	if ( ( rc = ibdev->op->create_qp ( ibdev, qp ) ) != 0 ) {
232
-		DBGC ( ibdev, "IBDEV %p could not initialise queue pair: "
233
-		       "%s\n", ibdev, strerror ( rc ) );
235
+		DBGC ( ibdev, "IBDEV %s could not initialise queue pair: "
236
+		       "%s\n", ibdev->name, strerror ( rc ) );
234 237
 		goto err_dev_create_qp;
235 238
 	}
236
-	DBGC ( ibdev, "IBDEV %p created queue pair %p (%p) with QPN %#lx\n",
237
-	       ibdev, qp, ib_qp_get_drvdata ( qp ), qp->qpn );
238
-	DBGC ( ibdev, "IBDEV %p QPN %#lx has %d send entries at [%p,%p)\n",
239
-	       ibdev, qp->qpn, num_send_wqes, qp->send.iobufs,
239
+	DBGC ( ibdev, "IBDEV %s created queue pair %p (%p) with QPN %#lx\n",
240
+	       ibdev->name, qp, ib_qp_get_drvdata ( qp ), qp->qpn );
241
+	DBGC ( ibdev, "IBDEV %s QPN %#lx has %d send entries at [%p,%p)\n",
242
+	       ibdev->name, qp->qpn, num_send_wqes, qp->send.iobufs,
240 243
 	       qp->recv.iobufs );
241
-	DBGC ( ibdev, "IBDEV %p QPN %#lx has %d receive entries at [%p,%p)\n",
242
-	       ibdev, qp->qpn, num_recv_wqes, qp->recv.iobufs,
244
+	DBGC ( ibdev, "IBDEV %s QPN %#lx has %d receive entries at [%p,%p)\n",
245
+	       ibdev->name, qp->qpn, num_recv_wqes, qp->recv.iobufs,
243 246
 	       ( ( ( void * ) qp ) + total_size ) );
244 247
 
245 248
 	/* Calculate externally-visible QPN */
@@ -255,8 +258,8 @@ struct ib_queue_pair * ib_create_qp ( struct ib_device *ibdev,
255 258
 		break;
256 259
 	}
257 260
 	if ( qp->ext_qpn != qp->qpn ) {
258
-		DBGC ( ibdev, "IBDEV %p QPN %#lx has external QPN %#lx\n",
259
-		       ibdev, qp->qpn, qp->ext_qpn );
261
+		DBGC ( ibdev, "IBDEV %s QPN %#lx has external QPN %#lx\n",
262
+		       ibdev->name, qp->qpn, qp->ext_qpn );
260 263
 	}
261 264
 
262 265
 	return qp;
@@ -281,11 +284,11 @@ struct ib_queue_pair * ib_create_qp ( struct ib_device *ibdev,
281 284
 int ib_modify_qp ( struct ib_device *ibdev, struct ib_queue_pair *qp ) {
282 285
 	int rc;
283 286
 
284
-	DBGC ( ibdev, "IBDEV %p modifying QPN %#lx\n", ibdev, qp->qpn );
287
+	DBGC ( ibdev, "IBDEV %s modifying QPN %#lx\n", ibdev->name, qp->qpn );
285 288
 
286 289
 	if ( ( rc = ibdev->op->modify_qp ( ibdev, qp ) ) != 0 ) {
287
-		DBGC ( ibdev, "IBDEV %p could not modify QPN %#lx: %s\n",
288
-		       ibdev, qp->qpn, strerror ( rc ) );
290
+		DBGC ( ibdev, "IBDEV %s could not modify QPN %#lx: %s\n",
291
+		       ibdev->name, qp->qpn, strerror ( rc ) );
289 292
 		return rc;
290 293
 	}
291 294
 
@@ -302,8 +305,8 @@ void ib_destroy_qp ( struct ib_device *ibdev, struct ib_queue_pair *qp ) {
302 305
 	struct io_buffer *iobuf;
303 306
 	unsigned int i;
304 307
 
305
-	DBGC ( ibdev, "IBDEV %p destroying QPN %#lx\n",
306
-	       ibdev, qp->qpn );
308
+	DBGC ( ibdev, "IBDEV %s destroying QPN %#lx\n",
309
+	       ibdev->name, qp->qpn );
307 310
 
308 311
 	assert ( list_empty ( &qp->mgids ) );
309 312
 
@@ -411,8 +414,8 @@ int ib_post_send ( struct ib_device *ibdev, struct ib_queue_pair *qp,
411 414
 
412 415
 	/* Check queue fill level */
413 416
 	if ( qp->send.fill >= qp->send.num_wqes ) {
414
-		DBGC ( ibdev, "IBDEV %p QPN %#lx send queue full\n",
415
-		       ibdev, qp->qpn );
417
+		DBGC ( ibdev, "IBDEV %s QPN %#lx send queue full\n",
418
+		       ibdev->name, qp->qpn );
416 419
 		return -ENOBUFS;
417 420
 	}
418 421
 
@@ -432,8 +435,8 @@ int ib_post_send ( struct ib_device *ibdev, struct ib_queue_pair *qp,
432 435
 
433 436
 	/* Post to hardware */
434 437
 	if ( ( rc = ibdev->op->post_send ( ibdev, qp, dest, iobuf ) ) != 0 ) {
435
-		DBGC ( ibdev, "IBDEV %p QPN %#lx could not post send WQE: "
436
-		       "%s\n", ibdev, qp->qpn, strerror ( rc ) );
438
+		DBGC ( ibdev, "IBDEV %s QPN %#lx could not post send WQE: "
439
+		       "%s\n", ibdev->name, qp->qpn, strerror ( rc ) );
437 440
 		return rc;
438 441
 	}
439 442
 
@@ -463,22 +466,22 @@ int ib_post_recv ( struct ib_device *ibdev, struct ib_queue_pair *qp,
463 466
 
464 467
 	/* Check packet length */
465 468
 	if ( iob_tailroom ( iobuf ) < IB_MAX_PAYLOAD_SIZE ) {
466
-		DBGC ( ibdev, "IBDEV %p QPN %#lx wrong RX buffer size (%zd)\n",
467
-		       ibdev, qp->qpn, iob_tailroom ( iobuf ) );
469
+		DBGC ( ibdev, "IBDEV %s QPN %#lx wrong RX buffer size (%zd)\n",
470
+		       ibdev->name, qp->qpn, iob_tailroom ( iobuf ) );
468 471
 		return -EINVAL;
469 472
 	}
470 473
 
471 474
 	/* Check queue fill level */
472 475
 	if ( qp->recv.fill >= qp->recv.num_wqes ) {
473
-		DBGC ( ibdev, "IBDEV %p QPN %#lx receive queue full\n",
474
-		       ibdev, qp->qpn );
476
+		DBGC ( ibdev, "IBDEV %s QPN %#lx receive queue full\n",
477
+		       ibdev->name, qp->qpn );
475 478
 		return -ENOBUFS;
476 479
 	}
477 480
 
478 481
 	/* Post to hardware */
479 482
 	if ( ( rc = ibdev->op->post_recv ( ibdev, qp, iobuf ) ) != 0 ) {
480
-		DBGC ( ibdev, "IBDEV %p QPN %#lx could not post receive WQE: "
481
-		       "%s\n", ibdev, qp->qpn, strerror ( rc ) );
483
+		DBGC ( ibdev, "IBDEV %s QPN %#lx could not post receive WQE: "
484
+		       "%s\n", ibdev->name, qp->qpn, strerror ( rc ) );
482 485
 		return rc;
483 486
 	}
484 487
 
@@ -556,8 +559,8 @@ void ib_refill_recv ( struct ib_device *ibdev, struct ib_queue_pair *qp ) {
556 559
 
557 560
 		/* Post I/O buffer */
558 561
 		if ( ( rc = ib_post_recv ( ibdev, qp, iobuf ) ) != 0 ) {
559
-			DBGC ( ibdev, "IBDEV %p could not refill: %s\n",
560
-			       ibdev, strerror ( rc ) );
562
+			DBGC ( ibdev, "IBDEV %s could not refill: %s\n",
563
+			       ibdev->name, strerror ( rc ) );
561 564
 			free_iob ( iobuf );
562 565
 			/* Give up */
563 566
 			return;
@@ -623,8 +626,8 @@ static void ib_notify ( struct ib_device *ibdev ) {
623 626
  */
624 627
 void ib_link_state_changed ( struct ib_device *ibdev ) {
625 628
 
626
-	DBGC ( ibdev, "IBDEV %p link state is %s\n",
627
-	       ibdev, ib_link_state_text ( ibdev ) );
629
+	DBGC ( ibdev, "IBDEV %s link state is %s\n",
630
+	       ibdev->name, ib_link_state_text ( ibdev ) );
628 631
 
629 632
 	/* Notify drivers of link state change */
630 633
 	ib_notify ( ibdev );
@@ -647,30 +650,30 @@ int ib_open ( struct ib_device *ibdev ) {
647 650
 
648 651
 	/* Open device */
649 652
 	if ( ( rc = ibdev->op->open ( ibdev ) ) != 0 ) {
650
-		DBGC ( ibdev, "IBDEV %p could not open: %s\n",
651
-		       ibdev, strerror ( rc ) );
653
+		DBGC ( ibdev, "IBDEV %s could not open: %s\n",
654
+		       ibdev->name, strerror ( rc ) );
652 655
 		goto err_open;
653 656
 	}
654 657
 
655 658
 	/* Create subnet management interface */
656 659
 	ibdev->smi = ib_create_mi ( ibdev, IB_QPT_SMI );
657 660
 	if ( ! ibdev->smi ) {
658
-		DBGC ( ibdev, "IBDEV %p could not create SMI\n", ibdev );
661
+		DBGC ( ibdev, "IBDEV %s could not create SMI\n", ibdev->name );
659 662
 		rc = -ENOMEM;
660 663
 		goto err_create_smi;
661 664
 	}
662 665
 
663 666
 	/* Create subnet management agent */
664 667
 	if ( ( rc = ib_create_sma ( ibdev, ibdev->smi ) ) != 0 ) {
665
-		DBGC ( ibdev, "IBDEV %p could not create SMA: %s\n",
666
-		       ibdev, strerror ( rc ) );
668
+		DBGC ( ibdev, "IBDEV %s could not create SMA: %s\n",
669
+		       ibdev->name, strerror ( rc ) );
667 670
 		goto err_create_sma;
668 671
 	}
669 672
 
670 673
 	/* Create general services interface */
671 674
 	ibdev->gsi = ib_create_mi ( ibdev, IB_QPT_GSI );
672 675
 	if ( ! ibdev->gsi ) {
673
-		DBGC ( ibdev, "IBDEV %p could not create GSI\n", ibdev );
676
+		DBGC ( ibdev, "IBDEV %s could not create GSI\n", ibdev->name );
674 677
 		rc = -ENOMEM;
675 678
 		goto err_create_gsi;
676 679
 	}
@@ -833,14 +836,14 @@ int ib_set_port_info ( struct ib_device *ibdev, union ib_mad *mad ) {
833 836
 
834 837
 	/* Adapters with embedded SMAs do not need to support this method */
835 838
 	if ( ! ibdev->op->set_port_info ) {
836
-		DBGC ( ibdev, "IBDEV %p does not support setting port "
837
-		       "information\n", ibdev );
839
+		DBGC ( ibdev, "IBDEV %s does not support setting port "
840
+		       "information\n", ibdev->name );
838 841
 		return -ENOTSUP;
839 842
 	}
840 843
 
841 844
 	if ( ( rc = ibdev->op->set_port_info ( ibdev, mad ) ) != 0 ) {
842
-		DBGC ( ibdev, "IBDEV %p could not set port information: %s\n",
843
-		       ibdev, strerror ( rc ) );
845
+		DBGC ( ibdev, "IBDEV %s could not set port information: %s\n",
846
+		       ibdev->name, strerror ( rc ) );
844 847
 		return rc;
845 848
 	}
846 849
 
@@ -858,14 +861,14 @@ int ib_set_pkey_table ( struct ib_device *ibdev, union ib_mad *mad ) {
858 861
 
859 862
 	/* Adapters with embedded SMAs do not need to support this method */
860 863
 	if ( ! ibdev->op->set_pkey_table ) {
861
-		DBGC ( ibdev, "IBDEV %p does not support setting partition "
862
-		       "key table\n", ibdev );
864
+		DBGC ( ibdev, "IBDEV %s does not support setting partition "
865
+		       "key table\n", ibdev->name );
863 866
 		return -ENOTSUP;
864 867
 	}
865 868
 
866 869
 	if ( ( rc = ibdev->op->set_pkey_table ( ibdev, mad ) ) != 0 ) {
867
-		DBGC ( ibdev, "IBDEV %p could not set partition key table: "
868
-		       "%s\n", ibdev, strerror ( rc ) );
870
+		DBGC ( ibdev, "IBDEV %s could not set partition key table: "
871
+		       "%s\n", ibdev->name, strerror ( rc ) );
869 872
 		return rc;
870 873
 	}
871 874
 
@@ -954,17 +957,24 @@ int register_ibdev ( struct ib_device *ibdev ) {
954 957
 	struct ib_driver *driver;
955 958
 	int rc;
956 959
 
960
+	/* Record device index and create device name */
961
+	if ( ibdev->name[0] == '\0' ) {
962
+		snprintf ( ibdev->name, sizeof ( ibdev->name ), "inf%d",
963
+			   ibdev_index );
964
+	}
965
+	ibdev->index = ++ibdev_index;
966
+
957 967
 	/* Add to device list */
958 968
 	ibdev_get ( ibdev );
959 969
 	list_add_tail ( &ibdev->list, &ib_devices );
960
-	DBGC ( ibdev, "IBDEV %p registered (phys %s)\n", ibdev,
970
+	DBGC ( ibdev, "IBDEV %s registered (phys %s)\n", ibdev->name,
961 971
 	       ibdev->dev->name );
962 972
 
963 973
 	/* Probe device */
964 974
 	for_each_table_entry ( driver, IB_DRIVERS ) {
965 975
 		if ( ( rc = driver->probe ( ibdev ) ) != 0 ) {
966
-			DBGC ( ibdev, "IBDEV %p could not add %s device: %s\n",
967
-			       ibdev, driver->name, strerror ( rc ) );
976
+			DBGC ( ibdev, "IBDEV %s could not add %s device: %s\n",
977
+			       ibdev->name, driver->name, strerror ( rc ) );
968 978
 			goto err_probe;
969 979
 		}
970 980
 	}
@@ -994,7 +1004,11 @@ void unregister_ibdev ( struct ib_device *ibdev ) {
994 1004
 	/* Remove from device list */
995 1005
 	list_del ( &ibdev->list );
996 1006
 	ibdev_put ( ibdev );
997
-	DBGC ( ibdev, "IBDEV %p unregistered\n", ibdev );
1007
+	DBGC ( ibdev, "IBDEV %s unregistered\n", ibdev->name );
1008
+
1009
+	/* Reset device index if no devices remain */
1010
+	if ( list_empty ( &ib_devices ) )
1011
+		ibdev_index = 0;
998 1012
 }
999 1013
 
1000 1014
 /**

+ 2
- 2
src/net/infiniband/ib_cm.c ファイルの表示

@@ -466,8 +466,8 @@ ib_create_conn ( struct ib_device *ibdev, struct ib_queue_pair *qp,
466 466
 	/* Add to list of connections */
467 467
 	list_add ( &conn->list, &ib_cm_conns );
468 468
 
469
-	DBGC ( conn, "CM %p created for IBDEV %p QPN %lx\n",
470
-	       conn, ibdev, qp->qpn );
469
+	DBGC ( conn, "CM %p created for IBDEV %s QPN %lx\n",
470
+	       conn, ibdev->name, qp->qpn );
471 471
 	DBGC ( conn, "CM %p connecting to " IB_GID_FMT " " IB_GUID_FMT "\n",
472 472
 	       conn, IB_GID_ARGS ( dgid ), IB_GUID_ARGS ( service_id ) );
473 473
 

+ 16
- 16
src/net/infiniband/ib_mcast.c ファイルの表示

@@ -94,23 +94,23 @@ static void ib_mcast_complete ( struct ib_device *ibdev,
94 94
 	if ( ( rc == 0 ) && ( mad->hdr.status != htons ( IB_MGMT_STATUS_OK ) ))
95 95
 		rc = -ENOTCONN;
96 96
 	if ( rc != 0 ) {
97
-		DBGC ( ibdev, "IBDEV %p QPN %lx join failed: %s\n",
98
-		       ibdev, qp->qpn, strerror ( rc ) );
97
+		DBGC ( ibdev, "IBDEV %s QPN %lx join failed: %s\n",
98
+		       ibdev->name, qp->qpn, strerror ( rc ) );
99 99
 		goto out;
100 100
 	}
101 101
 
102 102
 	/* Extract values from MAD */
103 103
 	joined = ( mad->hdr.method == IB_MGMT_METHOD_GET_RESP );
104 104
 	qkey = ntohl ( mc_member_record->qkey );
105
-	DBGC ( ibdev, "IBDEV %p QPN %lx %s " IB_GID_FMT " qkey %lx\n",
106
-	       ibdev, qp->qpn, ( joined ? "joined" : "left" ),
105
+	DBGC ( ibdev, "IBDEV %s QPN %lx %s " IB_GID_FMT " qkey %lx\n",
106
+	       ibdev->name, qp->qpn, ( joined ? "joined" : "left" ),
107 107
 	       IB_GID_ARGS ( gid ), qkey );
108 108
 
109 109
 	/* Set queue key */
110 110
 	qp->qkey = qkey;
111 111
 	if ( ( rc = ib_modify_qp ( ibdev, qp ) ) != 0 ) {
112
-		DBGC ( ibdev, "IBDEV %p QPN %lx could not modify qkey: %s\n",
113
-		       ibdev, qp->qpn, strerror ( rc ) );
112
+		DBGC ( ibdev, "IBDEV %s QPN %lx could not modify qkey: %s\n",
113
+		       ibdev->name, qp->qpn, strerror ( rc ) );
114 114
 		goto out;
115 115
 	}
116 116
 
@@ -147,8 +147,8 @@ int ib_mcast_join ( struct ib_device *ibdev, struct ib_queue_pair *qp,
147 147
 	union ib_mad mad;
148 148
 	int rc;
149 149
 
150
-	DBGC ( ibdev, "IBDEV %p QPN %lx joining " IB_GID_FMT "\n",
151
-	       ibdev, qp->qpn, IB_GID_ARGS ( gid ) );
150
+	DBGC ( ibdev, "IBDEV %s QPN %lx joining " IB_GID_FMT "\n",
151
+	       ibdev->name, qp->qpn, IB_GID_ARGS ( gid ) );
152 152
 
153 153
 	/* Sanity check */
154 154
 	assert ( qp != NULL );
@@ -160,8 +160,8 @@ int ib_mcast_join ( struct ib_device *ibdev, struct ib_queue_pair *qp,
160 160
 
161 161
 	/* Attach queue pair to multicast GID */
162 162
 	if ( ( rc = ib_mcast_attach ( ibdev, qp, gid ) ) != 0 ) {
163
-		DBGC ( ibdev, "IBDEV %p QPN %lx could not attach: %s\n",
164
-		       ibdev, qp->qpn, strerror ( rc ) );
163
+		DBGC ( ibdev, "IBDEV %s QPN %lx could not attach: %s\n",
164
+		       ibdev->name, qp->qpn, strerror ( rc ) );
165 165
 		goto err_mcast_attach;
166 166
 	}
167 167
 
@@ -170,8 +170,8 @@ int ib_mcast_join ( struct ib_device *ibdev, struct ib_queue_pair *qp,
170 170
 	membership->madx = ib_create_madx ( ibdev, ibdev->gsi, &mad, NULL,
171 171
 					    &ib_mcast_op );
172 172
 	if ( ! membership->madx ) {
173
-		DBGC ( ibdev, "IBDEV %p QPN %lx could not create join "
174
-		       "transaction\n", ibdev, qp->qpn );
173
+		DBGC ( ibdev, "IBDEV %s QPN %lx could not create join "
174
+		       "transaction\n", ibdev->name, qp->qpn );
175 175
 		rc = -ENOMEM;
176 176
 		goto err_create_madx;
177 177
 	}
@@ -199,8 +199,8 @@ void ib_mcast_leave ( struct ib_device *ibdev, struct ib_queue_pair *qp,
199 199
 	union ib_mad mad;
200 200
 	int rc;
201 201
 
202
-	DBGC ( ibdev, "IBDEV %p QPN %lx leaving " IB_GID_FMT "\n",
203
-	       ibdev, qp->qpn, IB_GID_ARGS ( gid ) );
202
+	DBGC ( ibdev, "IBDEV %s QPN %lx leaving " IB_GID_FMT "\n",
203
+	       ibdev->name, qp->qpn, IB_GID_ARGS ( gid ) );
204 204
 
205 205
 	/* Sanity check */
206 206
 	assert ( qp != NULL );
@@ -217,7 +217,7 @@ void ib_mcast_leave ( struct ib_device *ibdev, struct ib_queue_pair *qp,
217 217
 	/* Send a single group leave MAD */
218 218
 	ib_mcast_mad ( ibdev, &membership->gid, 0, &mad );
219 219
 	if ( ( rc = ib_mi_send ( ibdev, ibdev->gsi, &mad, NULL ) ) != 0 ) {
220
-		DBGC ( ibdev, "IBDEV %p QPN %lx could not send leave request: "
221
-		       "%s\n", ibdev, qp->qpn, strerror ( rc ) );
220
+		DBGC ( ibdev, "IBDEV %s QPN %lx could not send leave request: "
221
+		       "%s\n", ibdev->name, qp->qpn, strerror ( rc ) );
222 222
 	}
223 223
 }

+ 23
- 22
src/net/infiniband/ib_packet.c ファイルの表示

@@ -63,8 +63,8 @@ int ib_push ( struct ib_device *ibdev, struct io_buffer *iobuf,
63 63
 	unsigned int vl;
64 64
 	unsigned int lnh;
65 65
 
66
-	DBGC2 ( ibdev, "IBDEV %p TX %04x:%08lx => %04x:%08lx (key %08lx)\n",
67
-		ibdev, ibdev->lid, qp->ext_qpn, dest->lid, dest->qpn,
66
+	DBGC2 ( ibdev, "IBDEV %s TX %04x:%08lx => %04x:%08lx (key %08lx)\n",
67
+		ibdev->name, ibdev->lid, qp->ext_qpn, dest->lid, dest->qpn,
68 68
 		dest->qkey );
69 69
 
70 70
 	/* Calculate packet length */
@@ -152,8 +152,8 @@ int ib_pull ( struct ib_device *ibdev, struct io_buffer *iobuf,
152 152
 
153 153
 	/* Extract LRH */
154 154
 	if ( iob_len ( iobuf ) < sizeof ( *lrh ) ) {
155
-		DBGC ( ibdev, "IBDEV %p RX too short (%zd bytes) for LRH\n",
156
-		       ibdev, iob_len ( iobuf ) );
155
+		DBGC ( ibdev, "IBDEV %s RX too short (%zd bytes) for LRH\n",
156
+		       ibdev->name, iob_len ( iobuf ) );
157 157
 		return -EINVAL;
158 158
 	}
159 159
 	lrh = iobuf->data;
@@ -166,16 +166,16 @@ int ib_pull ( struct ib_device *ibdev, struct io_buffer *iobuf,
166 166
 
167 167
 	/* Reject unsupported packets */
168 168
 	if ( ! ( ( lnh == IB_LNH_BTH ) || ( lnh == IB_LNH_GRH ) ) ) {
169
-		DBGC ( ibdev, "IBDEV %p RX unsupported LNH %x\n",
170
-		       ibdev, lnh );
169
+		DBGC ( ibdev, "IBDEV %s RX unsupported LNH %x\n",
170
+		       ibdev->name, lnh );
171 171
 		return -ENOTSUP;
172 172
 	}
173 173
 
174 174
 	/* Extract GRH, if present */
175 175
 	if ( lnh == IB_LNH_GRH ) {
176 176
 		if ( iob_len ( iobuf ) < sizeof ( *grh ) ) {
177
-			DBGC ( ibdev, "IBDEV %p RX too short (%zd bytes) "
178
-			       "for GRH\n", ibdev, iob_len ( iobuf ) );
177
+			DBGC ( ibdev, "IBDEV %s RX too short (%zd bytes) "
178
+			       "for GRH\n", ibdev->name, iob_len ( iobuf ) );
179 179
 			return -EINVAL;
180 180
 		}
181 181
 		grh = iobuf->data;
@@ -190,23 +190,23 @@ int ib_pull ( struct ib_device *ibdev, struct io_buffer *iobuf,
190 190
 
191 191
 	/* Extract BTH */
192 192
 	if ( iob_len ( iobuf ) < sizeof ( *bth ) ) {
193
-		DBGC ( ibdev, "IBDEV %p RX too short (%zd bytes) for BTH\n",
194
-		       ibdev, iob_len ( iobuf ) );
193
+		DBGC ( ibdev, "IBDEV %s RX too short (%zd bytes) for BTH\n",
194
+		       ibdev->name, iob_len ( iobuf ) );
195 195
 		return -EINVAL;
196 196
 	}
197 197
 	bth = iobuf->data;
198 198
 	iob_pull ( iobuf, sizeof ( *bth ) );
199 199
 	if ( bth->opcode != BTH_OPCODE_UD_SEND ) {
200
-		DBGC ( ibdev, "IBDEV %p unsupported BTH opcode %x\n",
201
-		       ibdev, bth->opcode );
200
+		DBGC ( ibdev, "IBDEV %s unsupported BTH opcode %x\n",
201
+		       ibdev->name, bth->opcode );
202 202
 		return -ENOTSUP;
203 203
 	}
204 204
 	dest->qpn = ntohl ( bth->dest_qp );
205 205
 
206 206
 	/* Extract DETH */
207 207
 	if ( iob_len ( iobuf ) < sizeof ( *deth ) ) {
208
-		DBGC ( ibdev, "IBDEV %p RX too short (%zd bytes) for DETH\n",
209
-		       ibdev, iob_len ( iobuf ) );
208
+		DBGC ( ibdev, "IBDEV %s RX too short (%zd bytes) for DETH\n",
209
+		       ibdev->name, iob_len ( iobuf ) );
210 210
 		return -EINVAL;
211 211
 	}
212 212
 	deth = iobuf->data;
@@ -226,24 +226,25 @@ int ib_pull ( struct ib_device *ibdev, struct io_buffer *iobuf,
226 226
 	if ( qp ) {
227 227
 		if ( IB_LID_MULTICAST ( dest->lid ) && grh ) {
228 228
 			if ( ! ( *qp = ib_find_qp_mgid ( ibdev, &grh->dgid ))){
229
-				DBGC ( ibdev, "IBDEV %p RX for unknown MGID "
230
-				       IB_GID_FMT "\n",
231
-				       ibdev, IB_GID_ARGS ( &grh->dgid ) );
229
+				DBGC ( ibdev, "IBDEV %s RX for unknown MGID "
230
+				       IB_GID_FMT "\n", ibdev->name,
231
+				       IB_GID_ARGS ( &grh->dgid ) );
232 232
 				return -ENODEV;
233 233
 			}
234 234
 		} else {
235 235
 			if ( ! ( *qp = ib_find_qp_qpn ( ibdev, dest->qpn ) ) ) {
236
-				DBGC ( ibdev, "IBDEV %p RX for nonexistent "
237
-				       "QPN %lx\n", ibdev, dest->qpn );
236
+				DBGC ( ibdev, "IBDEV %s RX for nonexistent "
237
+				       "QPN %lx\n", ibdev->name, dest->qpn );
238 238
 				return -ENODEV;
239 239
 			}
240 240
 		}
241 241
 		assert ( *qp );
242 242
 	}
243 243
 
244
-	DBGC2 ( ibdev, "IBDEV %p RX %04x:%08lx <= %04x:%08lx (key %08x)\n",
245
-		ibdev, dest->lid, ( IB_LID_MULTICAST ( dest->lid ) ?
246
-			      ( qp ? (*qp)->ext_qpn : -1UL ) : dest->qpn ),
244
+	DBGC2 ( ibdev, "IBDEV %s RX %04x:%08lx <= %04x:%08lx (key %08x)\n",
245
+		ibdev->name, dest->lid,
246
+		( IB_LID_MULTICAST ( dest->lid ) ?
247
+		  ( qp ? (*qp)->ext_qpn : -1UL ) : dest->qpn ),
247 248
 		source->lid, source->qpn, ntohl ( deth->qkey ) );
248 249
 	DBGCP_HDA ( ibdev, 0,
249 250
 		    ( iobuf->data - ( orig_iob_len - iob_len ( iobuf ) ) ),

+ 12
- 12
src/net/infiniband/ib_pathrec.c ファイルの表示

@@ -61,9 +61,9 @@ static void ib_path_complete ( struct ib_device *ibdev,
61 61
 	if ( ( rc == 0 ) && ( mad->hdr.status != htons ( IB_MGMT_STATUS_OK ) ))
62 62
 		rc = -ENETUNREACH;
63 63
 	if ( rc != 0 ) {
64
-		DBGC ( ibdev, "IBDEV %p path lookup for " IB_GID_FMT
64
+		DBGC ( ibdev, "IBDEV %s path lookup for " IB_GID_FMT
65 65
 		       " failed: %s\n",
66
-		       ibdev, IB_GID_ARGS ( dgid ), strerror ( rc ) );
66
+		       ibdev->name, IB_GID_ARGS ( dgid ), strerror ( rc ) );
67 67
 		goto out;
68 68
 	}
69 69
 
@@ -71,9 +71,9 @@ static void ib_path_complete ( struct ib_device *ibdev,
71 71
 	path->av.lid = ntohs ( pathrec->dlid );
72 72
 	path->av.sl = ( pathrec->reserved__sl & 0x0f );
73 73
 	path->av.rate = ( pathrec->rate_selector__rate & 0x3f );
74
-	DBGC ( ibdev, "IBDEV %p path to " IB_GID_FMT " is %04x sl %d rate "
75
-	       "%d\n", ibdev, IB_GID_ARGS ( dgid ), path->av.lid, path->av.sl,
76
-	       path->av.rate );
74
+	DBGC ( ibdev, "IBDEV %s path to " IB_GID_FMT " is %04x sl %d rate "
75
+	       "%d\n", ibdev->name, IB_GID_ARGS ( dgid ), path->av.lid,
76
+	       path->av.sl, path->av.rate );
77 77
 
78 78
  out:
79 79
 	/* Destroy the completed transaction */
@@ -247,8 +247,8 @@ int ib_resolve_path ( struct ib_device *ibdev, struct ib_address_vector *av ) {
247 247
 
248 248
 	/* Sanity check */
249 249
 	if ( ! av->gid_present ) {
250
-		DBGC ( ibdev, "IBDEV %p attempt to look up path without GID\n",
251
-		       ibdev );
250
+		DBGC ( ibdev, "IBDEV %s attempt to look up path without GID\n",
251
+		       ibdev->name );
252 252
 		return -EINVAL;
253 253
 	}
254 254
 
@@ -259,11 +259,11 @@ int ib_resolve_path ( struct ib_device *ibdev, struct ib_address_vector *av ) {
259 259
 		av->lid = cached->path->av.lid;
260 260
 		av->rate = cached->path->av.rate;
261 261
 		av->sl = cached->path->av.sl;
262
-		DBGC2 ( ibdev, "IBDEV %p cache hit for " IB_GID_FMT "\n",
263
-			ibdev, IB_GID_ARGS ( gid ) );
262
+		DBGC2 ( ibdev, "IBDEV %s cache hit for " IB_GID_FMT "\n",
263
+			ibdev->name, IB_GID_ARGS ( gid ) );
264 264
 		return 0;
265 265
 	}
266
-	DBGC ( ibdev, "IBDEV %p cache miss for " IB_GID_FMT "%s\n", ibdev,
266
+	DBGC ( ibdev, "IBDEV %s cache miss for " IB_GID_FMT "%s\n", ibdev->name,
267 267
 	       IB_GID_ARGS ( gid ), ( cached ? " (in progress)" : "" ) );
268 268
 
269 269
 	/* 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 ) {
282 282
 	/* Create new path */
283 283
 	cached->path = ib_create_path ( ibdev, av, &ib_cached_path_op );
284 284
 	if ( ! cached->path ) {
285
-		DBGC ( ibdev, "IBDEV %p could not create path\n",
286
-		       ibdev );
285
+		DBGC ( ibdev, "IBDEV %s could not create path\n",
286
+		       ibdev->name );
287 287
 		return -ENOMEM;
288 288
 	}
289 289
 	ib_path_set_ownerdata ( cached->path, cached );

+ 1
- 1
src/net/infiniband/ib_sma.c ファイルの表示

@@ -358,7 +358,7 @@ struct ib_mad_agent ib_sma_agent[] __ib_mad_agent = {
358 358
 int ib_create_sma ( struct ib_device *ibdev, struct ib_mad_interface *mi ) {
359 359
 
360 360
 	/* Nothing to do */
361
-	DBGC ( ibdev, "IBDEV %p SMA using SMI %p\n", ibdev, mi );
361
+	DBGC ( ibdev, "IBDEV %s SMA using SMI %p\n", ibdev->name, mi );
362 362
 
363 363
 	return 0;
364 364
 }

+ 10
- 10
src/net/infiniband/ib_smc.c ファイルの表示

@@ -86,8 +86,8 @@ static int ib_smc_get_node_info ( struct ib_device *ibdev,
86 86
 	/* Issue MAD */
87 87
 	if ( ( rc = ib_smc_mad ( ibdev, htons ( IB_SMP_ATTR_NODE_INFO ), 0,
88 88
 				 local_mad, mad ) ) != 0 ) {
89
-		DBGC ( ibdev, "IBDEV %p could not get node info: %s\n",
90
-		       ibdev, strerror ( rc ) );
89
+		DBGC ( ibdev, "IBDEV %s could not get node info: %s\n",
90
+		       ibdev->name, strerror ( rc ) );
91 91
 		return rc;
92 92
 	}
93 93
 	return 0;
@@ -109,8 +109,8 @@ static int ib_smc_get_port_info ( struct ib_device *ibdev,
109 109
 	/* Issue MAD */
110 110
 	if ( ( rc = ib_smc_mad ( ibdev, htons ( IB_SMP_ATTR_PORT_INFO ),
111 111
 				 htonl ( ibdev->port ), local_mad, mad )) !=0){
112
-		DBGC ( ibdev, "IBDEV %p could not get port info: %s\n",
113
-		       ibdev, strerror ( rc ) );
112
+		DBGC ( ibdev, "IBDEV %s could not get port info: %s\n",
113
+		       ibdev->name, strerror ( rc ) );
114 114
 		return rc;
115 115
 	}
116 116
 	return 0;
@@ -132,8 +132,8 @@ static int ib_smc_get_guid_info ( struct ib_device *ibdev,
132 132
 	/* Issue MAD */
133 133
 	if ( ( rc = ib_smc_mad ( ibdev, htons ( IB_SMP_ATTR_GUID_INFO ), 0,
134 134
 				 local_mad, mad ) ) != 0 ) {
135
-		DBGC ( ibdev, "IBDEV %p could not get GUID info: %s\n",
136
-		       ibdev, strerror ( rc ) );
135
+		DBGC ( ibdev, "IBDEV %s could not get GUID info: %s\n",
136
+		       ibdev->name, strerror ( rc ) );
137 137
 		return rc;
138 138
 	}
139 139
 	return 0;
@@ -155,8 +155,8 @@ static int ib_smc_get_pkey_table ( struct ib_device *ibdev,
155 155
 	/* Issue MAD */
156 156
 	if ( ( rc = ib_smc_mad ( ibdev, htons ( IB_SMP_ATTR_PKEY_TABLE ), 0,
157 157
 				 local_mad, mad ) ) != 0 ) {
158
-		DBGC ( ibdev, "IBDEV %p could not get pkey table: %s\n",
159
-		       ibdev, strerror ( rc ) );
158
+		DBGC ( ibdev, "IBDEV %s could not get pkey table: %s\n",
159
+		       ibdev->name, strerror ( rc ) );
160 160
 		return rc;
161 161
 	}
162 162
 	return 0;
@@ -216,8 +216,8 @@ static int ib_smc_get ( struct ib_device *ibdev, ib_local_mad_t local_mad ) {
216 216
 		return rc;
217 217
 	ibdev->pkey = ntohs ( pkey_table->pkey[0] );
218 218
 
219
-	DBGC ( ibdev, "IBDEV %p port GID is " IB_GID_FMT "\n",
220
-	       ibdev, IB_GID_ARGS ( &ibdev->gid ) );
219
+	DBGC ( ibdev, "IBDEV %s port GID is " IB_GID_FMT "\n",
220
+	       ibdev->name, IB_GID_ARGS ( &ibdev->gid ) );
221 221
 
222 222
 	return 0;
223 223
 }

読み込み中…
キャンセル
保存