Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions | Variables
ipath_verbs.h File Reference
#include <linux/types.h>
#include <linux/spinlock.h>
#include <linux/kernel.h>
#include <linux/interrupt.h>
#include <linux/kref.h>
#include <rdma/ib_pack.h>
#include <rdma/ib_user_verbs.h>
#include "ipath_kernel.h"

Go to the source code of this file.

Data Structures

struct  ib_reth
 
struct  ib_atomic_eth
 
struct  ipath_other_headers
 
struct  ipath_ib_header
 
struct  ipath_pio_header
 
struct  ipath_mcast_qp
 
struct  ipath_mcast
 
struct  ipath_pd
 
struct  ipath_ah
 
struct  ipath_mmap_info
 
struct  ipath_cq_wc
 
struct  ipath_cq
 
struct  ipath_seg
 
struct  ipath_segarray
 
struct  ipath_mregion
 
struct  ipath_sge
 
struct  ipath_mr
 
struct  ipath_swqe
 
struct  ipath_rwqe
 
struct  ipath_rwq
 
struct  ipath_rq
 
struct  ipath_srq
 
struct  ipath_sge_state
 
struct  ipath_ack_entry
 
struct  ipath_qp
 
struct  qpn_map
 
struct  ipath_qp_table
 
struct  ipath_lkey_table
 
struct  ipath_opcode_stats
 
struct  ipath_ibdev
 
struct  ipath_verbs_counters
 
struct  ipath_verbs_txreq
 

Macros

#define IPATH_MAX_RDMA_ATOMIC   4
 
#define QPN_MAX   (1 << 24)
 
#define QPNMAP_ENTRIES   (QPN_MAX / PAGE_SIZE / BITS_PER_BYTE)
 
#define IPATH_UVERBS_ABI_VERSION   2
 
#define IB_CQ_NONE   (IB_CQ_NEXT_COMP + 1)
 
#define IB_RNR_NAK   0x20
 
#define IB_NAK_PSN_ERROR   0x60
 
#define IB_NAK_INVALID_REQUEST   0x61
 
#define IB_NAK_REMOTE_ACCESS_ERROR   0x62
 
#define IB_NAK_REMOTE_OPERATIONAL_ERROR   0x63
 
#define IB_NAK_INVALID_RD_REQUEST   0x64
 
#define IPATH_POST_SEND_OK   0x01
 
#define IPATH_POST_RECV_OK   0x02
 
#define IPATH_PROCESS_RECV_OK   0x04
 
#define IPATH_PROCESS_SEND_OK   0x08
 
#define IPATH_PROCESS_NEXT_SEND_OK   0x10
 
#define IPATH_FLUSH_SEND   0x20
 
#define IPATH_FLUSH_RECV   0x40
 
#define IPATH_PROCESS_OR_FLUSH_SEND   (IPATH_PROCESS_SEND_OK | IPATH_FLUSH_SEND)
 
#define IB_PMA_SAMPLE_STATUS_DONE   0x00
 
#define IB_PMA_SAMPLE_STATUS_STARTED   0x01
 
#define IB_PMA_SAMPLE_STATUS_RUNNING   0x02
 
#define IB_PMA_PORT_XMIT_DATA   cpu_to_be16(0x0001)
 
#define IB_PMA_PORT_RCV_DATA   cpu_to_be16(0x0002)
 
#define IB_PMA_PORT_XMIT_PKTS   cpu_to_be16(0x0003)
 
#define IB_PMA_PORT_RCV_PKTS   cpu_to_be16(0x0004)
 
#define IB_PMA_PORT_XMIT_WAIT   cpu_to_be16(0x0005)
 
#define IPATH_SEGSZ   (PAGE_SIZE / sizeof (struct ipath_seg))
 
#define IPATH_R_WRID_VALID   0
 
#define IPATH_R_REUSE_SGE   0x01
 
#define IPATH_R_RDMAR_SEQ   0x02
 
#define IPATH_S_SIGNAL_REQ_WR   0x01
 
#define IPATH_S_FENCE_PENDING   0x02
 
#define IPATH_S_RDMAR_PENDING   0x04
 
#define IPATH_S_ACK_PENDING   0x08
 
#define IPATH_S_BUSY   0x10
 
#define IPATH_S_WAITING   0x20
 
#define IPATH_S_WAIT_SSN_CREDIT   0x40
 
#define IPATH_S_WAIT_DMA   0x80
 
#define IPATH_S_ANY_WAIT
 
#define IPATH_PSN_CREDIT   512
 
#define IB_PHYSPORTSTATE_SLEEP   1
 
#define IB_PHYSPORTSTATE_POLL   2
 
#define IB_PHYSPORTSTATE_DISABLED   3
 
#define IB_PHYSPORTSTATE_CFG_TRAIN   4
 
#define IB_PHYSPORTSTATE_LINKUP   5
 
#define IB_PHYSPORTSTATE_LINK_ERR_RECOVER   6
 

Functions

struct ib_reth __attribute__ ((packed))
 
int ipath_process_mad (struct ib_device *ibdev, int mad_flags, u8 port_num, struct ib_wc *in_wc, struct ib_grh *in_grh, struct ib_mad *in_mad, struct ib_mad *out_mad)
 
struct ipath_mcastipath_mcast_find (union ib_gid *mgid)
 
int ipath_snapshot_counters (struct ipath_devdata *dd, u64 *swords, u64 *rwords, u64 *spkts, u64 *rpkts, u64 *xmit_wait)
 
int ipath_get_counters (struct ipath_devdata *dd, struct ipath_verbs_counters *cntrs)
 
int ipath_multicast_attach (struct ib_qp *ibqp, union ib_gid *gid, u16 lid)
 
int ipath_multicast_detach (struct ib_qp *ibqp, union ib_gid *gid, u16 lid)
 
int ipath_mcast_tree_empty (void)
 
__be32 ipath_compute_aeth (struct ipath_qp *qp)
 
struct ipath_qpipath_lookup_qpn (struct ipath_qp_table *qpt, u32 qpn)
 
struct ib_qpipath_create_qp (struct ib_pd *ibpd, struct ib_qp_init_attr *init_attr, struct ib_udata *udata)
 
int ipath_destroy_qp (struct ib_qp *ibqp)
 
int ipath_error_qp (struct ipath_qp *qp, enum ib_wc_status err)
 
int ipath_modify_qp (struct ib_qp *ibqp, struct ib_qp_attr *attr, int attr_mask, struct ib_udata *udata)
 
int ipath_query_qp (struct ib_qp *ibqp, struct ib_qp_attr *attr, int attr_mask, struct ib_qp_init_attr *init_attr)
 
unsigned ipath_free_all_qps (struct ipath_qp_table *qpt)
 
int ipath_init_qp_table (struct ipath_ibdev *idev, int size)
 
void ipath_get_credit (struct ipath_qp *qp, u32 aeth)
 
unsigned ipath_ib_rate_to_mult (enum ib_rate rate)
 
int ipath_verbs_send (struct ipath_qp *qp, struct ipath_ib_header *hdr, u32 hdrwords, struct ipath_sge_state *ss, u32 len)
 
void ipath_copy_sge (struct ipath_sge_state *ss, void *data, u32 length)
 
void ipath_skip_sge (struct ipath_sge_state *ss, u32 length)
 
void ipath_uc_rcv (struct ipath_ibdev *dev, struct ipath_ib_header *hdr, int has_grh, void *data, u32 tlen, struct ipath_qp *qp)
 
void ipath_rc_rcv (struct ipath_ibdev *dev, struct ipath_ib_header *hdr, int has_grh, void *data, u32 tlen, struct ipath_qp *qp)
 
void ipath_restart_rc (struct ipath_qp *qp, u32 psn)
 
void ipath_rc_error (struct ipath_qp *qp, enum ib_wc_status err)
 
int ipath_post_ud_send (struct ipath_qp *qp, struct ib_send_wr *wr)
 
void ipath_ud_rcv (struct ipath_ibdev *dev, struct ipath_ib_header *hdr, int has_grh, void *data, u32 tlen, struct ipath_qp *qp)
 
int ipath_alloc_lkey (struct ipath_lkey_table *rkt, struct ipath_mregion *mr)
 
void ipath_free_lkey (struct ipath_lkey_table *rkt, u32 lkey)
 
int ipath_lkey_ok (struct ipath_qp *qp, struct ipath_sge *isge, struct ib_sge *sge, int acc)
 
int ipath_rkey_ok (struct ipath_qp *qp, struct ipath_sge_state *ss, u32 len, u64 vaddr, u32 rkey, int acc)
 
int ipath_post_srq_receive (struct ib_srq *ibsrq, struct ib_recv_wr *wr, struct ib_recv_wr **bad_wr)
 
struct ib_srqipath_create_srq (struct ib_pd *ibpd, struct ib_srq_init_attr *srq_init_attr, struct ib_udata *udata)
 
int ipath_modify_srq (struct ib_srq *ibsrq, struct ib_srq_attr *attr, enum ib_srq_attr_mask attr_mask, struct ib_udata *udata)
 
int ipath_query_srq (struct ib_srq *ibsrq, struct ib_srq_attr *attr)
 
int ipath_destroy_srq (struct ib_srq *ibsrq)
 
void ipath_cq_enter (struct ipath_cq *cq, struct ib_wc *entry, int sig)
 
int ipath_poll_cq (struct ib_cq *ibcq, int num_entries, struct ib_wc *entry)
 
struct ib_cqipath_create_cq (struct ib_device *ibdev, int entries, int comp_vector, struct ib_ucontext *context, struct ib_udata *udata)
 
int ipath_destroy_cq (struct ib_cq *ibcq)
 
int ipath_req_notify_cq (struct ib_cq *ibcq, enum ib_cq_notify_flags notify_flags)
 
int ipath_resize_cq (struct ib_cq *ibcq, int cqe, struct ib_udata *udata)
 
struct ib_mripath_get_dma_mr (struct ib_pd *pd, int acc)
 
struct ib_mripath_reg_phys_mr (struct ib_pd *pd, struct ib_phys_buf *buffer_list, int num_phys_buf, int acc, u64 *iova_start)
 
struct ib_mripath_reg_user_mr (struct ib_pd *pd, u64 start, u64 length, u64 virt_addr, int mr_access_flags, struct ib_udata *udata)
 
int ipath_dereg_mr (struct ib_mr *ibmr)
 
struct ib_fmripath_alloc_fmr (struct ib_pd *pd, int mr_access_flags, struct ib_fmr_attr *fmr_attr)
 
int ipath_map_phys_fmr (struct ib_fmr *ibfmr, u64 *page_list, int list_len, u64 iova)
 
int ipath_unmap_fmr (struct list_head *fmr_list)
 
int ipath_dealloc_fmr (struct ib_fmr *ibfmr)
 
void ipath_release_mmap_info (struct kref *ref)
 
struct ipath_mmap_infoipath_create_mmap_info (struct ipath_ibdev *dev, u32 size, struct ib_ucontext *context, void *obj)
 
void ipath_update_mmap_info (struct ipath_ibdev *dev, struct ipath_mmap_info *ip, u32 size, void *obj)
 
int ipath_mmap (struct ib_ucontext *context, struct vm_area_struct *vma)
 
void ipath_insert_rnr_queue (struct ipath_qp *qp)
 
int ipath_init_sge (struct ipath_qp *qp, struct ipath_rwqe *wqe, u32 *lengthp, struct ipath_sge_state *ss)
 
int ipath_get_rwqe (struct ipath_qp *qp, int wr_id_only)
 
u32 ipath_make_grh (struct ipath_ibdev *dev, struct ib_grh *hdr, struct ib_global_route *grh, u32 hwords, u32 nwords)
 
void ipath_make_ruc_header (struct ipath_ibdev *dev, struct ipath_qp *qp, struct ipath_other_headers *ohdr, u32 bth0, u32 bth2)
 
void ipath_do_send (unsigned long data)
 
void ipath_send_complete (struct ipath_qp *qp, struct ipath_swqe *wqe, enum ib_wc_status status)
 
int ipath_make_rc_req (struct ipath_qp *qp)
 
int ipath_make_uc_req (struct ipath_qp *qp)
 
int ipath_make_ud_req (struct ipath_qp *qp)
 
int ipath_register_ib_device (struct ipath_devdata *)
 
void ipath_unregister_ib_device (struct ipath_ibdev *)
 
void ipath_ib_rcv (struct ipath_ibdev *, void *, void *, u32)
 
int ipath_ib_piobufavail (struct ipath_ibdev *)
 
unsigned ipath_get_npkeys (struct ipath_devdata *)
 
u32 ipath_get_cr_errpkey (struct ipath_devdata *)
 
unsigned ipath_get_pkey (struct ipath_devdata *, unsigned)
 

Variables

__be64 vaddr
 
__be32 rkey
 
__be32 length
 
__be64 swap_data
 
__be64 compare_data
 
__be32 bth [3]
 
union {
   struct {
      __be32   deth [2]
 
      __be32   imm_data
 
   }   ud
 
   struct {
      struct ib_reth   reth
 
      __be32   imm_data
 
   }   rc
 
   struct {
      __be32   aeth
 
      __be32   atomic_ack_eth [2]
 
   }   at
 
   __be32   imm_data
 
   __be32   aeth
 
   struct ib_atomic_eth   atomic_eth
 
u
 
__be16 lrh [4]
 
__le32 pbc [2]
 
struct ipath_ib_header hdr
 
struct ipath_mcast_qp __attribute__
 
enum ib_wc_opcode ib_ipath_wc_opcode []
 
const u8 ipath_cvt_physportstate []
 
const int ib_ipath_state_ops []
 
unsigned int ib_ipath_lkey_table_size
 
unsigned int ib_ipath_max_cqes
 
unsigned int ib_ipath_max_cqs
 
unsigned int ib_ipath_max_qp_wrs
 
unsigned int ib_ipath_max_qps
 
unsigned int ib_ipath_max_sges
 
unsigned int ib_ipath_max_mcast_grps
 
unsigned int ib_ipath_max_mcast_qp_attached
 
unsigned int ib_ipath_max_srqs
 
unsigned int ib_ipath_max_srq_sges
 
unsigned int ib_ipath_max_srq_wrs
 
const u32 ib_ipath_rnr_table []
 
struct ib_dma_mapping_ops ipath_dma_mapping_ops
 

Macro Definition Documentation

#define IB_CQ_NONE   (IB_CQ_NEXT_COMP + 1)

Definition at line 62 of file ipath_verbs.h.

#define IB_NAK_INVALID_RD_REQUEST   0x64

Definition at line 70 of file ipath_verbs.h.

#define IB_NAK_INVALID_REQUEST   0x61

Definition at line 67 of file ipath_verbs.h.

#define IB_NAK_PSN_ERROR   0x60

Definition at line 66 of file ipath_verbs.h.

#define IB_NAK_REMOTE_ACCESS_ERROR   0x62

Definition at line 68 of file ipath_verbs.h.

#define IB_NAK_REMOTE_OPERATIONAL_ERROR   0x63

Definition at line 69 of file ipath_verbs.h.

#define IB_PHYSPORTSTATE_CFG_TRAIN   4

Definition at line 904 of file ipath_verbs.h.

#define IB_PHYSPORTSTATE_DISABLED   3

Definition at line 903 of file ipath_verbs.h.

#define IB_PHYSPORTSTATE_LINK_ERR_RECOVER   6

Definition at line 906 of file ipath_verbs.h.

#define IB_PHYSPORTSTATE_LINKUP   5

Definition at line 905 of file ipath_verbs.h.

#define IB_PHYSPORTSTATE_POLL   2

Definition at line 902 of file ipath_verbs.h.

#define IB_PHYSPORTSTATE_SLEEP   1

Definition at line 901 of file ipath_verbs.h.

#define IB_PMA_PORT_RCV_DATA   cpu_to_be16(0x0002)

Definition at line 90 of file ipath_verbs.h.

#define IB_PMA_PORT_RCV_PKTS   cpu_to_be16(0x0004)

Definition at line 92 of file ipath_verbs.h.

#define IB_PMA_PORT_XMIT_DATA   cpu_to_be16(0x0001)

Definition at line 89 of file ipath_verbs.h.

#define IB_PMA_PORT_XMIT_PKTS   cpu_to_be16(0x0003)

Definition at line 91 of file ipath_verbs.h.

#define IB_PMA_PORT_XMIT_WAIT   cpu_to_be16(0x0005)

Definition at line 93 of file ipath_verbs.h.

#define IB_PMA_SAMPLE_STATUS_DONE   0x00

Definition at line 84 of file ipath_verbs.h.

#define IB_PMA_SAMPLE_STATUS_RUNNING   0x02

Definition at line 86 of file ipath_verbs.h.

#define IB_PMA_SAMPLE_STATUS_STARTED   0x01

Definition at line 85 of file ipath_verbs.h.

#define IB_RNR_NAK   0x20

Definition at line 65 of file ipath_verbs.h.

#define IPATH_FLUSH_RECV   0x40

Definition at line 79 of file ipath_verbs.h.

#define IPATH_FLUSH_SEND   0x20

Definition at line 78 of file ipath_verbs.h.

#define IPATH_MAX_RDMA_ATOMIC   4

Definition at line 47 of file ipath_verbs.h.

#define IPATH_POST_RECV_OK   0x02

Definition at line 74 of file ipath_verbs.h.

#define IPATH_POST_SEND_OK   0x01

Definition at line 73 of file ipath_verbs.h.

#define IPATH_PROCESS_NEXT_SEND_OK   0x10

Definition at line 77 of file ipath_verbs.h.

#define IPATH_PROCESS_OR_FLUSH_SEND   (IPATH_PROCESS_SEND_OK | IPATH_FLUSH_SEND)

Definition at line 80 of file ipath_verbs.h.

#define IPATH_PROCESS_RECV_OK   0x04

Definition at line 75 of file ipath_verbs.h.

#define IPATH_PROCESS_SEND_OK   0x08

Definition at line 76 of file ipath_verbs.h.

#define IPATH_PSN_CREDIT   512

Definition at line 474 of file ipath_verbs.h.

#define IPATH_R_RDMAR_SEQ   0x02

Definition at line 448 of file ipath_verbs.h.

#define IPATH_R_REUSE_SGE   0x01

Definition at line 447 of file ipath_verbs.h.

#define IPATH_R_WRID_VALID   0

Definition at line 442 of file ipath_verbs.h.

#define IPATH_S_ACK_PENDING   0x08

Definition at line 465 of file ipath_verbs.h.

#define IPATH_S_ANY_WAIT
Value:

Definition at line 471 of file ipath_verbs.h.

#define IPATH_S_BUSY   0x10

Definition at line 466 of file ipath_verbs.h.

#define IPATH_S_FENCE_PENDING   0x02

Definition at line 463 of file ipath_verbs.h.

#define IPATH_S_RDMAR_PENDING   0x04

Definition at line 464 of file ipath_verbs.h.

#define IPATH_S_SIGNAL_REQ_WR   0x01

Definition at line 462 of file ipath_verbs.h.

#define IPATH_S_WAIT_DMA   0x80

Definition at line 469 of file ipath_verbs.h.

#define IPATH_S_WAIT_SSN_CREDIT   0x40

Definition at line 468 of file ipath_verbs.h.

#define IPATH_S_WAITING   0x20

Definition at line 467 of file ipath_verbs.h.

#define IPATH_SEGSZ   (PAGE_SIZE / sizeof (struct ipath_seg))

Definition at line 235 of file ipath_verbs.h.

#define IPATH_UVERBS_ABI_VERSION   2

Definition at line 56 of file ipath_verbs.h.

#define QPN_MAX   (1 << 24)

Definition at line 49 of file ipath_verbs.h.

#define QPNMAP_ENTRIES   (QPN_MAX / PAGE_SIZE / BITS_PER_BYTE)

Definition at line 50 of file ipath_verbs.h.

Function Documentation

struct ib_reth __attribute__ ( (packed)  )
read

Definition at line 171 of file esd_usb2.c.

struct ib_fmr* ipath_alloc_fmr ( struct ib_pd pd,
int  mr_access_flags,
struct ib_fmr_attr fmr_attr 
)
read

ipath_alloc_fmr - allocate a fast memory region : the protection domain for this memory region : access flags for this memory region : fast memory region attributes

Returns the memory region on success, otherwise returns an errno.

Definition at line 287 of file ipath_mr.c.

int ipath_alloc_lkey ( struct ipath_lkey_table rkt,
struct ipath_mregion mr 
)

ipath_alloc_lkey - allocate an lkey : lkey table in which to allocate the lkey : memory region that this lkey protects

Returns 1 if successful, otherwise returns 0.

Definition at line 47 of file ipath_keys.c.

__be32 ipath_compute_aeth ( struct ipath_qp qp)

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

Returns the AETH.

Definition at line 677 of file ipath_qp.c.

void ipath_copy_sge ( struct ipath_sge_state ss,
void data,
u32  length 
)

ipath_copy_sge - copy data to SGE memory : the SGE state : the data to copy : the length of the data

Definition at line 171 of file ipath_verbs.c.

void ipath_cq_enter ( struct ipath_cq cq,
struct ib_wc entry,
int  solicited 
)

ipath_cq_enter - add a new entry to the completion queue : completion queue : work completion entry to add : true if is a solicitated entry

This may be called with qp->s_lock held.

Definition at line 48 of file ipath_cq.c.

struct ib_cq* ipath_create_cq ( struct ib_device ibdev,
int  entries,
int  comp_vector,
struct ib_ucontext context,
struct ib_udata udata 
)
read

ipath_create_cq - create a completion queue : the device this completion queue is attached to : the minimum size of the completion queue : unused by the InfiniPath driver : unused by the InfiniPath driver

Returns a pointer to the completion queue or negative errno values for failure.

Called by ib_create_cq() in the generic verbs code.

Definition at line 200 of file ipath_cq.c.

struct ipath_mmap_info* ipath_create_mmap_info ( struct ipath_ibdev dev,
u32  size,
struct ib_ucontext context,
void obj 
)
read

Definition at line 131 of file ipath_mmap.c.

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

ipath_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 : unused by InfiniPath

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

Called by the ib_create_qp() core verbs function.

Definition at line 741 of file ipath_qp.c.

struct ib_srq* ipath_create_srq ( struct ib_pd ibpd,
struct ib_srq_init_attr srq_init_attr,
struct ib_udata udata 
)
read

ipath_create_srq - create a shared receive queue : the protection domain of the SRQ to create : the attributes of the SRQ : data from libipathverbs when creating a user SRQ

Definition at line 101 of file ipath_srq.c.

int ipath_dealloc_fmr ( struct ib_fmr ibfmr)

ipath_dealloc_fmr - deallocate a fast memory region : the fast memory region to deallocate

Returns 0 on success.

Definition at line 419 of file ipath_mr.c.

int ipath_dereg_mr ( struct ib_mr ibmr)

ipath_dereg_mr - unregister and free a memory region : the memory region to free

Returns 0 on success.

Note that this is called to free MRs created by ipath_get_dma_mr() or ipath_reg_user_mr().

Definition at line 260 of file ipath_mr.c.

int ipath_destroy_cq ( struct ib_cq ibcq)

ipath_destroy_cq - destroy a completion queue : the completion queue to destroy.

Returns 0 for success.

Called by ib_destroy_cq() in the generic verbs code.

Definition at line 314 of file ipath_cq.c.

int ipath_destroy_qp ( struct ib_qp ibqp)

ipath_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 962 of file ipath_qp.c.

int ipath_destroy_srq ( struct ib_srq ibsrq)

ipath_destroy_srq - destroy a shared receive queue : the SRQ to destroy

Definition at line 365 of file ipath_srq.c.

void ipath_do_send ( unsigned long  data)

ipath_do_send - perform a send on a QP : contains a pointer to the QP

Process entries in the send work queue until credit or queue is exhausted. Only allow one CPU to send a packet per QP (tasklet). Otherwise, two threads could send packets out of order.

Definition at line 639 of file ipath_ruc.c.

int ipath_error_qp ( struct ipath_qp qp,
enum ib_wc_status  err 
)

ipath_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 s_lock should be held and interrupts disabled. If we are already in error state, just return.

Definition at line 377 of file ipath_qp.c.

unsigned ipath_free_all_qps ( struct ipath_qp_table qpt)

ipath_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 271 of file ipath_qp.c.

void ipath_free_lkey ( struct ipath_lkey_table rkt,
u32  lkey 
)

ipath_free_lkey - free an lkey : table from which to free the lkey : lkey id to free

Definition at line 96 of file ipath_keys.c.

int ipath_get_counters ( struct ipath_devdata dd,
struct ipath_verbs_counters cntrs 
)

ipath_get_counters - get various chip counters : the infinipath device : counters are placed here

Return the counters needed by recv_pma_get_portcounters().

Definition at line 1382 of file ipath_verbs.c.

u32 ipath_get_cr_errpkey ( struct ipath_devdata )

Definition at line 1575 of file ipath_verbs.c.

void ipath_get_credit ( struct ipath_qp qp,
u32  aeth 
)

ipath_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 1055 of file ipath_qp.c.

struct ib_mr* ipath_get_dma_mr ( struct ib_pd pd,
int  acc 
)
read

ipath_get_dma_mr - get a DMA memory region : protection domain for this memory region : access flags

Returns the memory region on success, otherwise returns an errno. Note that all DMA addresses should be created via the struct ib_dma_mapping_ops functions (see ipath_dma.c).

Definition at line 63 of file ipath_mr.c.

unsigned ipath_get_npkeys ( struct ipath_devdata dd)

ipath_get_npkeys - return the size of the PKEY table for port 0 : the infinipath device

Definition at line 1851 of file ipath_verbs.c.

unsigned ipath_get_pkey ( struct ipath_devdata dd,
unsigned  index 
)

ipath_get_pkey - return the indexed PKEY from the port PKEY table : the infinipath device : the PKEY index

Definition at line 1861 of file ipath_verbs.c.

int ipath_get_rwqe ( struct ipath_qp qp,
int  wr_id_only 
)

ipath_get_rwqe - copy the next RWQE into the QP's RWQE : the QP : update qp->r_wr_id only, not qp->r_sge

Return 0 if no RWQE is available, otherwise return 1.

Can be called from interrupt level.

Definition at line 166 of file ipath_ruc.c.

int ipath_ib_piobufavail ( struct ipath_ibdev dev)

ipath_ib_piobufavail - callback when a PIO buffer is available

This is called from ipath_intr() at interrupt level when a PIO buffer is available after ipath_verbs_send() returned an error that no buffers were available. Return 1 if we consumed all the PIO buffers and we still have QPs waiting for buffers (for now, just restart the send tasklet and return zero).

Definition at line 1457 of file ipath_verbs.c.

unsigned ipath_ib_rate_to_mult ( enum ib_rate  rate)

Definition at line 977 of file ipath_verbs.c.

void ipath_ib_rcv ( struct ipath_ibdev dev,
void rhdr,
void data,
u32  tlen 
)

ipath_ib_rcv - process an incoming packet

This is called from ipath_kreceive() to process an incoming packet at interrupt level. Tlen is the length of the header + data + CRC in bytes.

Definition at line 583 of file ipath_verbs.c.

int ipath_init_qp_table ( struct ipath_ibdev idev,
int  size 
)

ipath_init_qp_table - initialize the QP table for a device : the device who's QP table we're initializing : the size of the QP table

Returns 0 on success, otherwise returns an errno.

Definition at line 1022 of file ipath_qp.c.

int ipath_init_sge ( struct ipath_qp qp,
struct ipath_rwqe wqe,
u32 lengthp,
struct ipath_sge_state ss 
)

ipath_init_sge - Validate a RWQE and fill in the SGE state : the QP

Return 1 if OK.

Definition at line 123 of file ipath_ruc.c.

void ipath_insert_rnr_queue ( struct ipath_qp qp)

ipath_insert_rnr_queue - put QP on the RNR timeout list for the device : the QP

Called with the QP s_lock held and interrupts disabled. XXX Use a simple list for now. We might need a priority queue if we have lots of QPs waiting for RNR timeouts but that should be rare.

Definition at line 87 of file ipath_ruc.c.

int ipath_lkey_ok ( struct ipath_qp qp,
struct ipath_sge isge,
struct ib_sge sge,
int  acc 
)

ipath_lkey_ok - check IB SGE for validity and initialize : table containing lkey to check SGE against : outgoing internal SGE : SGE to check : access flags

Return 1 if valid and successful, otherwise returns 0.

Check the IB SGE for validity and initialize our internal version of it.

Definition at line 121 of file ipath_keys.c.

struct ipath_qp* ipath_lookup_qpn ( struct ipath_qp_table qpt,
u32  qpn 
)
read

ipath_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 301 of file ipath_qp.c.

u32 ipath_make_grh ( struct ipath_ibdev dev,
struct ib_grh hdr,
struct ib_global_route grh,
u32  hwords,
u32  nwords 
)

ipath_make_grh - construct a GRH header : a pointer to the ipath device : a pointer to the GRH header being constructed : the global route address to send to : the number of 32 bit words of header being sent : the number of 32 bit words of data being sent

Return the size of the header in 32 bit words.

Definition at line 580 of file ipath_ruc.c.

int ipath_make_rc_req ( struct ipath_qp qp)

ipath_make_rc_req - construct a request packet (SEND, RDMA r/w, ATOMIC) : a pointer to the QP

Return 1 if constructed; otherwise, return 0.

Definition at line 213 of file ipath_rc.c.

void ipath_make_ruc_header ( struct ipath_ibdev dev,
struct ipath_qp qp,
struct ipath_other_headers ohdr,
u32  bth0,
u32  bth2 
)

Definition at line 600 of file ipath_ruc.c.

int ipath_make_uc_req ( struct ipath_qp qp)

ipath_make_uc_req - construct a request packet (SEND, RDMA write) : a pointer to the QP

Return 1 if constructed; otherwise, return 0.

Definition at line 46 of file ipath_uc.c.

int ipath_make_ud_req ( struct ipath_qp qp)

ipath_make_ud_req - construct a UD request packet : the QP

Return 1 if constructed; otherwise, return 0.

Definition at line 241 of file ipath_ud.c.

int ipath_map_phys_fmr ( struct ib_fmr ibfmr,
u64 page_list,
int  list_len,
u64  iova 
)

ipath_map_phys_fmr - set up a fast memory region : the fast memory region to set up : the list of pages to associate with the fast memory region : the number of pages to associate with the fast memory region : the virtual address of the start of the fast memory region

This may be called from interrupt context.

Definition at line 352 of file ipath_mr.c.

struct ipath_mcast* ipath_mcast_find ( union ib_gid mgid)
read

ipath_mcast_find - search the global table for the given multicast GID : the multicast GID to search for

Returns NULL if not found.

The caller is responsible for decrementing the reference count if found.

Definition at line 121 of file ipath_verbs_mcast.c.

int ipath_mcast_tree_empty ( void  )

Definition at line 361 of file ipath_verbs_mcast.c.

int ipath_mmap ( struct ib_ucontext context,
struct vm_area_struct vma 
)

ipath_mmap - create a new mmap region : the IB user context of the process making the mmap() call : the VMA to be initialized Return zero if the mmap is OK. Otherwise, return an errno.

Definition at line 89 of file ipath_mmap.c.

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

ipath_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 ipathverbs.so

Returns 0 on success, otherwise returns an errno.

Definition at line 450 of file ipath_qp.c.

int ipath_modify_srq ( struct ib_srq ibsrq,
struct ib_srq_attr attr,
enum ib_srq_attr_mask  attr_mask,
struct ib_udata udata 
)

ipath_modify_srq - modify a shared receive queue : the SRQ to modify : the new attributes of the SRQ : indicates which attributes to modify : user data for ipathverbs.so

Definition at line 215 of file ipath_srq.c.

int ipath_multicast_attach ( struct ib_qp ibqp,
union ib_gid gid,
u16  lid 
)

Definition at line 236 of file ipath_verbs_mcast.c.

int ipath_multicast_detach ( struct ib_qp ibqp,
union ib_gid gid,
u16  lid 
)

Definition at line 285 of file ipath_verbs_mcast.c.

int ipath_poll_cq ( struct ib_cq ibcq,
int  num_entries,
struct ib_wc entry 
)

ipath_poll_cq - poll for work completion entries : the completion queue to poll : the maximum number of entries to return : pointer to array where work completions are placed

Returns the number of completion entries polled.

This may be called from interrupt context. Also called by ib_poll_cq() in the generic verbs code.

Definition at line 129 of file ipath_cq.c.

int ipath_post_srq_receive ( struct ib_srq ibsrq,
struct ib_recv_wr wr,
struct ib_recv_wr **  bad_wr 
)

ipath_post_srq_receive - post a receive on a shared receive queue : the SRQ to post the receive on : the list of work requests to post : the first WR to cause a problem is put here

This may be called from interrupt context.

Definition at line 48 of file ipath_srq.c.

int ipath_post_ud_send ( struct ipath_qp qp,
struct ib_send_wr wr 
)
int ipath_process_mad ( struct ib_device ibdev,
int  mad_flags,
u8  port_num,
struct ib_wc in_wc,
struct ib_grh in_grh,
struct ib_mad in_mad,
struct ib_mad out_mad 
)

ipath_process_mad - process an incoming MAD packet : the infiniband device this packet came in on : MAD flags : the port number this packet came in on : the work completion entry for this packet : the global route header for this packet : the incoming MAD : any outgoing MAD reply

Returns IB_MAD_RESULT_SUCCESS if this is a MAD that we are not interested in processing.

Note that the verbs framework has already done the MAD sanity checks, and hop count/pointer updating for IB_MGMT_CLASS_SUBN_DIRECTED_ROUTE MADs.

This is called by the ib_mad module.

Definition at line 1486 of file ipath_mad.c.

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

Definition at line 621 of file ipath_qp.c.

int ipath_query_srq ( struct ib_srq ibsrq,
struct ib_srq_attr attr 
)

Definition at line 351 of file ipath_srq.c.

void ipath_rc_error ( struct ipath_qp qp,
enum ib_wc_status  err 
)

Definition at line 1525 of file ipath_rc.c.

void ipath_rc_rcv ( struct ipath_ibdev dev,
struct ipath_ib_header hdr,
int  has_grh,
void data,
u32  tlen,
struct ipath_qp qp 
)

ipath_rc_rcv - process an incoming RC packet : the device this packet came in on : the header of this packet : true if the header has a GRH : the packet data : the packet length : the QP for this packet

This is called from ipath_qp_rcv() to process an incoming RC packet for the given QP. Called at interrupt level.

Definition at line 1570 of file ipath_rc.c.

struct ib_mr* ipath_reg_phys_mr ( struct ib_pd pd,
struct ib_phys_buf buffer_list,
int  num_phys_buf,
int  acc,
u64 iova_start 
)
read

ipath_reg_phys_mr - register a physical memory region : protection domain for this memory region : pointer to the list of physical buffers to register : the number of physical buffers to register : the starting address passed over IB which maps to this MR

Returns the memory region on success, otherwise returns an errno.

Definition at line 132 of file ipath_mr.c.

struct ib_mr* ipath_reg_user_mr ( struct ib_pd pd,
u64  start,
u64  length,
u64  virt_addr,
int  mr_access_flags,
struct ib_udata udata 
)
read

ipath_reg_user_mr - register a userspace memory region : protection domain for this memory region : starting userspace address : length of region to register : virtual address to use (from HCA's point of view) : access flags for this memory region : unused by the InfiniPath driver

Returns the memory region on success, otherwise returns an errno.

Definition at line 185 of file ipath_mr.c.

int ipath_register_ib_device ( struct ipath_devdata dd)

ipath_register_ib_device - register our device with the infiniband core : the device data structure Return the allocated ipath_ibdev pointer or NULL on error.

Definition at line 1988 of file ipath_verbs.c.

void ipath_release_mmap_info ( struct kref ref)

ipath_release_mmap_info - free mmap info structure a pointer to the kref within struct ipath_mmap_info

Definition at line 46 of file ipath_mmap.c.

int ipath_req_notify_cq ( struct ib_cq ibcq,
enum ib_cq_notify_flags  notify_flags 
)

ipath_req_notify_cq - change the notification type for a completion queue : the completion queue : the type of notification to request

Returns 0 for success.

This may be called from interrupt context. Also called by ib_req_notify_cq() in the generic verbs code.

Definition at line 342 of file ipath_cq.c.

int ipath_resize_cq ( struct ib_cq ibcq,
int  cqe,
struct ib_udata udata 
)

ipath_resize_cq - change the size of the CQ : the completion queue

Returns 0 for success.

Definition at line 371 of file ipath_cq.c.

void ipath_restart_rc ( struct ipath_qp qp,
u32  psn 
)

ipath_restart_rc - back up requester to resend the last un-ACKed request : the QP to restart : packet sequence number for the request : the work completion request

The QP s_lock should be held and interrupts disabled.

Definition at line 805 of file ipath_rc.c.

int ipath_rkey_ok ( struct ipath_qp qp,
struct ipath_sge_state ss,
u32  len,
u64  vaddr,
u32  rkey,
int  acc 
)

ipath_rkey_ok - check the IB virtual address, length, and RKEY : infiniband device : SGE state : length of data : virtual address to place data : rkey to check : access flags

Return 1 if successful, otherwise 0.

Definition at line 199 of file ipath_keys.c.

void ipath_send_complete ( struct ipath_qp qp,
struct ipath_swqe wqe,
enum ib_wc_status  status 
)

Definition at line 699 of file ipath_ruc.c.

void ipath_skip_sge ( struct ipath_sge_state ss,
u32  length 
)

ipath_skip_sge - skip over SGE memory - XXX almost dup of prev func : the SGE state : the number of bytes to skip

Definition at line 211 of file ipath_verbs.c.

int ipath_snapshot_counters ( struct ipath_devdata dd,
u64 swords,
u64 rwords,
u64 spkts,
u64 rpkts,
u64 xmit_wait 
)

Definition at line 1352 of file ipath_verbs.c.

void ipath_uc_rcv ( struct ipath_ibdev dev,
struct ipath_ib_header hdr,
int  has_grh,
void data,
u32  tlen,
struct ipath_qp qp 
)

ipath_uc_rcv - handle an incoming UC packet : the device the packet came in on : the header of the packet : true if the packet has a GRH : the packet data : the length of the packet : the QP for this packet.

This is called from ipath_qp_rcv() to process an incoming UC packet for the given QP. Called at interrupt level.

Definition at line 240 of file ipath_uc.c.

void ipath_ud_rcv ( struct ipath_ibdev dev,
struct ipath_ib_header hdr,
int  has_grh,
void data,
u32  tlen,
struct ipath_qp qp 
)

ipath_ud_rcv - receive an incoming UD packet : the device the packet came in on : the packet header : true if the packet has a GRH : the packet data : the packet length : the QP the packet came on

This is called from ipath_qp_rcv() to process an incoming UD packet for the given QP. Called at interrupt level.

Definition at line 409 of file ipath_ud.c.

int ipath_unmap_fmr ( struct list_head fmr_list)

ipath_unmap_fmr - unmap fast memory regions : the list of fast memory regions to unmap

Returns 0 on success.

Definition at line 396 of file ipath_mr.c.

void ipath_unregister_ib_device ( struct ipath_ibdev )

Definition at line 2215 of file ipath_verbs.c.

void ipath_update_mmap_info ( struct ipath_ibdev dev,
struct ipath_mmap_info ip,
u32  size,
void obj 
)

Definition at line 160 of file ipath_mmap.c.

int ipath_verbs_send ( struct ipath_qp qp,
struct ipath_ib_header hdr,
u32  hdrwords,
struct ipath_sge_state ss,
u32  len 
)

ipath_verbs_send - send a packet : the QP to send on : the packet header : the number of 32-bit words in the header : the SGE to send : the length of the packet in bytes

Definition at line 1322 of file ipath_verbs.c.

Variable Documentation

__be32 aeth

Definition at line 139 of file ipath_verbs.h.

struct { ... } at
__be32 atomic_ack_eth[2]

Definition at line 140 of file ipath_verbs.h.

struct ib_atomic_eth atomic_eth

Definition at line 144 of file ipath_verbs.h.

__be32 bth[3]

Definition at line 128 of file ipath_verbs.h.

__be64 compare_data

Definition at line 110 of file ipath_verbs.h.

__be32 deth[2]

Definition at line 131 of file ipath_verbs.h.

Definition at line 148 of file ipath_verbs.h.

Definition at line 151 of file ipath_verbs.h.

unsigned int ib_ipath_lkey_table_size

Definition at line 50 of file ipath_verbs.c.

unsigned int ib_ipath_max_cqes

Definition at line 65 of file ipath_verbs.c.

unsigned int ib_ipath_max_cqs

Definition at line 70 of file ipath_verbs.c.

unsigned int ib_ipath_max_mcast_grps

Definition at line 87 of file ipath_verbs.c.

unsigned int ib_ipath_max_mcast_qp_attached

Definition at line 93 of file ipath_verbs.c.

unsigned int ib_ipath_max_qp_wrs

Definition at line 74 of file ipath_verbs.c.

unsigned int ib_ipath_max_qps

Definition at line 79 of file ipath_verbs.c.

unsigned int ib_ipath_max_sges

Definition at line 83 of file ipath_verbs.c.

unsigned int ib_ipath_max_srq_sges

Definition at line 103 of file ipath_verbs.c.

unsigned int ib_ipath_max_srq_wrs

Definition at line 108 of file ipath_verbs.c.

unsigned int ib_ipath_max_srqs

Definition at line 99 of file ipath_verbs.c.

const u32 ib_ipath_rnr_table[]

Definition at line 43 of file ipath_ruc.c.

const int ib_ipath_state_ops[]

Definition at line 122 of file ipath_verbs.c.

enum ib_wc_opcode ib_ipath_wc_opcode[]

Definition at line 150 of file ipath_verbs.c.

__be32 imm_data

Definition at line 132 of file ipath_verbs.h.

const u8 ipath_cvt_physportstate[]

Definition at line 1545 of file ipath_verbs.c.

struct ib_dma_mapping_ops ipath_dma_mapping_ops

Definition at line 178 of file ipath_dma.c.

struct { ... } l
__be32 length

Definition at line 102 of file ipath_verbs.h.

__be16 lrh[4]

Definition at line 145 of file ipath_verbs.h.

Definition at line 149 of file ipath_verbs.h.

__le32 pbc[2]

Definition at line 150 of file ipath_verbs.h.

struct { ... } rc

Definition at line 135 of file ipath_verbs.h.

__be32 rkey

Definition at line 101 of file ipath_verbs.h.

__be64 swap_data

Definition at line 109 of file ipath_verbs.h.

union { ... } u
struct { ... } ud
__be32 vaddr

Definition at line 100 of file ipath_verbs.h.