54 #define IB_CMRC_NUM_SEND_WQES 4 60 #define IB_CMRC_NUM_RECV_WQES 2 66 #define IB_CMRC_NUM_CQES 8 115 DBGC ( cmrc,
"CMRC %s %s shutting down\n",
165 DBGC ( cmrc,
"CMRC %s %s connected\n",
169 DBGC ( cmrc,
"CMRC %s %s disconnected: %s\n",
175 DBGC2 ( cmrc,
"CMRC %s %s received private data:\n",
180 private_data_len ) ) != 0 ) {
181 DBGC ( cmrc,
"CMRC %s %s could not deliver private data: %s\n",
220 DBGC ( cmrc,
"CMRC %s %s send error: %s\n",
246 DBGC ( cmrc,
"CMRC %s %s receive error: %s\n",
258 DBGC ( cmrc,
"CMRC %s %s could not deliver data: %s\n",
297 DBGC ( cmrc,
"CMRC %s %s attempt to send before " 298 "connection is complete\n",
309 if ( ! cmrc->
conn ) {
310 DBGC ( cmrc,
"CMRC %s %s could not connect\n",
315 DBGC ( cmrc,
"CMRC %s %s using CM %08x\n",
323 DBGC ( cmrc,
"CMRC %s %s could not send: %s\n",
404 cmrc =
zalloc (
sizeof ( *cmrc ) );
420 DBGC ( cmrc,
"CMRC %s %s could not open device: %s\n",
428 DBGC ( cmrc,
"CMRC %s %s could not create completion queue: " 437 &cmrc->
qp ) ) != 0 ) {
438 DBGC ( cmrc,
"CMRC %s %s could not create queue pair: %s\n",
443 DBGC ( cmrc,
"CMRC %s %s using QPN %#lx\n",
An object interface operation.
struct ib_completion_queue * cq
Completion queue.
struct arbelprm_rc_send_wqe rc
void xfer_window_changed(struct interface *intf)
Report change of flow control window.
void intf_close(struct interface *intf, int rc)
Close an object interface.
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.
void intf_shutdown(struct interface *intf, int rc)
Shut down an object interface.
static struct interface_descriptor ib_cmrc_xfer_desc
CMRC data transfer interface descriptor.
int xfer_deliver_iob(struct interface *intf, struct io_buffer *iobuf)
Deliver datagram as I/O buffer without metadata.
char name[IBDEV_NAME_LEN]
Name of this Infiniband device.
#define ref_init(refcnt, free)
Initialise a reference counter.
Infiniband connection operations.
void free_iob(struct io_buffer *iobuf)
Free I/O buffer.
static struct device * ib_cmrc_identify_device(struct ib_cmrc_connection *cmrc)
Identify device underlying CMRC connection.
int ib_create_cq(struct ib_device *ibdev, unsigned int num_cqes, struct ib_completion_queue_operations *op, struct ib_completion_queue **new_cq)
Create completion queue.
static struct ib_queue_pair_operations ib_cmrc_queue_pair_ops
Infiniband CMRC queue pair operations.
struct io_buffer *(* alloc_iob)(size_t len)
Allocate receive I/O buffer.
int ib_open(struct ib_device *ibdev)
Open port.
void intf_plug_plug(struct interface *a, struct interface *b)
Plug two object interfaces together.
struct device * dev
Underlying device.
static int ib_cmrc_xfer_deliver(struct ib_cmrc_connection *cmrc, struct io_buffer *iobuf, struct xfer_metadata *meta __unused)
Send data via CMRC.
static size_t ib_cmrc_xfer_window(struct ib_cmrc_connection *cmrc)
Check CMRC flow control window.
static struct process_descriptor ib_cmrc_shutdown_desc
CMRC shutdown process descriptor.
#define PROC_DESC_ONCE(object_type, process, _step)
Define a process descriptor for a process that runs only once.
void ib_close(struct ib_device *ibdev)
Close port.
struct process shutdown
Shutdown process.
struct ib_connection * ib_create_conn(struct ib_device *ibdev, struct ib_queue_pair *qp, union ib_gid *dgid, union ib_guid *service_id, void *private_data, size_t private_data_len, struct ib_connection_operations *op)
Create connection to remote QP.
void process_del(struct process *process)
Remove process from process list.
struct io_buffer * alloc_iob(size_t len)
Allocate I/O buffer.
An Infiniband Global Identifier.
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.
size_t xfer_window(struct interface *intf)
Check flow control window.
union ib_gid dgid
Destination GID.
int xfer_deliver_raw(struct interface *intf, const void *data, size_t len)
Deliver datagram as raw data without metadata.
void ib_destroy_cq(struct ib_device *ibdev, struct ib_completion_queue *cq)
Destroy completion queue.
Data transfer interfaces.
uint32_t local_id
Local communication ID.
void(* changed)(struct ib_device *ibdev, struct ib_queue_pair *qp, struct ib_connection *conn, int rc, void *private_data, size_t private_data_len)
Handle change of connection status.
#define ENOMEM
Not enough space.
#define iob_disown(iobuf)
Disown an I/O buffer.
#define IB_CMRC_NUM_RECV_WQES
CMRC number of receive WQEs.
Infiniband completion queue operations.
void * memcpy(void *dest, const void *src, size_t len) __nonnull
Infiniband queue pair operations.
#define __unused
Declare a variable or data structure as unused.
An Infiniband Communication-Managed Reliable Connection.
unsigned long qpn
Queue pair number.
#define IB_CMRC_NUM_SEND_WQES
CMRC number of send WQEs.
void process_add(struct process *process)
Add process to process list.
#define IB_CMRC_NUM_CQES
CMRC number of completion queue entries.
An object interface descriptor.
char * strerror(int errno)
Retrieve string representation of error number.
static __always_inline void * ib_qp_get_ownerdata(struct ib_queue_pair *qp)
Get Infiniband queue pair owner-private data.
void * zalloc(size_t size)
Allocate cleared memory.
static struct interface_operation ib_cmrc_xfer_operations[]
CMRC data transfer interface operations.
static size_t iob_len(struct io_buffer *iobuf)
Calculate length of data in an I/O buffer.
#define INTF_OP(op_type, object_type, op_func)
Define an object interface operation.
An Infiniband Globally Unique Identifier.
int xfer_deliver(struct interface *intf, struct io_buffer *iobuf, struct xfer_metadata *meta)
Deliver datagram.
An Infiniband Completion Queue.
void ib_destroy_qp(struct ib_device *ibdev, struct ib_queue_pair *qp)
Destroy queue pair.
int connected
QP is connected.
static void process_init_stopped(struct process *process, struct process_descriptor *desc, struct refcnt *refcnt)
Initialise process without adding to process list.
static struct ib_completion_queue_operations ib_cmrc_completion_ops
Infiniband CMRC completion operations.
An Infiniband connection.
union ib_guid service_id
Service ID.
An Infiniband Queue Pair.
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.
struct arbelprm_qp_db_record qp
int ib_post_send(struct ib_device *ibdev, struct ib_queue_pair *qp, struct ib_address_vector *dest, struct io_buffer *iobuf)
Post send work queue entry.
static void ib_cmrc_shutdown(struct ib_cmrc_connection *cmrc)
Shut down CMRC connection gracefully.
#define INTF_DESC(object_type, intf, operations)
Define an object interface descriptor.
struct interface xfer
Data transfer interface.
struct refcnt refcnt
Reference count.
Infiniband Communication-managed Reliable Connections.
struct ib_connection * conn
Connection.
static void ib_cmrc_close(struct ib_cmrc_connection *cmrc, int rc)
Close CMRC connection.
int ib_create_qp(struct ib_device *ibdev, enum ib_queue_pair_type type, unsigned int num_send_wqes, struct ib_completion_queue *send_cq, unsigned int num_recv_wqes, struct ib_completion_queue *recv_cq, struct ib_queue_pair_operations *op, const char *name, struct ib_queue_pair **new_qp)
Create queue pair.
void ib_destroy_conn(struct ib_device *ibdev, struct ib_queue_pair *qp __unused, struct ib_connection *conn)
Destroy connection to remote QP.
void * data
Start of data.
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.
#define EIO
Input/output error.
uint8_t private_data[92]
Private data.
void(* complete_send)(struct ib_device *ibdev, struct ib_queue_pair *qp, struct io_buffer *iobuf, int rc)
Complete Send WQE.
static struct ib_connection_operations ib_cmrc_conn_op
CMRC connection operations.
if(len >=6 *4) __asm__ __volatile__("movsl" if(len >=5 *4) __asm__ __volatile__("movsl" if(len >=4 *4) __asm__ __volatile__("movsl" if(len >=3 *4) __asm__ __volatile__("movsl" if(len >=2 *4) __asm__ __volatile__("movsl" if(len >=1 *4) __asm__ __volatile__("movsl" if((len % 4) >=2) __asm__ __volatile__("movsw" if((len % 2) >=1) __asm__ __volatile__("movsb" return dest
Infiniband communication management.
An Infiniband Address Vector.
void shutdown(int flags)
Shut down iPXE.
struct device * identify_device(struct interface *intf)
Identify a device behind an interface.
struct ib_queue_pair * qp
Queue pair.
union ib_guid service_id
Service ID.
static void intf_init(struct interface *intf, struct interface_descriptor *desc, struct refcnt *refcnt)
Initialise an object interface.
#define NULL
NULL pointer (VOID *)
static __always_inline void ib_qp_set_ownerdata(struct ib_queue_pair *qp, void *priv)
Set Infiniband queue pair owner-private data.
struct ib_device * ibdev
Infiniband device.
#define ref_put(refcnt)
Drop reference to object.
#define IB_MAX_PAYLOAD_SIZE
Maximum payload size.