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",
#define NULL
NULL pointer (VOID *)
struct golan_inbox_hdr hdr
Message header.
struct arbelprm_rc_send_wqe rc
struct arbelprm_qp_db_record qp
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" retur dest)
#define assert(condition)
Assert a condition at run-time.
uint32_t type
Operating system type.
#define __unused
Declare a variable or data structure as unused.
#define FILE_LICENCE(_licence)
Declare a particular licence as applying to a file.
#define EINVAL
Invalid argument.
#define ETIMEDOUT
Connection timed out.
#define ENOMEM
Not enough space.
#define ENOTSUP
Operation not supported.
#define ECANCELED
Operation canceled.
struct ib_smp_class_specific smp
#define IB_MGMT_BASE_VERSION
#define IB_SMP_STATUS_D_INBOUND
Subnet management direction bit.
#define IB_MGMT_CLASS_MASK
#define IB_MGMT_CLASS_SUBN_DIRECTED_ROUTE
#define IB_MI_NUM_SEND_WQES
Management interface number of send WQEs.
static struct ib_completion_queue_operations ib_mi_completion_ops
Management interface completion operations.
static unsigned int next_tid
TID to use for next MAD.
#define IB_MI_NUM_RECV_WQES
Management interface number of receive WQEs.
int ib_mi_send(struct ib_device *ibdev, struct ib_mad_interface *mi, union ib_mad *mad, struct ib_address_vector *av)
Transmit MAD.
#define IB_MI_NUM_CQES
Management interface number of completion queue entries.
int ib_create_mi(struct ib_device *ibdev, enum ib_queue_pair_type type, struct ib_mad_interface **new_mi)
Create management interface.
static struct ib_queue_pair_operations ib_mi_queue_pair_ops
Management interface queue pair operations.
void ib_destroy_mi(struct ib_device *ibdev, struct ib_mad_interface *mi)
Destroy management interface.
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.
#define IB_MI_TID_MAGIC
TID magic signature.
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.
void ib_destroy_madx(struct ib_device *ibdev __unused, struct ib_mad_interface *mi __unused, struct ib_mad_transaction *madx)
Destroy management transaction.
static void ib_mi_timer_expired(struct retry_timer *timer, int expired)
Handle management transaction timer expiry.
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.
Infiniband management interfaces.
#define IB_MAD_AGENTS
Infiniband management agents.
void * memcpy(void *dest, const void *src, size_t len) __nonnull
void ib_refill_recv(struct ib_device *ibdev, struct ib_queue_pair *qp)
Refill receive work queue.
void ib_destroy_cq(struct ib_device *ibdev, struct ib_completion_queue *cq)
Destroy completion queue.
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.
int ib_modify_qp(struct ib_device *ibdev, struct ib_queue_pair *qp)
Modify queue pair.
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.
void ib_destroy_qp(struct ib_device *ibdev, struct ib_queue_pair *qp)
Destroy queue pair.
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.
static __always_inline void * ib_qp_get_ownerdata(struct ib_queue_pair *qp)
Get Infiniband queue pair owner-private data.
static __always_inline void ib_qp_set_ownerdata(struct ib_queue_pair *qp, void *priv)
Set Infiniband queue pair owner-private data.
ib_queue_pair_type
An Infiniband queue pair type.
#define IB_QPN_GSI
General service interface QPN.
#define IB_QKEY_GSI
General service interface queue key.
#define IB_QKEY_SMI
Subnet management interface queue key.
void free_iob(struct io_buffer *iobuf)
Free I/O buffer.
struct io_buffer * alloc_iob(size_t len)
Allocate I/O buffer.
#define iob_put(iobuf, len)
static size_t iob_len(struct io_buffer *iobuf)
Calculate length of data in an I/O buffer.
#define list_for_each_entry_safe(pos, tmp, head, member)
Iterate over entries in a list, safe against deletion of the current entry.
#define list_for_each_entry(pos, head, member)
Iterate over entries in a list.
#define list_del(list)
Delete an entry from a list.
#define INIT_LIST_HEAD(list)
Initialise a list head.
#define list_add(new, head)
Add a new entry to the head of a list.
void * zalloc(size_t size)
Allocate cleared memory.
static uint16_t struct vmbus_xfer_pages_operations * op
static void(* expired)(struct pooled_connection *pool)
static void(* free)(struct refcnt *refcnt))
void start_timer(struct retry_timer *timer)
Start timer.
void stop_timer(struct retry_timer *timer)
Stop timer.
static void start_timer_nodelay(struct retry_timer *timer)
Start timer with no delay.
#define container_of(ptr, type, field)
Get containing structure.
char * strerror(int errno)
Retrieve string representation of error number.
int memcmp(const void *first, const void *second, size_t len)
Compare memory regions.
An Infiniband Address Vector.
unsigned int sl
Service level.
unsigned long qkey
Queue key.
unsigned int lid
Local ID.
unsigned long qpn
Queue Pair Number.
Infiniband completion queue operations.
uint8_t sm_sl
Subnet manager SL.
uint16_t sm_lid
Subnet manager LID.
unsigned int port
Port number.
An Infiniband management agent.
uint16_t attr_id
Attribute (in network byte order)
void(* handle)(struct ib_device *ibdev, struct ib_mad_interface *mi, union ib_mad *mad, struct ib_address_vector *av)
Handle MAD.
uint8_t mgmt_class
Management class.
uint8_t class_version
Class version.
A management datagram common header.
An Infiniband management interface.
struct list_head madx
List of management transactions.
struct ib_queue_pair * qp
Queue pair.
struct ib_device * ibdev
Infiniband device.
struct ib_completion_queue * cq
Completion queue.
Infiniband management transaction operations.
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.
An Infiniband management transaction.
struct ib_mad_interface * mi
Associated management interface.
struct ib_mad_transaction_operations * op
Transaction operations.
union ib_mad mad
MAD being sent.
struct list_head list
List of transactions.
struct ib_address_vector av
Destination address vector.
struct retry_timer timer
Retry timer.
Infiniband queue pair operations.
An Infiniband Queue Pair.
unsigned long qpn
Queue pair number.
const char * name
Queue pair name.
unsigned long qkey
Queue key.
void * data
Start of data.
#define for_each_table_entry(pointer, table)
Iterate through all entries within a linker table.