iPXE
|
Infiniband management interfaces. More...
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h>
#include <stdio.h>
#include <unistd.h>
#include <byteswap.h>
#include <ipxe/infiniband.h>
#include <ipxe/iobuf.h>
#include <ipxe/ib_mi.h>
Go to the source code of this file.
Macros | |
#define | IB_MI_NUM_SEND_WQES 4 |
Management interface number of send WQEs. More... | |
#define | IB_MI_NUM_RECV_WQES 2 |
Management interface number of receive WQEs. More... | |
#define | IB_MI_NUM_CQES 8 |
Management interface number of completion queue entries. More... | |
#define | IB_MI_TID_MAGIC ( ( 'i' << 24 ) | ( 'P' << 16 ) | ( 'X' << 8 ) | 'E' ) |
TID magic signature. More... | |
Functions | |
FILE_LICENCE (GPL2_OR_LATER_OR_UBDL) | |
static int | ib_mi_handle (struct ib_device *ibdev, struct ib_mad_interface *mi, union ib_mad *mad, struct ib_address_vector *av) |
Handle received MAD. More... | |
static void | ib_mi_complete_recv (struct ib_device *ibdev, struct ib_queue_pair *qp, struct ib_address_vector *dest __unused, struct ib_address_vector *source, struct io_buffer *iobuf, int rc) |
Complete receive via management interface. More... | |
int | ib_mi_send (struct ib_device *ibdev, struct ib_mad_interface *mi, union ib_mad *mad, struct ib_address_vector *av) |
Transmit MAD. More... | |
static void | ib_mi_timer_expired (struct retry_timer *timer, int expired) |
Handle management transaction timer expiry. More... | |
struct ib_mad_transaction * | ib_create_madx (struct ib_device *ibdev, struct ib_mad_interface *mi, union ib_mad *mad, struct ib_address_vector *av, struct ib_mad_transaction_operations *op) |
Create management transaction. More... | |
void | ib_destroy_madx (struct ib_device *ibdev __unused, struct ib_mad_interface *mi __unused, struct ib_mad_transaction *madx) |
Destroy management transaction. More... | |
int | ib_create_mi (struct ib_device *ibdev, enum ib_queue_pair_type type, struct ib_mad_interface **new_mi) |
Create management interface. More... | |
void | ib_destroy_mi (struct ib_device *ibdev, struct ib_mad_interface *mi) |
Destroy management interface. More... | |
Variables | |
static unsigned int | next_tid |
TID to use for next MAD. More... | |
static struct ib_completion_queue_operations | ib_mi_completion_ops |
Management interface completion operations. More... | |
static struct ib_queue_pair_operations | ib_mi_queue_pair_ops |
Management interface queue pair operations. More... | |
Infiniband management interfaces.
Definition in file ib_mi.c.
#define IB_MI_NUM_SEND_WQES 4 |
#define IB_MI_NUM_RECV_WQES 2 |
#define IB_MI_NUM_CQES 8 |
#define IB_MI_TID_MAGIC ( ( 'i' << 24 ) | ( 'P' << 16 ) | ( 'X' << 8 ) | 'E' ) |
FILE_LICENCE | ( | GPL2_OR_LATER_OR_UBDL | ) |
|
static |
Handle received MAD.
ibdev | Infiniband device |
mi | Management interface |
mad | Received MAD |
av | Source address vector |
rc | Return status code |
Definition at line 77 of file ib_mi.c.
References ib_mad_agent::attr_id, ib_mad_agent::class_version, ib_mad_transaction_operations::complete, DBGC, ENOTSUP, for_each_table_entry, ib_mad_agent::handle, ib_mad::hdr, hdr, IB_MAD_AGENTS, IB_MGMT_CLASS_MASK, list_for_each_entry, mad, ib_mad_transaction::mad, ib_mad_interface::madx, memcmp(), ib_mad_agent::mgmt_class, ntohl, ib_mad_transaction::op, and ib_mad_hdr::tid.
Referenced by ib_mi_complete_recv().
|
static |
Complete receive via management interface.
ibdev | Infiniband device |
qp | Queue pair |
dest | Destination address vector |
source | Source address vector |
iobuf | I/O buffer |
rc | Completion status code |
Definition at line 124 of file ib_mi.c.
References io_buffer::data, DBGC, DBGC2_HDA, DBGC_HDA, free_iob(), ib_mad::hdr, hdr, IB_MGMT_BASE_VERSION, ib_mi_handle(), ib_qp_get_ownerdata(), iob_len(), mad, ntohl, ntohs, out, qp, rc, and strerror().
int ib_mi_send | ( | struct ib_device * | ibdev, |
struct ib_mad_interface * | mi, | ||
union ib_mad * | mad, | ||
struct ib_address_vector * | av | ||
) |
Transmit MAD.
ibdev | Infiniband device |
mi | Management interface |
mad | MAD |
av | Destination address vector |
rc | Return status code |
Definition at line 187 of file ib_mi.c.
References alloc_iob(), assert(), DBGC, DBGC2_HDA, EINVAL, ENOMEM, free_iob(), ib_mad::hdr, hdr, hop_count, ib_smp_class_specific::hop_count, hop_pointer, ib_smp_class_specific::hop_pointer, htonl, htons, IB_MGMT_BASE_VERSION, IB_MGMT_CLASS_SUBN_DIRECTED_ROUTE, IB_MI_TID_MAGIC, ib_post_send(), IB_SMP_STATUS_D_INBOUND, iob_put, mad, memcpy(), next_tid, ntohl, ntohs, ib_device::port, ib_mad_interface::qp, rc, smp, ib_mad::smp, and strerror().
Referenced by ib_cm_send_drep(), ib_cm_send_rtu(), ib_mcast_leave(), ib_mi_timer_expired(), ib_sma_guid_info(), ib_sma_node_desc(), ib_sma_node_info(), ib_sma_pkey_table(), and ib_sma_port_info().
|
static |
Handle management transaction timer expiry.
timer | Retry timer |
expired | Failure indicator |
Definition at line 254 of file ib_mi.c.
References ib_mad_transaction::av, ib_mad_transaction_operations::complete, container_of, DBGC, ETIMEDOUT, expired, ib_mad::hdr, hdr, ib_mi_send(), ib_mad_interface::ibdev, ib_mad_transaction::mad, ib_mad_interface::madx, ntohl, NULL, ib_mad_transaction::op, and start_timer().
Referenced by ib_create_madx().
struct ib_mad_transaction* ib_create_madx | ( | struct ib_device * | ibdev, |
struct ib_mad_interface * | mi, | ||
union ib_mad * | mad, | ||
struct ib_address_vector * | av, | ||
struct ib_mad_transaction_operations * | op | ||
) |
Create management transaction.
ibdev | Infiniband device |
mi | Management interface |
mad | MAD to send |
av | Destination address, or NULL to use SM's GSI |
op | Management transaction operations |
madx | Management transaction, or NULL |
Definition at line 287 of file ib_mi.c.
References ib_mad_transaction::av, ib_mi_timer_expired(), IB_QKEY_GSI, IB_QPN_GSI, ib_address_vector::lid, ib_mad_transaction::list, list_add, mad, ib_mad_transaction::mad, ib_mad_interface::madx, memcpy(), ib_mad_transaction::mi, NULL, ib_mad_transaction::op, op, ib_address_vector::qkey, ib_address_vector::qpn, ib_address_vector::sl, ib_device::sm_lid, ib_device::sm_sl, start_timer_nodelay(), ib_mad_transaction::timer, and zalloc().
Referenced by ib_cm_path_complete(), ib_create_path(), ib_create_service_madx(), ib_mcast_join(), and xsigo_xds_complete().
void ib_destroy_madx | ( | struct ib_device *ibdev | __unused, |
struct ib_mad_interface *mi | __unused, | ||
struct ib_mad_transaction * | madx | ||
) |
Destroy management transaction.
ibdev | Infiniband device |
mi | Management interface |
madx | Management transaction |
Definition at line 327 of file ib_mi.c.
References free, ib_mad_transaction::list, list_del, stop_timer(), and ib_mad_transaction::timer.
Referenced by ib_cm_req_complete(), ib_create_path(), ib_destroy_conn(), ib_destroy_path(), ib_mcast_complete(), ib_mcast_join(), ib_mcast_leave(), ib_path_complete(), xsigo_discover(), xsigo_ib_notify(), xsigo_ib_remove(), xsigo_xcm_complete(), and xsigo_xds_complete().
int ib_create_mi | ( | struct ib_device * | ibdev, |
enum ib_queue_pair_type | type, | ||
struct ib_mad_interface ** | new_mi | ||
) |
Create management interface.
ibdev | Infiniband device |
type | Queue pair type |
new_mi | New management interface to fill in |
rc | Return status code |
Definition at line 347 of file ib_mi.c.
References ib_mad_interface::cq, DBGC, ENOMEM, free, ib_create_cq(), ib_create_qp(), ib_destroy_cq(), ib_destroy_qp(), ib_mi_completion_ops, IB_MI_NUM_CQES, IB_MI_NUM_RECV_WQES, IB_MI_NUM_SEND_WQES, ib_mi_queue_pair_ops, ib_modify_qp(), IB_QKEY_GSI, IB_QKEY_SMI, ib_qp_set_ownerdata(), IB_QPT_SMI, ib_refill_recv(), ib_mad_interface::ibdev, INIT_LIST_HEAD, ib_mad_interface::madx, ib_queue_pair::name, name, ib_queue_pair::qkey, ib_mad_interface::qp, ib_queue_pair::qpn, rc, strerror(), type, and zalloc().
Referenced by ib_open().
void ib_destroy_mi | ( | struct ib_device * | ibdev, |
struct ib_mad_interface * | mi | ||
) |
Destroy management interface.
mi | Management interface |
Definition at line 411 of file ib_mi.c.
References ib_mad_transaction_operations::complete, ib_mad_interface::cq, DBGC, ECANCELED, free, ib_mad::hdr, ib_mad_tid::high, ib_destroy_cq(), ib_destroy_qp(), ib_mad_transaction::list, list_for_each_entry_safe, ib_mad_tid::low, ib_mad_transaction::mad, ib_mad_interface::madx, ib_mad_transaction::mi, ntohl, NULL, ib_mad_transaction::op, ib_mad_interface::qp, ib_mad_hdr::tid, and tmp.
Referenced by ib_close(), and ib_open().
|
static |
|
static |
Management interface completion operations.
Definition at line 169 of file ib_mi.c.
Referenced by ib_create_mi().
|
static |
Management interface queue pair operations.
Definition at line 174 of file ib_mi.c.
Referenced by ib_create_mi().