Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Macros | Functions
qib_qp.c File Reference
#include <linux/err.h>
#include <linux/vmalloc.h>
#include <linux/jhash.h>
#include "qib.h"

Go to the source code of this file.

Macros

#define BITS_PER_PAGE   (PAGE_SIZE*BITS_PER_BYTE)
 
#define BITS_PER_PAGE_MASK   (BITS_PER_PAGE-1)
 

Functions

unsigned qib_free_all_qps (struct qib_devdata *dd)
 
struct qib_qpqib_lookup_qpn (struct qib_ibport *ibp, u32 qpn)
 
int qib_error_qp (struct qib_qp *qp, enum ib_wc_status err)
 
int qib_modify_qp (struct ib_qp *ibqp, struct ib_qp_attr *attr, int attr_mask, struct ib_udata *udata)
 
int qib_query_qp (struct ib_qp *ibqp, struct ib_qp_attr *attr, int attr_mask, struct ib_qp_init_attr *init_attr)
 
__be32 qib_compute_aeth (struct qib_qp *qp)
 
struct ib_qpqib_create_qp (struct ib_pd *ibpd, struct ib_qp_init_attr *init_attr, struct ib_udata *udata)
 
int qib_destroy_qp (struct ib_qp *ibqp)
 
void qib_init_qpn_table (struct qib_devdata *dd, struct qib_qpn_table *qpt)
 
void qib_free_qpn_table (struct qib_qpn_table *qpt)
 
void qib_get_credit (struct qib_qp *qp, u32 aeth)
 

Macro Definition Documentation

#define BITS_PER_PAGE   (PAGE_SIZE*BITS_PER_BYTE)

Definition at line 41 of file qib_qp.c.

#define BITS_PER_PAGE_MASK   (BITS_PER_PAGE-1)

Definition at line 42 of file qib_qp.c.

Function Documentation

__be32 qib_compute_aeth ( struct qib_qp qp)

qib_compute_aeth - compute the AETH (syndrome + MSN) : the queue pair to compute the AETH for

Returns the AETH.

Definition at line 910 of file qib_qp.c.

struct ib_qp* qib_create_qp ( struct ib_pd ibpd,
struct ib_qp_init_attr init_attr,
struct ib_udata udata 
)
read

qib_create_qp - create a queue pair for a device : the protection domain who's device we create the queue pair for : the attributes of the queue pair : user data for libibverbs.so

Returns the queue pair on success, otherwise returns an errno.

Called by the ib_create_qp() core verbs function.

Definition at line 974 of file qib_qp.c.

int qib_destroy_qp ( struct ib_qp ibqp)

qib_destroy_qp - destroy a queue pair : the queue pair to destroy

Returns 0 on success.

Note that this can be called while the QP is actively sending or receiving!

Definition at line 1188 of file qib_qp.c.

int qib_error_qp ( struct qib_qp qp,
enum ib_wc_status  err 
)

qib_error_qp - put a QP into the error state : the QP to put into the error state : the receive completion error to signal if a RWQE is active

Flushes both send and receive work queues. Returns true if last WQE event should be generated. The QP r_lock and s_lock should be held and interrupts disabled. If we are already in error state, just return.

Definition at line 473 of file qib_qp.c.

unsigned qib_free_all_qps ( struct qib_devdata dd)

qib_free_all_qps - check for QPs still in use : the QP table to empty

There should not be any QPs still in use. Free memory for table.

Definition at line 293 of file qib_qp.c.

void qib_free_qpn_table ( struct qib_qpn_table qpt)

qib_free_qpn_table - free the QP number table for a device : the QPN table

Definition at line 1248 of file qib_qp.c.

void qib_get_credit ( struct qib_qp qp,
u32  aeth 
)

qib_get_credit - flush the send work queue of a QP : the qp who's send work queue to flush : the Acknowledge Extended Transport Header

The QP s_lock should be held.

Definition at line 1264 of file qib_qp.c.

void qib_init_qpn_table ( struct qib_devdata dd,
struct qib_qpn_table qpt 
)

qib_init_qpn_table - initialize the QP number table for a device : the QPN table

Definition at line 1236 of file qib_qp.c.

struct qib_qp* qib_lookup_qpn ( struct qib_ibport ibp,
u32  qpn 
)
read

qib_lookup_qpn - return the QP with the given QPN : the QP table : the QP number to look up

The caller is responsible for decrementing the QP reference count when done.

Definition at line 337 of file qib_qp.c.

int qib_modify_qp ( struct ib_qp ibqp,
struct ib_qp_attr attr,
int  attr_mask,
struct ib_udata udata 
)

qib_modify_qp - modify the attributes of a queue pair : the queue pair who's attributes we're modifying : the new attributes : the mask of attributes to modify : user data for libibverbs.so

Returns 0 on success, otherwise returns an errno.

Definition at line 568 of file qib_qp.c.

int qib_query_qp ( struct ib_qp ibqp,
struct ib_qp_attr attr,
int  attr_mask,
struct ib_qp_init_attr init_attr 
)

Definition at line 854 of file qib_qp.c.