Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Enumerations | Functions | Variables
mthca_qp.c File Reference
#include <linux/string.h>
#include <linux/slab.h>
#include <linux/sched.h>
#include <asm/io.h>
#include <rdma/ib_verbs.h>
#include <rdma/ib_cache.h>
#include <rdma/ib_pack.h>
#include "mthca_dev.h"
#include "mthca_cmd.h"
#include "mthca_memfree.h"
#include "mthca_wqe.h"

Go to the source code of this file.

Data Structures

struct  mthca_qp_path
 
struct  mthca_qp_context
 
struct  mthca_qp_param
 

Enumerations

enum  {
  MTHCA_MAX_DIRECT_QP_SIZE = 4 * PAGE_SIZE, MTHCA_ACK_REQ_FREQ = 10, MTHCA_FLIGHT_LIMIT = 9, MTHCA_UD_HEADER_SIZE = 72,
  MTHCA_INLINE_HEADER_SIZE = 4, MTHCA_INLINE_CHUNK_SIZE = 16
}
 
enum  {
  MTHCA_QP_STATE_RST = 0, MTHCA_QP_STATE_INIT = 1, MTHCA_QP_STATE_RTR = 2, MTHCA_QP_STATE_RTS = 3,
  MTHCA_QP_STATE_SQE = 4, MTHCA_QP_STATE_SQD = 5, MTHCA_QP_STATE_ERR = 6, MTHCA_QP_STATE_DRAINING = 7
}
 
enum  {
  MTHCA_QP_ST_RC = 0x0, MTHCA_QP_ST_UC = 0x1, MTHCA_QP_ST_RD = 0x2, MTHCA_QP_ST_UD = 0x3,
  MTHCA_QP_ST_MLX = 0x7
}
 
enum  { MTHCA_QP_PM_MIGRATED = 0x3, MTHCA_QP_PM_ARMED = 0x0, MTHCA_QP_PM_REARM = 0x1 }
 
enum  {
  MTHCA_QP_BIT_DE = 1 << 8, MTHCA_QP_BIT_SRE = 1 << 15, MTHCA_QP_BIT_SWE = 1 << 14, MTHCA_QP_BIT_SAE = 1 << 13,
  MTHCA_QP_BIT_SIC = 1 << 4, MTHCA_QP_BIT_SSC = 1 << 3, MTHCA_QP_BIT_RRE = 1 << 15, MTHCA_QP_BIT_RWE = 1 << 14,
  MTHCA_QP_BIT_RAE = 1 << 13, MTHCA_QP_BIT_RIC = 1 << 4, MTHCA_QP_BIT_RSC = 1 << 3
}
 
enum  { MTHCA_SEND_DOORBELL_FENCE = 1 << 5 }
 
enum  {
  MTHCA_QP_OPTPAR_ALT_ADDR_PATH = 1 << 0, MTHCA_QP_OPTPAR_RRE = 1 << 1, MTHCA_QP_OPTPAR_RAE = 1 << 2, MTHCA_QP_OPTPAR_RWE = 1 << 3,
  MTHCA_QP_OPTPAR_PKEY_INDEX = 1 << 4, MTHCA_QP_OPTPAR_Q_KEY = 1 << 5, MTHCA_QP_OPTPAR_RNR_TIMEOUT = 1 << 6, MTHCA_QP_OPTPAR_PRIMARY_ADDR_PATH = 1 << 7,
  MTHCA_QP_OPTPAR_SRA_MAX = 1 << 8, MTHCA_QP_OPTPAR_RRA_MAX = 1 << 9, MTHCA_QP_OPTPAR_PM_STATE = 1 << 10, MTHCA_QP_OPTPAR_PORT_NUM = 1 << 11,
  MTHCA_QP_OPTPAR_RETRY_COUNT = 1 << 12, MTHCA_QP_OPTPAR_ALT_RNR_RETRY = 1 << 13, MTHCA_QP_OPTPAR_ACK_TIMEOUT = 1 << 14, MTHCA_QP_OPTPAR_RNR_RETRY = 1 << 15,
  MTHCA_QP_OPTPAR_SCHED_QUEUE = 1 << 16
}
 
enum  {
  RC, UC, UD, RD,
  RDEE, MLX, NUM_TRANS
}
 

Functions

struct mthca_qp_path __attribute__ ((packed))
 
void mthca_qp_event (struct mthca_dev *dev, u32 qpn, enum ib_event_type event_type)
 
int mthca_query_qp (struct ib_qp *ibqp, struct ib_qp_attr *qp_attr, int qp_attr_mask, struct ib_qp_init_attr *qp_init_attr)
 
int mthca_modify_qp (struct ib_qp *ibqp, struct ib_qp_attr *attr, int attr_mask, struct ib_udata *udata)
 
int mthca_alloc_qp (struct mthca_dev *dev, struct mthca_pd *pd, struct mthca_cq *send_cq, struct mthca_cq *recv_cq, enum ib_qp_type type, enum ib_sig_type send_policy, struct ib_qp_cap *cap, struct mthca_qp *qp)
 
int mthca_alloc_sqp (struct mthca_dev *dev, struct mthca_pd *pd, struct mthca_cq *send_cq, struct mthca_cq *recv_cq, enum ib_sig_type send_policy, struct ib_qp_cap *cap, int qpn, int port, struct mthca_sqp *sqp)
 
void mthca_free_qp (struct mthca_dev *dev, struct mthca_qp *qp)
 
int mthca_tavor_post_send (struct ib_qp *ibqp, struct ib_send_wr *wr, struct ib_send_wr **bad_wr)
 
int mthca_tavor_post_receive (struct ib_qp *ibqp, struct ib_recv_wr *wr, struct ib_recv_wr **bad_wr)
 
int mthca_arbel_post_send (struct ib_qp *ibqp, struct ib_send_wr *wr, struct ib_send_wr **bad_wr)
 
int mthca_arbel_post_receive (struct ib_qp *ibqp, struct ib_recv_wr *wr, struct ib_recv_wr **bad_wr)
 
void mthca_free_err_wqe (struct mthca_dev *dev, struct mthca_qp *qp, int is_send, int index, int *dbd, __be32 *new_wqe)
 
int mthca_init_qp_table (struct mthca_dev *dev)
 
void mthca_cleanup_qp_table (struct mthca_dev *dev)
 

Variables

__be32 port_pkey
 
u8 rnr_retry
 
u8 g_mylmc
 
__be16 rlid
 
u8 ackto
 
u8 mgid_index
 
u8 static_rate
 
u8 hop_limit
 
__be32 sl_tclass_flowlabel
 
u8 rgid [16]
 
__be32 flags
 
__be32 tavor_sched_queue
 
u8 mtu_msgmax
 
u8 rq_size_stride
 
u8 sq_size_stride
 
u8 rlkey_arbel_sched_queue
 
__be32 usr_page
 
__be32 local_qpn
 
__be32 remote_qpn
 
u32 reserved1 [2]
 
struct mthca_qp_path pri_path
 
struct mthca_qp_path alt_path
 
__be32 rdd
 
__be32 pd
 
__be32 wqe_base
 
__be32 wqe_lkey
 
__be32 params1
 
__be32 reserved2
 
__be32 next_send_psn
 
__be32 cqn_snd
 
__be32 snd_wqe_base_l
 
__be32 snd_db_index
 
__be32 last_acked_psn
 
__be32 ssn
 
__be32 params2
 
__be32 rnr_nextrecvpsn
 
__be32 ra_buff_indx
 
__be32 cqn_rcv
 
__be32 rcv_wqe_base_l
 
__be32 rcv_db_index
 
__be32 qkey
 
__be32 srqn
 
__be32 rmsn
 
__be16 rq_wqe_counter
 
__be16 sq_wqe_counter
 
u32 reserved3 [18]
 
__be32 opt_param_mask
 
struct mthca_qp_context context
 
enum { ... }  __attribute__
 

Enumeration Type Documentation

anonymous enum
Enumerator:
MTHCA_MAX_DIRECT_QP_SIZE 
MTHCA_ACK_REQ_FREQ 
MTHCA_FLIGHT_LIMIT 
MTHCA_UD_HEADER_SIZE 
MTHCA_INLINE_HEADER_SIZE 
MTHCA_INLINE_CHUNK_SIZE 

Definition at line 51 of file mthca_qp.c.

anonymous enum
Enumerator:
MTHCA_QP_STATE_RST 
MTHCA_QP_STATE_INIT 
MTHCA_QP_STATE_RTR 
MTHCA_QP_STATE_RTS 
MTHCA_QP_STATE_SQE 
MTHCA_QP_STATE_SQD 
MTHCA_QP_STATE_ERR 
MTHCA_QP_STATE_DRAINING 

Definition at line 60 of file mthca_qp.c.

anonymous enum
Enumerator:
MTHCA_QP_ST_RC 
MTHCA_QP_ST_UC 
MTHCA_QP_ST_RD 
MTHCA_QP_ST_UD 
MTHCA_QP_ST_MLX 

Definition at line 71 of file mthca_qp.c.

anonymous enum
Enumerator:
MTHCA_QP_PM_MIGRATED 
MTHCA_QP_PM_ARMED 
MTHCA_QP_PM_REARM 

Definition at line 79 of file mthca_qp.c.

anonymous enum
Enumerator:
MTHCA_QP_BIT_DE 
MTHCA_QP_BIT_SRE 
MTHCA_QP_BIT_SWE 
MTHCA_QP_BIT_SAE 
MTHCA_QP_BIT_SIC 
MTHCA_QP_BIT_SSC 
MTHCA_QP_BIT_RRE 
MTHCA_QP_BIT_RWE 
MTHCA_QP_BIT_RAE 
MTHCA_QP_BIT_RIC 
MTHCA_QP_BIT_RSC 

Definition at line 85 of file mthca_qp.c.

anonymous enum
Enumerator:
MTHCA_SEND_DOORBELL_FENCE 

Definition at line 102 of file mthca_qp.c.

anonymous enum
Enumerator:
MTHCA_QP_OPTPAR_ALT_ADDR_PATH 
MTHCA_QP_OPTPAR_RRE 
MTHCA_QP_OPTPAR_RAE 
MTHCA_QP_OPTPAR_RWE 
MTHCA_QP_OPTPAR_PKEY_INDEX 
MTHCA_QP_OPTPAR_Q_KEY 
MTHCA_QP_OPTPAR_RNR_TIMEOUT 
MTHCA_QP_OPTPAR_PRIMARY_ADDR_PATH 
MTHCA_QP_OPTPAR_SRA_MAX 
MTHCA_QP_OPTPAR_RRA_MAX 
MTHCA_QP_OPTPAR_PM_STATE 
MTHCA_QP_OPTPAR_PORT_NUM 
MTHCA_QP_OPTPAR_RETRY_COUNT 
MTHCA_QP_OPTPAR_ALT_RNR_RETRY 
MTHCA_QP_OPTPAR_ACK_TIMEOUT 
MTHCA_QP_OPTPAR_RNR_RETRY 
MTHCA_QP_OPTPAR_SCHED_QUEUE 

Definition at line 165 of file mthca_qp.c.

anonymous enum
Enumerator:
RC 
UC 
UD 
RD 
RDEE 
MLX 
NUM_TRANS 

Definition at line 284 of file mthca_qp.c.

Function Documentation

struct mthca_qp_path __attribute__ ( (packed)  )
read

Definition at line 171 of file esd_usb2.c.

int mthca_alloc_qp ( struct mthca_dev dev,
struct mthca_pd pd,
struct mthca_cq send_cq,
struct mthca_cq recv_cq,
enum ib_qp_type  type,
enum ib_sig_type  send_policy,
struct ib_qp_cap cap,
struct mthca_qp qp 
)

Definition at line 1268 of file mthca_qp.c.

int mthca_alloc_sqp ( struct mthca_dev dev,
struct mthca_pd pd,
struct mthca_cq send_cq,
struct mthca_cq recv_cq,
enum ib_sig_type  send_policy,
struct ib_qp_cap cap,
int  qpn,
int  port,
struct mthca_sqp sqp 
)

Definition at line 1342 of file mthca_qp.c.

int mthca_arbel_post_receive ( struct ib_qp ibqp,
struct ib_recv_wr wr,
struct ib_recv_wr **  bad_wr 
)

Definition at line 2155 of file mthca_qp.c.

int mthca_arbel_post_send ( struct ib_qp ibqp,
struct ib_send_wr wr,
struct ib_send_wr **  bad_wr 
)

Definition at line 1915 of file mthca_qp.c.

void mthca_cleanup_qp_table ( struct mthca_dev dev)

Definition at line 2301 of file mthca_qp.c.

void mthca_free_err_wqe ( struct mthca_dev dev,
struct mthca_qp qp,
int  is_send,
int  index,
int dbd,
__be32 new_wqe 
)

Definition at line 2226 of file mthca_qp.c.

void mthca_free_qp ( struct mthca_dev dev,
struct mthca_qp qp 
)

Definition at line 1420 of file mthca_qp.c.

int mthca_init_qp_table ( struct mthca_dev dev)

Definition at line 2253 of file mthca_qp.c.

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

Definition at line 842 of file mthca_qp.c.

void mthca_qp_event ( struct mthca_dev dev,
u32  qpn,
enum ib_event_type  event_type 
)

Definition at line 237 of file mthca_qp.c.

int mthca_query_qp ( struct ib_qp ibqp,
struct ib_qp_attr qp_attr,
int  qp_attr_mask,
struct ib_qp_init_attr qp_init_attr 
)

Definition at line 424 of file mthca_qp.c.

int mthca_tavor_post_receive ( struct ib_qp ibqp,
struct ib_recv_wr wr,
struct ib_recv_wr **  bad_wr 
)

Definition at line 1804 of file mthca_qp.c.

int mthca_tavor_post_send ( struct ib_qp ibqp,
struct ib_send_wr wr,
struct ib_send_wr **  bad_wr 
)

Definition at line 1601 of file mthca_qp.c.

Variable Documentation

enum { ... } __attribute__
u8 ackto

Definition at line 122 of file mthca_qp.c.

Definition at line 168 of file mthca_qp.c.

Definition at line 166 of file mthca_qp.c.

__be32 cqn_rcv

Definition at line 184 of file mthca_qp.c.

__be32 cqn_snd

Definition at line 176 of file mthca_qp.c.

__be32 flags

Definition at line 157 of file mthca_qp.c.

u8 g_mylmc

Definition at line 120 of file mthca_qp.c.

u8 hop_limit

Definition at line 125 of file mthca_qp.c.

__be32 last_acked_psn

Definition at line 179 of file mthca_qp.c.

__be32 local_qpn

Definition at line 164 of file mthca_qp.c.

u8 mgid_index

Definition at line 123 of file mthca_qp.c.

u8 mtu_msgmax

Definition at line 159 of file mthca_qp.c.

__be32 next_send_psn

Definition at line 175 of file mthca_qp.c.

__be32 opt_param_mask

Definition at line 164 of file mthca_qp.c.

__be32 params1

Definition at line 173 of file mthca_qp.c.

__be32 params2

Definition at line 181 of file mthca_qp.c.

__be32 pd

Definition at line 170 of file mthca_qp.c.

__be32 port_pkey

Definition at line 118 of file mthca_qp.c.

Definition at line 167 of file mthca_qp.c.

__be32 qkey

Definition at line 187 of file mthca_qp.c.

__be32 ra_buff_indx

Definition at line 183 of file mthca_qp.c.

__be32 rcv_db_index

Definition at line 186 of file mthca_qp.c.

__be32 rcv_wqe_base_l

Definition at line 185 of file mthca_qp.c.

__be32 rdd

Definition at line 169 of file mthca_qp.c.

__be32 remote_qpn

Definition at line 165 of file mthca_qp.c.

u32 reserved1

Definition at line 166 of file mthca_qp.c.

u32 reserved2[62]

Definition at line 174 of file mthca_qp.c.

u32 reserved3[18]

Definition at line 192 of file mthca_qp.c.

u8 rgid[16]

Definition at line 127 of file mthca_qp.c.

__be16 rlid

Definition at line 121 of file mthca_qp.c.

u8 rlkey_arbel_sched_queue

Definition at line 162 of file mthca_qp.c.

__be32 rmsn

Definition at line 189 of file mthca_qp.c.

__be32 rnr_nextrecvpsn

Definition at line 182 of file mthca_qp.c.

u8 rnr_retry

Definition at line 119 of file mthca_qp.c.

u8 rq_size_stride

Definition at line 160 of file mthca_qp.c.

__be16 rq_wqe_counter

Definition at line 190 of file mthca_qp.c.

__be32 sl_tclass_flowlabel

Definition at line 126 of file mthca_qp.c.

__be32 snd_db_index

Definition at line 178 of file mthca_qp.c.

__be32 snd_wqe_base_l

Definition at line 177 of file mthca_qp.c.

u8 sq_size_stride

Definition at line 161 of file mthca_qp.c.

__be16 sq_wqe_counter

Definition at line 191 of file mthca_qp.c.

__be32 srqn

Definition at line 188 of file mthca_qp.c.

__be32 ssn

Definition at line 180 of file mthca_qp.c.

u8 static_rate

Definition at line 124 of file mthca_qp.c.

__be32 tavor_sched_queue

Definition at line 158 of file mthca_qp.c.

__be32 usr_page

Definition at line 163 of file mthca_qp.c.

__be32 wqe_base

Definition at line 171 of file mthca_qp.c.

__be32 wqe_lkey

Definition at line 172 of file mthca_qp.c.