iPXE
|
Infiniband communication management. More...
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
#include <byteswap.h>
#include <errno.h>
#include <assert.h>
#include <ipxe/infiniband.h>
#include <ipxe/ib_mi.h>
#include <ipxe/ib_pathrec.h>
#include <ipxe/ib_cm.h>
Go to the source code of this file.
Functions | |
FILE_LICENCE (GPL2_OR_LATER_OR_UBDL) | |
static | LIST_HEAD (ib_cm_conns) |
List of connections. More... | |
static struct ib_connection * | ib_cm_find (uint32_t local_id) |
Find connection by local communication ID. More... | |
static int | ib_cm_send_rtu (struct ib_device *ibdev, struct ib_mad_interface *mi, struct ib_mad_tid *tid, struct ib_address_vector *av, uint32_t local_id, uint32_t remote_id) |
Send "ready to use" response. More... | |
static void | ib_cm_recv_rep (struct ib_device *ibdev, struct ib_mad_interface *mi, union ib_mad *mad, struct ib_address_vector *av) |
Handle duplicate connection replies. More... | |
static int | ib_cm_send_drep (struct ib_device *ibdev, struct ib_mad_interface *mi, struct ib_mad_tid *tid, struct ib_address_vector *av, uint32_t local_id, uint32_t remote_id) |
Send reply to disconnection request. More... | |
static void | ib_cm_recv_dreq (struct ib_device *ibdev, struct ib_mad_interface *mi, union ib_mad *mad, struct ib_address_vector *av) |
Handle disconnection requests. More... | |
static int | ib_cm_rejection_reason_to_rc (uint16_t reason) |
Convert connection rejection reason to return status code. More... | |
static void | ib_cm_req_complete (struct ib_device *ibdev, struct ib_mad_interface *mi, struct ib_mad_transaction *madx, int rc, union ib_mad *mad, struct ib_address_vector *av) |
Handle connection request transaction completion. More... | |
static void | ib_cm_path_complete (struct ib_device *ibdev, struct ib_path *path, int rc, struct ib_address_vector *av) |
Handle connection path transaction completion. More... | |
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. More... | |
void | ib_destroy_conn (struct ib_device *ibdev, struct ib_queue_pair *qp __unused, struct ib_connection *conn) |
Destroy connection to remote QP. More... | |
Variables | |
struct ib_mad_agent ib_cm_agent [] | __ib_mad_agent |
Communication management agents. More... | |
static struct ib_mad_transaction_operations | ib_cm_req_op |
Connection request operations. More... | |
static struct ib_path_operations | ib_cm_path_op |
Connection path operations. More... | |
Infiniband communication management.
Definition in file ib_cm.c.
FILE_LICENCE | ( | GPL2_OR_LATER_OR_UBDL | ) |
|
static |
List of connections.
|
static |
Find connection by local communication ID.
local_id | Local communication ID |
conn | Connection, or NULL |
Definition at line 53 of file ib_cm.c.
References ib_connection::list, list_for_each_entry, local_id, ib_connection::local_id, and NULL.
Referenced by ib_cm_recv_dreq(), and ib_cm_recv_rep().
|
static |
Send "ready to use" response.
ibdev | Infiniband device |
mi | Management interface |
tid | Transaction identifier |
av | Address vector |
local_id | Local communication ID |
remote_id | Remote communication ID |
rc | Return status code |
Definition at line 74 of file ib_cm.c.
References ib_mad_hdr::attr_id, ib_mad_hdr::class_version, ib_mad::cm, ib_mad_cm::cm_data, DBGC, ib_mad::hdr, htonl, htons, IB_CM_ATTR_READY_TO_USE, IB_CM_CLASS_VERSION, IB_MGMT_CLASS_CM, IB_MGMT_METHOD_SEND, ib_mi_send(), local_id, ib_cm_ready_to_use::local_id, mad, memcpy(), memset(), ib_mad_hdr::method, ib_mad_hdr::mgmt_class, rc, ib_cm_data::ready_to_use, remote_id, ib_cm_ready_to_use::remote_id, strerror(), tid, and ib_mad_hdr::tid.
Referenced by ib_cm_recv_rep(), and ib_cm_req_complete().
|
static |
Handle duplicate connection replies.
ibdev | Infiniband device |
mi | Management interface |
mad | Received MAD |
av | Source address vector |
rc | Return status code |
If a "ready to use" MAD is lost, the peer may resend the connection reply. We have to respond to these with duplicate "ready to use" MADs, otherwise the peer may time out and drop the connection.
Definition at line 114 of file ib_cm.c.
References ib_mad::cm, ib_mad_cm::cm_data, ib_cm_data::connect_reply, DBGC, ib_mad::hdr, ib_cm_find(), ib_cm_send_rtu(), ib_connection::ibdev, local_id, ib_connection::local_id, mad, ntohl, rc, ib_connection::remote_id, ib_cm_connect_reply::remote_id, and ib_mad_hdr::tid.
|
static |
Send reply to disconnection request.
ibdev | Infiniband device |
mi | Management interface |
tid | Transaction identifier |
av | Address vector |
local_id | Local communication ID |
remote_id | Remote communication ID |
rc | Return status code |
Definition at line 148 of file ib_cm.c.
References ib_mad_hdr::attr_id, ib_mad_hdr::class_version, ib_mad::cm, ib_mad_cm::cm_data, DBGC, ib_cm_data::disconnect_reply, ib_mad::hdr, htonl, htons, IB_CM_ATTR_DISCONNECT_REPLY, IB_CM_CLASS_VERSION, IB_MGMT_CLASS_CM, IB_MGMT_METHOD_SEND, ib_mi_send(), local_id, ib_cm_disconnect_reply::local_id, mad, memcpy(), memset(), ib_mad_hdr::method, ib_mad_hdr::mgmt_class, rc, remote_id, ib_cm_disconnect_reply::remote_id, strerror(), tid, and ib_mad_hdr::tid.
Referenced by ib_cm_recv_dreq().
|
static |
Handle disconnection requests.
ibdev | Infiniband device |
mi | Management interface |
mad | Received MAD |
av | Source address vector |
rc | Return status code |
Definition at line 184 of file ib_cm.c.
References ib_connection_operations::changed, ib_mad::cm, ib_mad_cm::cm_data, DBGC, ib_cm_data::disconnect_request, ENOTCONN, ib_mad::hdr, ib_cm_find(), ib_cm_send_drep(), ib_connection::ibdev, local_id, ib_cm_disconnect_request::local_id, mad, ntohl, ib_connection::op, ib_cm_disconnect_request::private_data, ib_connection::qp, rc, remote_id, ib_cm_disconnect_request::remote_id, and ib_mad_hdr::tid.
|
static |
Convert connection rejection reason to return status code.
reason | Rejection reason (in network byte order) |
rc | Return status code |
Definition at line 235 of file ib_cm.c.
References EALREADY, ENODEV, ENOTTY, EPERM, htons, IB_CM_REJECT_BAD_SERVICE_ID, IB_CM_REJECT_CONSUMER, IB_CM_REJECT_STALE_CONN, and reason.
Referenced by ib_cm_req_complete().
|
static |
Handle connection request transaction completion.
ibdev | Infiniband device |
mi | Management interface |
madx | Management transaction |
rc | Status code |
mad | Received MAD (or NULL on error) |
av | Source address vector (or NULL on error) |
Definition at line 258 of file ib_cm.c.
References ib_mad_hdr::attr_id, ib_connection_operations::changed, ib_mad::cm, ib_mad_cm::cm_data, ib_cm_data::common, common, ib_cm_data::connect_reject, ib_cm_data::connect_reply, DBGC, EIO, ENOTSUP, ib_device::gsi, ib_mad::hdr, htons, IB_CM_ATTR_CONNECT_REJECT, IB_CM_ATTR_CONNECT_REPLY, IB_CM_REJECT_CONSUMER, ib_cm_rejection_reason_to_rc(), ib_cm_send_rtu(), ib_destroy_madx(), ib_madx_get_ownerdata(), IB_MGMT_STATUS_OK, ib_modify_qp(), local_id, ib_connection::local_id, ib_cm_common::local_id, ib_cm_connect_reply::local_qpn, mad, ib_connection::madx, ntohl, ntohs, NULL, ib_connection::op, out, private_data, ib_cm_connect_reject::private_data, ib_cm_connect_reply::private_data, qp, ib_connection::qp, rc, ib_cm_connect_reject::reason, ib_connection::remote_id, ib_cm_connect_reply::starting_psn, ib_mad_hdr::status, strerror(), and ib_mad_hdr::tid.
|
static |
Handle connection path transaction completion.
ibdev | Infiniband device |
path | Path |
rc | Status code |
av | Address vector, or NULL on error |
Definition at line 354 of file ib_cm.c.
References ib_mad_hdr::attr_id, ib_queue_pair::av, ib_connection_operations::changed, ib_mad_hdr::class_version, ib_mad::cm, ib_mad_cm::cm_data, ib_cm_data::connect_request, DBGC, ib_cm_path::flow_label__rate, ib_address_vector::gid, ib_device::gid, ib_device::gsi, ib_mad::hdr, ib_cm_path::hop_limit, htonl, htons, IB_CM_ATTR_CONNECT_REQUEST, IB_CM_CLASS_VERSION, ib_cm_req_op, IB_CM_TRANSPORT_RC, ib_create_madx(), ib_destroy_path(), ib_madx_set_ownerdata(), IB_MGMT_CLASS_CM, IB_MGMT_METHOD_SEND, IB_MTU_2048, ib_path_get_ownerdata(), IB_QKEY_GSI, IB_QPN_GSI, ib_address_vector::lid, ib_device::lid, ib_cm_path::local_ack_timeout, ib_cm_connect_request::local_ca, ib_cm_connect_request::local_eecn__initiator_depth, ib_cm_path::local_gid, local_id, ib_connection::local_id, ib_cm_connect_request::local_id, ib_cm_path::local_lid, ib_cm_connect_request::local_qpn__responder_resources, mad, ib_connection::madx, ib_cm_connect_request::max_cm_retries__srq, memcpy(), memset(), ib_mad_hdr::method, ib_mad_hdr::mgmt_class, ib_device::node_guid, NULL, ib_connection::op, out, ib_connection::path, ib_cm_connect_request::payload_mtu__rdc_exists__rnr_retry, ib_cm_connect_request::pkey, ib_device::pkey, ib_cm_connect_request::primary, ib_connection::private_data, ib_cm_connect_request::private_data, ib_connection::private_data_len, ib_address_vector::qkey, qp, ib_connection::qp, ib_address_vector::qpn, ib_address_vector::rate, rc, ib_cm_connect_request::remote_eecn__remote_timeout__service_type__ee_flow_ctrl, ib_cm_path::remote_gid, ib_cm_path::remote_lid, ib_connection::service_id, ib_cm_connect_request::service_id, ib_address_vector::sl, ib_cm_path::sl__subnet_local, ib_cm_connect_request::starting_psn__local_timeout__retry_count, and strerror().
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.
ibdev | Infiniband device |
qp | Queue pair |
dgid | Target GID |
service_id | Target service ID |
private_data | Connection request private data |
private_data_len | Length of connection request private data |
op | Connection operations |
conn | Connection |
Definition at line 451 of file ib_cm.c.
References DBGC, dgid, free, ib_cm_path_op, ib_create_path(), ib_destroy_path(), IB_GID_ARGS, IB_GID_FMT, IB_GUID_ARGS, IB_GUID_FMT, ib_path_set_ownerdata(), ib_connection::ibdev, ib_connection::list, list_add, local_id, ib_connection::local_id, memcpy(), memset(), ib_device::name, NULL, ib_connection::op, op, ib_connection::path, private_data, ib_connection::private_data, ib_connection::private_data_len, qp, ib_connection::qp, random(), service_id, ib_connection::service_id, and zalloc().
Referenced by ib_cmrc_xfer_deliver().
void ib_destroy_conn | ( | struct ib_device * | ibdev, |
struct ib_queue_pair *qp | __unused, | ||
struct ib_connection * | conn | ||
) |
Destroy connection to remote QP.
ibdev | Infiniband device |
qp | Queue pair |
conn | Connection |
Definition at line 504 of file ib_cm.c.
References free, ib_device::gsi, ib_destroy_madx(), ib_destroy_path(), ib_connection::ibdev, ib_connection::list, list_del, ib_connection::madx, and ib_connection::path.
Referenced by ib_cmrc_shutdown().
struct ib_mad_agent ib_cm_agent [] __ib_mad_agent |
Communication management agents.
|
static |
Connection request operations.
Definition at line 342 of file ib_cm.c.
Referenced by ib_cm_path_complete().
|
static |
Connection path operations.
Definition at line 434 of file ib_cm.c.
Referenced by ib_create_conn().