Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Functions | Variables
qib_verbs.c File Reference
#include <rdma/ib_mad.h>
#include <rdma/ib_user_verbs.h>
#include <linux/io.h>
#include <linux/module.h>
#include <linux/utsname.h>
#include <linux/rculist.h>
#include <linux/mm.h>
#include <linux/random.h>
#include "qib.h"
#include "qib_common.h"

Go to the source code of this file.

Data Structures

struct  qib_ucontext
 

Functions

 module_param_named (qp_table_size, ib_qib_qp_table_size, uint, S_IRUGO)
 
 MODULE_PARM_DESC (qp_table_size,"QP table size")
 
 module_param_named (lkey_table_size, ib_qib_lkey_table_size, uint, S_IRUGO)
 
 MODULE_PARM_DESC (lkey_table_size,"LKEY table size in bits (2^n, 1 <= n <= 23)")
 
 module_param_named (max_pds, ib_qib_max_pds, uint, S_IRUGO)
 
 MODULE_PARM_DESC (max_pds,"Maximum number of protection domains to support")
 
 module_param_named (max_ahs, ib_qib_max_ahs, uint, S_IRUGO)
 
 MODULE_PARM_DESC (max_ahs,"Maximum number of address handles to support")
 
 module_param_named (max_cqes, ib_qib_max_cqes, uint, S_IRUGO)
 
 MODULE_PARM_DESC (max_cqes,"Maximum number of completion queue entries to support")
 
 module_param_named (max_cqs, ib_qib_max_cqs, uint, S_IRUGO)
 
 MODULE_PARM_DESC (max_cqs,"Maximum number of completion queues to support")
 
 module_param_named (max_qp_wrs, ib_qib_max_qp_wrs, uint, S_IRUGO)
 
 MODULE_PARM_DESC (max_qp_wrs,"Maximum number of QP WRs to support")
 
 module_param_named (max_qps, ib_qib_max_qps, uint, S_IRUGO)
 
 MODULE_PARM_DESC (max_qps,"Maximum number of QPs to support")
 
 module_param_named (max_sges, ib_qib_max_sges, uint, S_IRUGO)
 
 MODULE_PARM_DESC (max_sges,"Maximum number of SGEs to support")
 
 module_param_named (max_mcast_grps, ib_qib_max_mcast_grps, uint, S_IRUGO)
 
 MODULE_PARM_DESC (max_mcast_grps,"Maximum number of multicast groups to support")
 
 module_param_named (max_mcast_qp_attached, ib_qib_max_mcast_qp_attached, uint, S_IRUGO)
 
 MODULE_PARM_DESC (max_mcast_qp_attached,"Maximum number of attached QPs to support")
 
 module_param_named (max_srqs, ib_qib_max_srqs, uint, S_IRUGO)
 
 MODULE_PARM_DESC (max_srqs,"Maximum number of SRQs to support")
 
 module_param_named (max_srq_sges, ib_qib_max_srq_sges, uint, S_IRUGO)
 
 MODULE_PARM_DESC (max_srq_sges,"Maximum number of SRQ SGEs to support")
 
 module_param_named (max_srq_wrs, ib_qib_max_srq_wrs, uint, S_IRUGO)
 
 MODULE_PARM_DESC (max_srq_wrs,"Maximum number of SRQ WRs support")
 
 module_param_named (disable_sma, ib_qib_disable_sma, uint, S_IWUSR|S_IRUGO)
 
 MODULE_PARM_DESC (disable_sma,"Disable the SMA")
 
void qib_copy_sge (struct qib_sge_state *ss, void *data, u32 length, int release)
 
void qib_skip_sge (struct qib_sge_state *ss, u32 length, int release)
 
void qib_ib_rcv (struct qib_ctxtdata *rcd, void *rhdr, void *data, u32 tlen)
 
void qib_put_txreq (struct qib_verbs_txreq *tx)
 
void qib_verbs_sdma_desc_avail (struct qib_pportdata *ppd, unsigned avail)
 
int qib_verbs_send (struct qib_qp *qp, struct qib_ib_header *hdr, u32 hdrwords, struct qib_sge_state *ss, u32 len)
 
int qib_snapshot_counters (struct qib_pportdata *ppd, u64 *swords, u64 *rwords, u64 *spkts, u64 *rpkts, u64 *xmit_wait)
 
int qib_get_counters (struct qib_pportdata *ppd, struct qib_verbs_counters *cntrs)
 
void qib_ib_piobufavail (struct qib_devdata *dd)
 
int qib_check_ah (struct ib_device *ibdev, struct ib_ah_attr *ah_attr)
 
struct ib_ahqib_create_qp0_ah (struct qib_ibport *ibp, u16 dlid)
 
unsigned qib_get_npkeys (struct qib_devdata *dd)
 
unsigned qib_get_pkey (struct qib_ibport *ibp, unsigned index)
 
int qib_register_ib_device (struct qib_devdata *dd)
 
void qib_unregister_ib_device (struct qib_devdata *dd)
 
void qib_schedule_send (struct qib_qp *qp)
 

Variables

unsigned int ib_qib_lkey_table_size = 16
 
unsigned int ib_qib_max_cqes = 0x2FFFF
 
unsigned int ib_qib_max_cqs = 0x1FFFF
 
unsigned int ib_qib_max_qp_wrs = 0x3FFF
 
unsigned int ib_qib_max_qps = 16384
 
unsigned int ib_qib_max_sges = 0x60
 
unsigned int ib_qib_max_mcast_grps = 16384
 
unsigned int ib_qib_max_mcast_qp_attached = 16
 
unsigned int ib_qib_max_srqs = 1024
 
unsigned int ib_qib_max_srq_sges = 128
 
unsigned int ib_qib_max_srq_wrs = 0x1FFFF
 
const int ib_qib_state_ops [IB_QPS_ERR+1]
 
enum ib_wc_opcode ib_qib_wc_opcode []
 
__be64 ib_qib_sys_image_guid
 

Function Documentation

module_param_named ( qp_table_size  ,
ib_qib_qp_table_size  ,
uint  ,
S_IRUGO   
)
module_param_named ( lkey_table_size  ,
ib_qib_lkey_table_size  ,
uint  ,
S_IRUGO   
)
module_param_named ( max_pds  ,
ib_qib_max_pds  ,
uint  ,
S_IRUGO   
)
module_param_named ( max_ahs  ,
ib_qib_max_ahs  ,
uint  ,
S_IRUGO   
)
module_param_named ( max_cqes  ,
ib_qib_max_cqes  ,
uint  ,
S_IRUGO   
)
module_param_named ( max_cqs  ,
ib_qib_max_cqs  ,
uint  ,
S_IRUGO   
)
module_param_named ( max_qp_wrs  ,
ib_qib_max_qp_wrs  ,
uint  ,
S_IRUGO   
)
module_param_named ( max_qps  ,
ib_qib_max_qps  ,
uint  ,
S_IRUGO   
)
module_param_named ( max_sges  ,
ib_qib_max_sges  ,
uint  ,
S_IRUGO   
)
module_param_named ( max_mcast_grps  ,
ib_qib_max_mcast_grps  ,
uint  ,
S_IRUGO   
)
module_param_named ( max_mcast_qp_attached  ,
ib_qib_max_mcast_qp_attached  ,
uint  ,
S_IRUGO   
)
module_param_named ( max_srqs  ,
ib_qib_max_srqs  ,
uint  ,
S_IRUGO   
)
module_param_named ( max_srq_sges  ,
ib_qib_max_srq_sges  ,
uint  ,
S_IRUGO   
)
module_param_named ( max_srq_wrs  ,
ib_qib_max_srq_wrs  ,
uint  ,
S_IRUGO   
)
module_param_named ( disable_sma  ,
ib_qib_disable_sma  ,
uint  ,
S_IWUSR S_IRUGO 
)
MODULE_PARM_DESC ( qp_table_size  ,
"QP table size  
)
MODULE_PARM_DESC ( lkey_table_size  ,
"LKEY table size in bits (2^n, 1 <= n <= 23)"   
)
MODULE_PARM_DESC ( max_pds  ,
"Maximum number of protection domains to support  
)
MODULE_PARM_DESC ( max_ahs  ,
"Maximum number of address handles to support  
)
MODULE_PARM_DESC ( max_cqes  ,
"Maximum number of completion queue entries to support  
)
MODULE_PARM_DESC ( max_cqs  ,
"Maximum number of completion queues to support  
)
MODULE_PARM_DESC ( max_qp_wrs  ,
"Maximum number of QP WRs to support  
)
MODULE_PARM_DESC ( max_qps  ,
"Maximum number of QPs to support  
)
MODULE_PARM_DESC ( max_sges  ,
"Maximum number of SGEs to support  
)
MODULE_PARM_DESC ( max_mcast_grps  ,
"Maximum number of multicast groups to support  
)
MODULE_PARM_DESC ( max_mcast_qp_attached  ,
"Maximum number of attached QPs to support  
)
MODULE_PARM_DESC ( max_srqs  ,
"Maximum number of SRQs to support  
)
MODULE_PARM_DESC ( max_srq_sges  ,
"Maximum number of SRQ SGEs to support  
)
MODULE_PARM_DESC ( max_srq_wrs  ,
"Maximum number of SRQ WRs support  
)
MODULE_PARM_DESC ( disable_sma  ,
"Disable the SMA  
)
int qib_check_ah ( struct ib_device ibdev,
struct ib_ah_attr ah_attr 
)

Definition at line 1785 of file qib_verbs.c.

void qib_copy_sge ( struct qib_sge_state ss,
void data,
u32  length,
int  release 
)

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

Definition at line 168 of file qib_verbs.c.

struct ib_ah* qib_create_qp0_ah ( struct qib_ibport ibp,
u16  dlid 
)
read

Definition at line 1857 of file qib_verbs.c.

int qib_get_counters ( struct qib_pportdata ppd,
struct qib_verbs_counters cntrs 
)

qib_get_counters - get various chip counters : the qlogic_ib device : counters are placed here

Return the counters needed by recv_pma_get_portcounters().

Definition at line 1435 of file qib_verbs.c.

unsigned qib_get_npkeys ( struct qib_devdata dd)

qib_get_npkeys - return the size of the PKEY table for context 0 : the qlogic_ib device

Definition at line 1923 of file qib_verbs.c.

unsigned qib_get_pkey ( struct qib_ibport ibp,
unsigned  index 
)

Definition at line 1932 of file qib_verbs.c.

void qib_ib_piobufavail ( struct qib_devdata dd)

qib_ib_piobufavail - callback when a PIO buffer is available : the device pointer

This is called from qib_intr() at interrupt level when a PIO buffer is available after qib_verbs_send() returned an error that no buffers were available. Disable the interrupt if there are no more QPs waiting.

Definition at line 1503 of file qib_verbs.c.

void qib_ib_rcv ( struct qib_ctxtdata rcd,
void rhdr,
void data,
u32  tlen 
)

qib_ib_rcv - process an incoming packet : the context pointer : the header of the packet : the packet payload : the packet length

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

Definition at line 608 of file qib_verbs.c.

void qib_put_txreq ( struct qib_verbs_txreq tx)

Definition at line 978 of file qib_verbs.c.

int qib_register_ib_device ( struct qib_devdata dd)

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

Definition at line 2045 of file qib_verbs.c.

void qib_schedule_send ( struct qib_qp qp)

Definition at line 2324 of file qib_verbs.c.

void qib_skip_sge ( struct qib_sge_state ss,
u32  length,
int  release 
)

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

Definition at line 210 of file qib_verbs.c.

int qib_snapshot_counters ( struct qib_pportdata ppd,
u64 swords,
u64 rwords,
u64 spkts,
u64 rpkts,
u64 xmit_wait 
)

Definition at line 1404 of file qib_verbs.c.

void qib_unregister_ib_device ( struct qib_devdata dd)

Definition at line 2271 of file qib_verbs.c.

void qib_verbs_sdma_desc_avail ( struct qib_pportdata ppd,
unsigned  avail 
)

Definition at line 1032 of file qib_verbs.c.

int qib_verbs_send ( struct qib_qp qp,
struct qib_ib_header hdr,
u32  hdrwords,
struct qib_sge_state ss,
u32  len 
)

qib_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

Return zero if packet is sent or queued OK. Return non-zero and clear qp->s_flags QIB_S_BUSY otherwise.

Definition at line 1374 of file qib_verbs.c.

Variable Documentation

unsigned int ib_qib_lkey_table_size = 16

Definition at line 51 of file qib_verbs.c.

unsigned int ib_qib_max_cqes = 0x2FFFF

Definition at line 66 of file qib_verbs.c.

unsigned int ib_qib_max_cqs = 0x1FFFF

Definition at line 71 of file qib_verbs.c.

unsigned int ib_qib_max_mcast_grps = 16384

Definition at line 87 of file qib_verbs.c.

unsigned int ib_qib_max_mcast_qp_attached = 16

Definition at line 92 of file qib_verbs.c.

unsigned int ib_qib_max_qp_wrs = 0x3FFF

Definition at line 75 of file qib_verbs.c.

unsigned int ib_qib_max_qps = 16384

Definition at line 79 of file qib_verbs.c.

unsigned int ib_qib_max_sges = 0x60

Definition at line 83 of file qib_verbs.c.

unsigned int ib_qib_max_srq_sges = 128

Definition at line 102 of file qib_verbs.c.

unsigned int ib_qib_max_srq_wrs = 0x1FFFF

Definition at line 106 of file qib_verbs.c.

unsigned int ib_qib_max_srqs = 1024

Definition at line 98 of file qib_verbs.c.

const int ib_qib_state_ops[IB_QPS_ERR+1]
__be64 ib_qib_sys_image_guid

Definition at line 160 of file qib_verbs.c.

enum ib_wc_opcode ib_qib_wc_opcode[]