iPXE
|
Infiniband Communication-managed Reliable Connections. More...
#include <stdlib.h>
#include <string.h>
#include <errno.h>
#include <ipxe/iobuf.h>
#include <ipxe/xfer.h>
#include <ipxe/process.h>
#include <ipxe/infiniband.h>
#include <ipxe/ib_cm.h>
#include <ipxe/ib_cmrc.h>
Go to the source code of this file.
Data Structures | |
struct | ib_cmrc_connection |
An Infiniband Communication-Managed Reliable Connection. More... | |
Macros | |
#define | IB_CMRC_NUM_SEND_WQES 4 |
CMRC number of send WQEs. More... | |
#define | IB_CMRC_NUM_RECV_WQES 2 |
CMRC number of receive WQEs. More... | |
#define | IB_CMRC_NUM_CQES 8 |
CMRC number of completion queue entries. More... | |
Functions | |
FILE_LICENCE (BSD2) | |
static void | ib_cmrc_shutdown (struct ib_cmrc_connection *cmrc) |
Shut down CMRC connection gracefully. More... | |
static void | ib_cmrc_close (struct ib_cmrc_connection *cmrc, int rc) |
Close CMRC connection. More... | |
static void | ib_cmrc_changed (struct ib_device *ibdev, struct ib_queue_pair *qp, struct ib_connection *conn __unused, int rc_cm, void *private_data, size_t private_data_len) |
Handle change of CMRC connection status. More... | |
static void | ib_cmrc_complete_send (struct ib_device *ibdev, struct ib_queue_pair *qp, struct io_buffer *iobuf, int rc) |
Handle CMRC send completion. More... | |
static void | ib_cmrc_complete_recv (struct ib_device *ibdev, struct ib_queue_pair *qp, struct ib_address_vector *dest __unused, struct ib_address_vector *source __unused, struct io_buffer *iobuf, int rc) |
Handle CMRC receive completion. More... | |
static int | ib_cmrc_xfer_deliver (struct ib_cmrc_connection *cmrc, struct io_buffer *iobuf, struct xfer_metadata *meta __unused) |
Send data via CMRC. More... | |
static size_t | ib_cmrc_xfer_window (struct ib_cmrc_connection *cmrc) |
Check CMRC flow control window. More... | |
static struct device * | ib_cmrc_identify_device (struct ib_cmrc_connection *cmrc) |
Identify device underlying CMRC connection. More... | |
int | ib_cmrc_open (struct interface *xfer, struct ib_device *ibdev, union ib_gid *dgid, union ib_guid *service_id, const char *name) |
Open CMRC connection. More... | |
Variables | |
static struct ib_connection_operations | ib_cmrc_conn_op |
CMRC connection operations. More... | |
static struct ib_completion_queue_operations | ib_cmrc_completion_ops |
Infiniband CMRC completion operations. More... | |
static struct ib_queue_pair_operations | ib_cmrc_queue_pair_ops |
Infiniband CMRC queue pair operations. More... | |
static struct interface_operation | ib_cmrc_xfer_operations [] |
CMRC data transfer interface operations. More... | |
static struct interface_descriptor | ib_cmrc_xfer_desc |
CMRC data transfer interface descriptor. More... | |
static struct process_descriptor | ib_cmrc_shutdown_desc |
CMRC shutdown process descriptor. More... | |
Infiniband Communication-managed Reliable Connections.
Definition in file ib_cmrc.c.
#define IB_CMRC_NUM_SEND_WQES 4 |
#define IB_CMRC_NUM_RECV_WQES 2 |
#define IB_CMRC_NUM_CQES 8 |
FILE_LICENCE | ( | BSD2 | ) |
|
static |
Shut down CMRC connection gracefully.
cmrc | Communication-Managed Reliable Connection |
The Infiniband data structures are not reference-counted or guarded. It is therefore unsafe to shut them down while we may be in the middle of a callback from the Infiniband stack (e.g. in a receive completion handler).
This shutdown process will run some time after the call to ib_cmrc_close(), after control has returned out of the Infiniband core, and will shut down the Infiniband interfaces cleanly.
The shutdown process holds an implicit reference on the CMRC connection, ensuring that the structure is not freed before the shutdown process has run.
Definition at line 112 of file ib_cmrc.c.
References ib_cmrc_connection::conn, ib_cmrc_connection::cq, DBGC, ib_close(), ib_destroy_conn(), ib_destroy_cq(), ib_destroy_qp(), ib_cmrc_connection::ibdev, ib_cmrc_connection::name, ib_device::name, process_del(), ib_cmrc_connection::qp, ref_put, ib_cmrc_connection::refcnt, and ib_cmrc_connection::shutdown.
|
static |
Close CMRC connection.
cmrc | Communication-Managed Reliable Connection |
rc | Reason for close |
Definition at line 137 of file ib_cmrc.c.
References intf_shutdown(), process_add(), rc, ib_cmrc_connection::shutdown, and ib_cmrc_connection::xfer.
Referenced by ib_cmrc_changed(), ib_cmrc_complete_recv(), ib_cmrc_complete_send(), and ib_cmrc_xfer_deliver().
|
static |
Handle change of CMRC connection status.
ibdev | Infiniband device |
qp | Queue pair |
conn | Connection |
rc_cm | Connection status code |
private_data | Private data, if available |
private_data_len | Length of private data |
Definition at line 156 of file ib_cmrc.c.
References ib_cmrc_connection::connected, DBGC, DBGC2, DBGC2_HDA, ib_cmrc_close(), ib_qp_get_ownerdata(), ib_cmrc_connection::ibdev, ib_cmrc_connection::name, ib_device::name, private_data, qp, strerror(), ib_cmrc_connection::xfer, xfer_deliver_raw(), and xfer_window_changed().
|
static |
Handle CMRC send completion.
ibdev | Infiniband device |
qp | Queue pair |
iobuf | I/O buffer |
rc | Completion status code |
Definition at line 210 of file ib_cmrc.c.
References DBGC, free_iob(), ib_cmrc_close(), ib_qp_get_ownerdata(), ib_cmrc_connection::ibdev, ib_cmrc_connection::name, ib_device::name, qp, rc, and strerror().
|
static |
Handle CMRC receive completion.
ibdev | Infiniband device |
qp | Queue pair |
dest | Destination address vector, or NULL |
source | Source address vector, or NULL |
iobuf | I/O buffer |
rc | Completion status code |
Definition at line 237 of file ib_cmrc.c.
References io_buffer::data, DBGC, DBGC2, DBGC2_HDA, free_iob(), ib_cmrc_close(), ib_qp_get_ownerdata(), ib_cmrc_connection::ibdev, iob_len(), ib_cmrc_connection::name, ib_device::name, qp, rc, strerror(), ib_cmrc_connection::xfer, and xfer_deliver_iob().
|
static |
Send data via CMRC.
cmrc | CMRC connection |
iobuf | Datagram I/O buffer |
meta | Data transfer metadata |
rc | Return status code |
Definition at line 284 of file ib_cmrc.c.
References ib_cmrc_connection::conn, ib_cmrc_connection::connected, io_buffer::data, DBGC, ib_cmrc_connection::dgid, EIO, ENOMEM, free_iob(), ib_cmrc_close(), ib_cmrc_conn_op, ib_create_conn(), ib_post_send(), ib_cmrc_connection::ibdev, iob_disown, iob_len(), ib_connection::local_id, ib_cmrc_connection::name, ib_device::name, NULL, out, ib_cmrc_connection::qp, rc, ib_cmrc_connection::service_id, and strerror().
|
static |
Check CMRC flow control window.
cmrc | CMRC connection |
len | Length of window |
Definition at line 348 of file ib_cmrc.c.
References ib_cmrc_connection::connected, and IB_MAX_PAYLOAD_SIZE.
|
static |
Identify device underlying CMRC connection.
cmrc | CMRC connection |
device | Underlying device |
Definition at line 363 of file ib_cmrc.c.
References ib_device::dev, and ib_cmrc_connection::ibdev.
int ib_cmrc_open | ( | struct interface * | xfer, |
struct ib_device * | ibdev, | ||
union ib_gid * | dgid, | ||
union ib_guid * | service_id, | ||
const char * | name | ||
) |
Open CMRC connection.
xfer | Data transfer interface |
ibdev | Infiniband device |
dgid | Destination GID |
service_id | Service ID |
name | Connection name |
rc | Returns status code |
Definition at line 397 of file ib_cmrc.c.
References ib_cmrc_connection::cq, DBGC, dgid, ib_cmrc_connection::dgid, ENOMEM, ib_close(), ib_cmrc_completion_ops, IB_CMRC_NUM_CQES, IB_CMRC_NUM_RECV_WQES, IB_CMRC_NUM_SEND_WQES, ib_cmrc_queue_pair_ops, ib_cmrc_shutdown_desc, ib_cmrc_xfer_desc, ib_create_cq(), ib_create_qp(), ib_destroy_cq(), ib_destroy_qp(), ib_open(), ib_qp_set_ownerdata(), IB_QPT_RC, ib_cmrc_connection::ibdev, intf_init(), intf_plug_plug(), memcpy(), ib_cmrc_connection::name, ib_device::name, name, NULL, process_init_stopped(), ib_cmrc_connection::qp, ib_queue_pair::qpn, rc, ref_init, ref_put, ib_cmrc_connection::refcnt, service_id, ib_cmrc_connection::service_id, ib_cmrc_connection::shutdown, strerror(), ib_cmrc_connection::xfer, and zalloc().
Referenced by ib_srp_open(), and xcm_reopen().
|
static |
CMRC connection operations.
Definition at line 198 of file ib_cmrc.c.
Referenced by ib_cmrc_xfer_deliver().
|
static |
Infiniband CMRC completion operations.
Definition at line 266 of file ib_cmrc.c.
Referenced by ib_cmrc_open().
|
static |
Infiniband CMRC queue pair operations.
Definition at line 272 of file ib_cmrc.c.
Referenced by ib_cmrc_open().
|
static |
CMRC data transfer interface operations.
|
static |
CMRC data transfer interface descriptor.
Definition at line 379 of file ib_cmrc.c.
Referenced by ib_cmrc_open().
|
static |
CMRC shutdown process descriptor.
Definition at line 383 of file ib_cmrc.c.
Referenced by ib_cmrc_open().