Browse Source

[infiniband] Profile post work queue entry operations

Signed-off-by: Michael Brown <mcb30@ipxe.org>
tags/v1.20.1
Michael Brown 9 years ago
parent
commit
7c6858e95d
1 changed files with 25 additions and 0 deletions
  1. 25
    0
      src/net/infiniband.c

+ 25
- 0
src/net/infiniband.c View File

37
 #include <ipxe/netdevice.h>
37
 #include <ipxe/netdevice.h>
38
 #include <ipxe/iobuf.h>
38
 #include <ipxe/iobuf.h>
39
 #include <ipxe/process.h>
39
 #include <ipxe/process.h>
40
+#include <ipxe/profile.h>
40
 #include <ipxe/infiniband.h>
41
 #include <ipxe/infiniband.h>
41
 #include <ipxe/ib_mi.h>
42
 #include <ipxe/ib_mi.h>
42
 #include <ipxe/ib_sma.h>
43
 #include <ipxe/ib_sma.h>
53
 /** List of open Infiniband devices, in reverse order of opening */
54
 /** List of open Infiniband devices, in reverse order of opening */
54
 static struct list_head open_ib_devices = LIST_HEAD_INIT ( open_ib_devices );
55
 static struct list_head open_ib_devices = LIST_HEAD_INIT ( open_ib_devices );
55
 
56
 
57
+/** Post send work queue entry profiler */
58
+static struct profiler ib_post_send_profiler __profiler =
59
+	{ .name = "ib.post_send" };
60
+
61
+/** Post receive work queue entry profiler */
62
+static struct profiler ib_post_recv_profiler __profiler =
63
+	{ .name = "ib.post_recv" };
64
+
56
 /* Disambiguate the various possible EINPROGRESSes */
65
 /* Disambiguate the various possible EINPROGRESSes */
57
 #define EINPROGRESS_INIT __einfo_error ( EINFO_EINPROGRESS_INIT )
66
 #define EINPROGRESS_INIT __einfo_error ( EINFO_EINPROGRESS_INIT )
58
 #define EINFO_EINPROGRESS_INIT __einfo_uniqify \
67
 #define EINFO_EINPROGRESS_INIT __einfo_uniqify \
397
 	struct ib_address_vector dest_copy;
406
 	struct ib_address_vector dest_copy;
398
 	int rc;
407
 	int rc;
399
 
408
 
409
+	/* Start profiling */
410
+	profile_start ( &ib_post_send_profiler );
411
+
400
 	/* Check queue fill level */
412
 	/* Check queue fill level */
401
 	if ( qp->send.fill >= qp->send.num_wqes ) {
413
 	if ( qp->send.fill >= qp->send.num_wqes ) {
402
 		DBGC ( ibdev, "IBDEV %p QPN %#lx send queue full\n",
414
 		DBGC ( ibdev, "IBDEV %p QPN %#lx send queue full\n",
425
 		return rc;
437
 		return rc;
426
 	}
438
 	}
427
 
439
 
440
+	/* Increase fill level */
428
 	qp->send.fill++;
441
 	qp->send.fill++;
442
+
443
+	/* Stop profiling */
444
+	profile_stop ( &ib_post_send_profiler );
445
+
429
 	return 0;
446
 	return 0;
430
 }
447
 }
431
 
448
 
441
 		   struct io_buffer *iobuf ) {
458
 		   struct io_buffer *iobuf ) {
442
 	int rc;
459
 	int rc;
443
 
460
 
461
+	/* Start profiling */
462
+	profile_start ( &ib_post_recv_profiler );
463
+
444
 	/* Check packet length */
464
 	/* Check packet length */
445
 	if ( iob_tailroom ( iobuf ) < IB_MAX_PAYLOAD_SIZE ) {
465
 	if ( iob_tailroom ( iobuf ) < IB_MAX_PAYLOAD_SIZE ) {
446
 		DBGC ( ibdev, "IBDEV %p QPN %#lx wrong RX buffer size (%zd)\n",
466
 		DBGC ( ibdev, "IBDEV %p QPN %#lx wrong RX buffer size (%zd)\n",
462
 		return rc;
482
 		return rc;
463
 	}
483
 	}
464
 
484
 
485
+	/* Increase fill level */
465
 	qp->recv.fill++;
486
 	qp->recv.fill++;
487
+
488
+	/* Stop profiling */
489
+	profile_stop ( &ib_post_recv_profiler );
490
+
466
 	return 0;
491
 	return 0;
467
 }
492
 }
468
 
493
 

Loading…
Cancel
Save