diff options
author | Michael Brown | 2016-01-10 16:44:00 +0100 |
---|---|---|
committer | Michael Brown | 2016-01-10 16:44:00 +0100 |
commit | 7c6858e95df1e0b654286049c15a4a48982ef8af (patch) | |
tree | 5f0fa3c9370cf9c4d4898e039e33d97d3d8ac960 /src/net/infiniband.c | |
parent | [tftp] Do not change current working URI when TFTP server is cleared (diff) | |
download | ipxe-7c6858e95df1e0b654286049c15a4a48982ef8af.tar.gz ipxe-7c6858e95df1e0b654286049c15a4a48982ef8af.tar.xz ipxe-7c6858e95df1e0b654286049c15a4a48982ef8af.zip |
[infiniband] Profile post work queue entry operations
Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/net/infiniband.c')
-rw-r--r-- | src/net/infiniband.c | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/src/net/infiniband.c b/src/net/infiniband.c index 2e3d76d5..c059fe8c 100644 --- a/src/net/infiniband.c +++ b/src/net/infiniband.c @@ -37,6 +37,7 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); #include <ipxe/netdevice.h> #include <ipxe/iobuf.h> #include <ipxe/process.h> +#include <ipxe/profile.h> #include <ipxe/infiniband.h> #include <ipxe/ib_mi.h> #include <ipxe/ib_sma.h> @@ -53,6 +54,14 @@ 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 ); +/** Post send work queue entry profiler */ +static struct profiler ib_post_send_profiler __profiler = + { .name = "ib.post_send" }; + +/** Post receive work queue entry profiler */ +static struct profiler ib_post_recv_profiler __profiler = + { .name = "ib.post_recv" }; + /* Disambiguate the various possible EINPROGRESSes */ #define EINPROGRESS_INIT __einfo_error ( EINFO_EINPROGRESS_INIT ) #define EINFO_EINPROGRESS_INIT __einfo_uniqify \ @@ -397,6 +406,9 @@ int ib_post_send ( struct ib_device *ibdev, struct ib_queue_pair *qp, struct ib_address_vector dest_copy; int rc; + /* Start profiling */ + profile_start ( &ib_post_send_profiler ); + /* Check queue fill level */ if ( qp->send.fill >= qp->send.num_wqes ) { DBGC ( ibdev, "IBDEV %p QPN %#lx send queue full\n", @@ -425,7 +437,12 @@ int ib_post_send ( struct ib_device *ibdev, struct ib_queue_pair *qp, return rc; } + /* Increase fill level */ qp->send.fill++; + + /* Stop profiling */ + profile_stop ( &ib_post_send_profiler ); + return 0; } @@ -441,6 +458,9 @@ int ib_post_recv ( struct ib_device *ibdev, struct ib_queue_pair *qp, struct io_buffer *iobuf ) { int rc; + /* Start profiling */ + profile_start ( &ib_post_recv_profiler ); + /* Check packet length */ if ( iob_tailroom ( iobuf ) < IB_MAX_PAYLOAD_SIZE ) { DBGC ( ibdev, "IBDEV %p QPN %#lx wrong RX buffer size (%zd)\n", @@ -462,7 +482,12 @@ int ib_post_recv ( struct ib_device *ibdev, struct ib_queue_pair *qp, return rc; } + /* Increase fill level */ qp->recv.fill++; + + /* Stop profiling */ + profile_stop ( &ib_post_recv_profiler ); + return 0; } |