mirror of
https://github.com/ipxe/ipxe
synced 2025-12-20 20:10:18 +03:00
[infiniband] Profile post work queue entry operations
Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
@@ -37,6 +37,7 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
|
|||||||
#include <ipxe/netdevice.h>
|
#include <ipxe/netdevice.h>
|
||||||
#include <ipxe/iobuf.h>
|
#include <ipxe/iobuf.h>
|
||||||
#include <ipxe/process.h>
|
#include <ipxe/process.h>
|
||||||
|
#include <ipxe/profile.h>
|
||||||
#include <ipxe/infiniband.h>
|
#include <ipxe/infiniband.h>
|
||||||
#include <ipxe/ib_mi.h>
|
#include <ipxe/ib_mi.h>
|
||||||
#include <ipxe/ib_sma.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 */
|
/** List of open Infiniband devices, in reverse order of opening */
|
||||||
static struct list_head open_ib_devices = LIST_HEAD_INIT ( open_ib_devices );
|
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 */
|
/* Disambiguate the various possible EINPROGRESSes */
|
||||||
#define EINPROGRESS_INIT __einfo_error ( EINFO_EINPROGRESS_INIT )
|
#define EINPROGRESS_INIT __einfo_error ( EINFO_EINPROGRESS_INIT )
|
||||||
#define EINFO_EINPROGRESS_INIT __einfo_uniqify \
|
#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;
|
struct ib_address_vector dest_copy;
|
||||||
int rc;
|
int rc;
|
||||||
|
|
||||||
|
/* Start profiling */
|
||||||
|
profile_start ( &ib_post_send_profiler );
|
||||||
|
|
||||||
/* Check queue fill level */
|
/* Check queue fill level */
|
||||||
if ( qp->send.fill >= qp->send.num_wqes ) {
|
if ( qp->send.fill >= qp->send.num_wqes ) {
|
||||||
DBGC ( ibdev, "IBDEV %p QPN %#lx send queue full\n",
|
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;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Increase fill level */
|
||||||
qp->send.fill++;
|
qp->send.fill++;
|
||||||
|
|
||||||
|
/* Stop profiling */
|
||||||
|
profile_stop ( &ib_post_send_profiler );
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -441,6 +458,9 @@ int ib_post_recv ( struct ib_device *ibdev, struct ib_queue_pair *qp,
|
|||||||
struct io_buffer *iobuf ) {
|
struct io_buffer *iobuf ) {
|
||||||
int rc;
|
int rc;
|
||||||
|
|
||||||
|
/* Start profiling */
|
||||||
|
profile_start ( &ib_post_recv_profiler );
|
||||||
|
|
||||||
/* Check packet length */
|
/* Check packet length */
|
||||||
if ( iob_tailroom ( iobuf ) < IB_MAX_PAYLOAD_SIZE ) {
|
if ( iob_tailroom ( iobuf ) < IB_MAX_PAYLOAD_SIZE ) {
|
||||||
DBGC ( ibdev, "IBDEV %p QPN %#lx wrong RX buffer size (%zd)\n",
|
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;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Increase fill level */
|
||||||
qp->recv.fill++;
|
qp->recv.fill++;
|
||||||
|
|
||||||
|
/* Stop profiling */
|
||||||
|
profile_stop ( &ib_post_recv_profiler );
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user