48 #define IB_MI_NUM_SEND_WQES 4 54 #define IB_MI_NUM_RECV_WQES 2 60 #define IB_MI_NUM_CQES 8 63 #define IB_MI_TID_MAGIC ( ( 'i' << 24 ) | ( 'P' << 16 ) | ( 'X' << 8 ) | 'E' ) 88 sizeof (
hdr->tid ) ) != 0 )
108 DBGC ( mi,
"MI %p RX TID %08x%08x ignored\n",
141 DBGC ( mi,
"MI %p RX bad size (%zd bytes)\n",
149 DBGC ( mi,
"MI %p RX unsupported base version %x\n",
150 mi,
hdr->base_version );
154 DBGC ( mi,
"MI %p RX TID %08x%08x (%02x,%02x,%02x,%04x) status " 156 hdr->mgmt_class,
hdr->class_version,
hdr->method,
195 if ( (
hdr->tid.high == 0 ) && (
hdr->tid.low == 0 ) ) {
199 DBGC ( mi,
"MI %p TX TID %08x%08x (%02x,%02x,%02x,%04x) status " 201 hdr->mgmt_class,
hdr->class_version,
hdr->method,
216 sizeof (
smp->return_path.hops[0] ) ) ) {
219 DBGC ( mi,
"MI %p TX TID %08x%08x invalid hop pointer " 220 "%d\n", mi,
ntohl (
hdr->tid.high ),
229 DBGC ( mi,
"MI %p could not allocate buffer for TID " 238 DBGC ( mi,
"MI %p TX TID %08x%08x failed: %s\n",
263 DBGC ( mi,
"MI %p abandoning TID %08x%08x\n",
293 madx =
zalloc (
sizeof ( *madx ) );
354 mi =
zalloc (
sizeof ( *mi ) );
365 DBGC ( mi,
"MI %p could not create completion queue: %s\n",
375 DBGC ( mi,
"MI %p could not create queue pair: %s\n",
380 DBGC ( mi,
"MI %p (%s) running on QPN %#lx\n",
386 DBGC ( mi,
"MI %p could not set queue key: %s\n",
417 DBGC (
mi,
"MI %p destroyed while TID %08x%08x in progress\n",
struct ib_device * ibdev
Infiniband device.
#define EINVAL
Invalid argument.
struct arbelprm_rc_send_wqe rc
Infiniband management interfaces.
#define IB_MI_NUM_RECV_WQES
Management interface number of receive WQEs.
void ib_destroy_mi(struct ib_device *ibdev, struct ib_mad_interface *mi)
Destroy management interface.
struct ib_address_vector av
Destination address vector.
void(* complete_recv)(struct ib_device *ibdev, struct ib_queue_pair *qp, struct ib_address_vector *dest, struct ib_address_vector *source, struct io_buffer *iobuf, int rc)
Complete Receive WQE.
#define iob_put(iobuf, len)
struct ib_smp_class_specific smp
static void(* expired)(struct pooled_connection *pool)
static void start_timer_nodelay(struct retry_timer *timer)
Start timer with no delay.
#define IB_MAD_AGENTS
Infiniband management agents.
#define list_add(new, head)
Add a new entry to the head of a list.
struct golan_inbox_hdr hdr
Message header.
void free_iob(struct io_buffer *iobuf)
Free I/O buffer.
uint32_t type
Operating system type.
#define IB_QKEY_SMI
Subnet management interface queue key.
void(* handle)(struct ib_device *ibdev, struct ib_mad_interface *mi, union ib_mad *mad, struct ib_address_vector *av)
Handle MAD.
int ib_modify_qp(struct ib_device *ibdev, struct ib_queue_pair *qp)
Modify queue pair.
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.
void ib_refill_recv(struct ib_device *ibdev, struct ib_queue_pair *qp)
Refill receive work queue.
struct list_head list
List of transactions.
struct io_buffer *(* alloc_iob)(size_t len)
Allocate receive I/O buffer.
uint16_t attr_id
Attribute (in network byte order)
An Infiniband management interface.
struct io_buffer * alloc_iob(size_t len)
Allocate I/O buffer.
#define IB_QKEY_GSI
General service interface queue key.
unsigned long qkey
Queue key.
#define ECANCELED
Operation canceled.
#define ENOTSUP
Operation not supported.
void ib_destroy_cq(struct ib_device *ibdev, struct ib_completion_queue *cq)
Destroy completion queue.
struct ib_queue_pair * qp
Queue pair.
#define IB_SMP_STATUS_D_INBOUND
Subnet management direction bit.
#define list_del(list)
Delete an entry from a list.
#define ENOMEM
Not enough space.
Infiniband completion queue operations.
void * memcpy(void *dest, const void *src, size_t len) __nonnull
Infiniband queue pair operations.
static struct ib_completion_queue_operations ib_mi_completion_ops
Management interface completion operations.
struct ib_completion_queue * cq
Completion queue.
unsigned long qkey
Queue key.
assert((readw(&hdr->flags) &(GTF_reading|GTF_writing))==0)
#define container_of(ptr, type, field)
Get containing structure.
An Infiniband management transaction.
#define list_for_each_entry(pos, head, member)
Iterate over entries in a list.
#define __unused
Declare a variable or data structure as unused.
#define IB_MI_NUM_SEND_WQES
Management interface number of send WQEs.
const char * name
Queue pair name.
unsigned long qpn
Queue pair number.
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.
uint16_t sm_lid
Subnet manager LID.
An Infiniband management agent.
uint8_t class_version
Class version.
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.
#define list_for_each_entry_safe(pos, tmp, head, member)
Iterate over entries in a list, safe against deletion of the current entry.
uint8_t sm_sl
Subnet manager SL.
#define IB_QPN_GSI
General service interface QPN.
unsigned int port
Port number.
char * strerror(int errno)
Retrieve string representation of error number.
static void(* free)(struct refcnt *refcnt))
ib_queue_pair_type
An Infiniband queue pair type.
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 size_t iob_len(struct io_buffer *iobuf)
Calculate length of data in an I/O buffer.
A management datagram common header.
#define for_each_table_entry(pointer, table)
Iterate through all entries within a linker table.
void ib_destroy_qp(struct ib_device *ibdev, struct ib_queue_pair *qp)
Destroy queue pair.
struct ib_mad_transaction_operations * op
Transaction operations.
unsigned long qpn
Queue Pair Number.
An Infiniband Queue Pair.
void start_timer(struct retry_timer *timer)
Start timer.
static struct ib_queue_pair_operations ib_mi_queue_pair_ops
Management interface queue pair operations.
unsigned int sl
Service level.
#define IB_MI_NUM_CQES
Management interface number of completion queue entries.
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 uint16_t struct vmbus_xfer_pages_operations * op
#define INIT_LIST_HEAD(list)
Initialise a list head.
void stop_timer(struct retry_timer *timer)
Stop timer.
#define IB_MGMT_CLASS_SUBN_DIRECTED_ROUTE
struct ib_mad_interface * mi
Associated management interface.
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.
uint8_t mgmt_class
Management class.
void * data
Start of data.
#define IB_MGMT_CLASS_MASK
#define IB_MI_TID_MAGIC
TID magic signature.
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
#define IB_MGMT_BASE_VERSION
static void ib_mi_timer_expired(struct retry_timer *timer, int expired)
Handle management transaction timer expiry.
An Infiniband Address Vector.
union ib_mad mad
MAD being sent.
unsigned int lid
Local ID.
static unsigned int next_tid
TID to use for next MAD.
void(* 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 transaction completion.
Infiniband management transaction operations.
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.
struct list_head madx
List of management transactions.
int memcmp(const void *first, const void *second, size_t len)
Compare memory regions.
#define NULL
NULL pointer (VOID *)
#define ETIMEDOUT
Connection timed out.
static __always_inline void ib_qp_set_ownerdata(struct ib_queue_pair *qp, void *priv)
Set Infiniband queue pair owner-private data.
FILE_LICENCE(GPL2_OR_LATER_OR_UBDL)
int ib_mi_send(struct ib_device *ibdev, struct ib_mad_interface *mi, union ib_mad *mad, struct ib_address_vector *av)
Transmit MAD.
int ib_create_mi(struct ib_device *ibdev, enum ib_queue_pair_type type, struct ib_mad_interface **new_mi)
Create management interface.
struct retry_timer timer
Retry timer.
void ib_destroy_madx(struct ib_device *ibdev __unused, struct ib_mad_interface *mi __unused, struct ib_mad_transaction *madx)
Destroy management transaction.