Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Enumerations | Functions
ocrdma_hw.c File Reference
#include <linux/sched.h>
#include <linux/interrupt.h>
#include <linux/log2.h>
#include <linux/dma-mapping.h>
#include <rdma/ib_verbs.h>
#include <rdma/ib_user_verbs.h>
#include <rdma/ib_addr.h>
#include "ocrdma.h"
#include "ocrdma_hw.h"
#include "ocrdma_verbs.h"
#include "ocrdma_ah.h"

Go to the source code of this file.

Enumerations

enum  mbx_status {
  OCRDMA_MBX_STATUS_FAILED = 1, OCRDMA_MBX_STATUS_ILLEGAL_FIELD = 3, OCRDMA_MBX_STATUS_OOR = 100, OCRDMA_MBX_STATUS_INVALID_PD = 101,
  OCRDMA_MBX_STATUS_PD_INUSE = 102, OCRDMA_MBX_STATUS_INVALID_CQ = 103, OCRDMA_MBX_STATUS_INVALID_QP = 104, OCRDMA_MBX_STATUS_INVALID_LKEY = 105,
  OCRDMA_MBX_STATUS_ORD_EXCEEDS = 106, OCRDMA_MBX_STATUS_IRD_EXCEEDS = 107, OCRDMA_MBX_STATUS_SENDQ_WQE_EXCEEDS = 108, OCRDMA_MBX_STATUS_RECVQ_RQE_EXCEEDS = 109,
  OCRDMA_MBX_STATUS_SGE_SEND_EXCEEDS = 110, OCRDMA_MBX_STATUS_SGE_WRITE_EXCEEDS = 111, OCRDMA_MBX_STATUS_SGE_RECV_EXCEEDS = 112, OCRDMA_MBX_STATUS_INVALID_STATE_CHANGE = 113,
  OCRDMA_MBX_STATUS_MW_BOUND = 114, OCRDMA_MBX_STATUS_INVALID_VA = 115, OCRDMA_MBX_STATUS_INVALID_LENGTH = 116, OCRDMA_MBX_STATUS_INVALID_FBO = 117,
  OCRDMA_MBX_STATUS_INVALID_ACC_RIGHTS = 118, OCRDMA_MBX_STATUS_INVALID_PBE_SIZE = 119, OCRDMA_MBX_STATUS_INVALID_PBL_ENTRY = 120, OCRDMA_MBX_STATUS_INVALID_PBL_SHIFT = 121,
  OCRDMA_MBX_STATUS_INVALID_SRQ_ID = 129, OCRDMA_MBX_STATUS_SRQ_ERROR = 133, OCRDMA_MBX_STATUS_RQE_EXCEEDS = 134, OCRDMA_MBX_STATUS_MTU_EXCEEDS = 135,
  OCRDMA_MBX_STATUS_MAX_QP_EXCEEDS = 136, OCRDMA_MBX_STATUS_SRQ_LIMIT_EXCEEDS = 137, OCRDMA_MBX_STATUS_SRQ_SIZE_UNDERUNS = 138, OCRDMA_MBX_STATUS_QP_BOUND = 130,
  OCRDMA_MBX_STATUS_INVALID_CHANGE = 139, OCRDMA_MBX_STATUS_ATOMIC_OPS_UNSUP = 140, OCRDMA_MBX_STATUS_INVALID_RNR_NAK_TIMER = 141, OCRDMA_MBX_STATUS_MW_STILL_BOUND = 142,
  OCRDMA_MBX_STATUS_PKEY_INDEX_INVALID = 143, OCRDMA_MBX_STATUS_PKEY_INDEX_EXCEEDS = 144
}
 
enum  additional_status { OCRDMA_MBX_ADDI_STATUS_INSUFFICIENT_RESOURCES = 22 }
 
enum  cqe_status {
  OCRDMA_MBX_CQE_STATUS_INSUFFICIENT_PRIVILEDGES = 1, OCRDMA_MBX_CQE_STATUS_INVALID_PARAMETER = 2, OCRDMA_MBX_CQE_STATUS_INSUFFICIENT_RESOURCES = 3, OCRDMA_MBX_CQE_STATUS_QUEUE_FLUSHING = 4,
  OCRDMA_MBX_CQE_STATUS_DMA_FAILED = 5
}
 

Functions

enum ib_qp_state get_ibqp_state (enum ocrdma_qp_state qps)
 
void ocrdma_ring_cq_db (struct ocrdma_dev *dev, u16 cq_id, bool armed, bool solicited, u16 cqe_popped)
 
int ocrdma_mbx_alloc_pd (struct ocrdma_dev *dev, struct ocrdma_pd *pd)
 
int ocrdma_mbx_dealloc_pd (struct ocrdma_dev *dev, struct ocrdma_pd *pd)
 
int ocrdma_mbx_create_cq (struct ocrdma_dev *dev, struct ocrdma_cq *cq, int entries, int dpp_cq)
 
int ocrdma_mbx_destroy_cq (struct ocrdma_dev *dev, struct ocrdma_cq *cq)
 
int ocrdma_mbx_alloc_lkey (struct ocrdma_dev *dev, struct ocrdma_hw_mr *hwmr, u32 pdid, int addr_check)
 
int ocrdma_mbx_dealloc_lkey (struct ocrdma_dev *dev, int fr_mr, u32 lkey)
 
int ocrdma_reg_mr (struct ocrdma_dev *dev, struct ocrdma_hw_mr *hwmr, u32 pdid, int acc)
 
bool ocrdma_is_qp_in_sq_flushlist (struct ocrdma_cq *cq, struct ocrdma_qp *qp)
 
bool ocrdma_is_qp_in_rq_flushlist (struct ocrdma_cq *cq, struct ocrdma_qp *qp)
 
void ocrdma_flush_qp (struct ocrdma_qp *qp)
 
int ocrdma_qp_state_machine (struct ocrdma_qp *qp, enum ib_qp_state new_ib_state, enum ib_qp_state *old_ib_state)
 
int ocrdma_mbx_create_qp (struct ocrdma_qp *qp, struct ib_qp_init_attr *attrs, u8 enable_dpp_cq, u16 dpp_cq_id, u16 *dpp_offset, u16 *dpp_credit_lmt)
 
int ocrdma_mbx_query_qp (struct ocrdma_dev *dev, struct ocrdma_qp *qp, struct ocrdma_qp_params *param)
 
int ocrdma_resolve_dgid (struct ocrdma_dev *dev, union ib_gid *dgid, u8 *mac_addr)
 
int ocrdma_mbx_modify_qp (struct ocrdma_dev *dev, struct ocrdma_qp *qp, struct ib_qp_attr *attrs, int attr_mask, enum ib_qp_state old_qps)
 
int ocrdma_mbx_destroy_qp (struct ocrdma_dev *dev, struct ocrdma_qp *qp)
 
int ocrdma_mbx_create_srq (struct ocrdma_srq *srq, struct ib_srq_init_attr *srq_attr, struct ocrdma_pd *pd)
 
int ocrdma_mbx_modify_srq (struct ocrdma_srq *srq, struct ib_srq_attr *srq_attr)
 
int ocrdma_mbx_query_srq (struct ocrdma_srq *srq, struct ib_srq_attr *srq_attr)
 
int ocrdma_mbx_destroy_srq (struct ocrdma_dev *dev, struct ocrdma_srq *srq)
 
int ocrdma_alloc_av (struct ocrdma_dev *dev, struct ocrdma_ah *ah)
 
int ocrdma_free_av (struct ocrdma_dev *dev, struct ocrdma_ah *ah)
 
int ocrdma_init_hw (struct ocrdma_dev *dev)
 
void ocrdma_cleanup_hw (struct ocrdma_dev *dev)
 

Enumeration Type Documentation

Enumerator:
OCRDMA_MBX_ADDI_STATUS_INSUFFICIENT_RESOURCES 

Definition at line 83 of file ocrdma_hw.c.

enum cqe_status
Enumerator:
OCRDMA_MBX_CQE_STATUS_INSUFFICIENT_PRIVILEDGES 
OCRDMA_MBX_CQE_STATUS_INVALID_PARAMETER 
OCRDMA_MBX_CQE_STATUS_INSUFFICIENT_RESOURCES 
OCRDMA_MBX_CQE_STATUS_QUEUE_FLUSHING 
OCRDMA_MBX_CQE_STATUS_DMA_FAILED 

Definition at line 87 of file ocrdma_hw.c.

enum mbx_status
Enumerator:
OCRDMA_MBX_STATUS_FAILED 
OCRDMA_MBX_STATUS_ILLEGAL_FIELD 
OCRDMA_MBX_STATUS_OOR 
OCRDMA_MBX_STATUS_INVALID_PD 
OCRDMA_MBX_STATUS_PD_INUSE 
OCRDMA_MBX_STATUS_INVALID_CQ 
OCRDMA_MBX_STATUS_INVALID_QP 
OCRDMA_MBX_STATUS_INVALID_LKEY 
OCRDMA_MBX_STATUS_ORD_EXCEEDS 
OCRDMA_MBX_STATUS_IRD_EXCEEDS 
OCRDMA_MBX_STATUS_SENDQ_WQE_EXCEEDS 
OCRDMA_MBX_STATUS_RECVQ_RQE_EXCEEDS 
OCRDMA_MBX_STATUS_SGE_SEND_EXCEEDS 
OCRDMA_MBX_STATUS_SGE_WRITE_EXCEEDS 
OCRDMA_MBX_STATUS_SGE_RECV_EXCEEDS 
OCRDMA_MBX_STATUS_INVALID_STATE_CHANGE 
OCRDMA_MBX_STATUS_MW_BOUND 
OCRDMA_MBX_STATUS_INVALID_VA 
OCRDMA_MBX_STATUS_INVALID_LENGTH 
OCRDMA_MBX_STATUS_INVALID_FBO 
OCRDMA_MBX_STATUS_INVALID_ACC_RIGHTS 
OCRDMA_MBX_STATUS_INVALID_PBE_SIZE 
OCRDMA_MBX_STATUS_INVALID_PBL_ENTRY 
OCRDMA_MBX_STATUS_INVALID_PBL_SHIFT 
OCRDMA_MBX_STATUS_INVALID_SRQ_ID 
OCRDMA_MBX_STATUS_SRQ_ERROR 
OCRDMA_MBX_STATUS_RQE_EXCEEDS 
OCRDMA_MBX_STATUS_MTU_EXCEEDS 
OCRDMA_MBX_STATUS_MAX_QP_EXCEEDS 
OCRDMA_MBX_STATUS_SRQ_LIMIT_EXCEEDS 
OCRDMA_MBX_STATUS_SRQ_SIZE_UNDERUNS 
OCRDMA_MBX_STATUS_QP_BOUND 
OCRDMA_MBX_STATUS_INVALID_CHANGE 
OCRDMA_MBX_STATUS_ATOMIC_OPS_UNSUP 
OCRDMA_MBX_STATUS_INVALID_RNR_NAK_TIMER 
OCRDMA_MBX_STATUS_MW_STILL_BOUND 
OCRDMA_MBX_STATUS_PKEY_INDEX_INVALID 
OCRDMA_MBX_STATUS_PKEY_INDEX_EXCEEDS 

Definition at line 42 of file ocrdma_hw.c.

Function Documentation

enum ib_qp_state get_ibqp_state ( enum ocrdma_qp_state  qps)

Definition at line 140 of file ocrdma_hw.c.

int ocrdma_alloc_av ( struct ocrdma_dev dev,
struct ocrdma_ah ah 
)

Definition at line 2473 of file ocrdma_hw.c.

void ocrdma_cleanup_hw ( struct ocrdma_dev dev)

Definition at line 2621 of file ocrdma_hw.c.

void ocrdma_flush_qp ( struct ocrdma_qp qp)

Definition at line 1678 of file ocrdma_hw.c.

int ocrdma_free_av ( struct ocrdma_dev dev,
struct ocrdma_ah ah 
)

Definition at line 2498 of file ocrdma_hw.c.

int ocrdma_init_hw ( struct ocrdma_dev dev)

Definition at line 2583 of file ocrdma_hw.c.

bool ocrdma_is_qp_in_rq_flushlist ( struct ocrdma_cq cq,
struct ocrdma_qp qp 
)

Definition at line 1665 of file ocrdma_hw.c.

bool ocrdma_is_qp_in_sq_flushlist ( struct ocrdma_cq cq,
struct ocrdma_qp qp 
)

Definition at line 1652 of file ocrdma_hw.c.

int ocrdma_mbx_alloc_lkey ( struct ocrdma_dev dev,
struct ocrdma_hw_mr hwmr,
u32  pdid,
int  addr_check 
)

Definition at line 1476 of file ocrdma_hw.c.

int ocrdma_mbx_alloc_pd ( struct ocrdma_dev dev,
struct ocrdma_pd pd 
)

Definition at line 1135 of file ocrdma_hw.c.

int ocrdma_mbx_create_cq ( struct ocrdma_dev dev,
struct ocrdma_cq cq,
int  entries,
int  dpp_cq 
)

Definition at line 1344 of file ocrdma_hw.c.

int ocrdma_mbx_create_qp ( struct ocrdma_qp qp,
struct ib_qp_init_attr attrs,
u8  enable_dpp_cq,
u16  dpp_cq_id,
u16 dpp_offset,
u16 dpp_credit_lmt 
)

Definition at line 2000 of file ocrdma_hw.c.

int ocrdma_mbx_create_srq ( struct ocrdma_srq srq,
struct ib_srq_init_attr srq_attr,
struct ocrdma_pd pd 
)

Definition at line 2341 of file ocrdma_hw.c.

int ocrdma_mbx_dealloc_lkey ( struct ocrdma_dev dev,
int  fr_mr,
u32  lkey 
)

Definition at line 1510 of file ocrdma_hw.c.

int ocrdma_mbx_dealloc_pd ( struct ocrdma_dev dev,
struct ocrdma_pd pd 
)

Definition at line 1164 of file ocrdma_hw.c.

int ocrdma_mbx_destroy_cq ( struct ocrdma_dev dev,
struct ocrdma_cq cq 
)

Definition at line 1451 of file ocrdma_hw.c.

int ocrdma_mbx_destroy_qp ( struct ocrdma_dev dev,
struct ocrdma_qp qp 
)

Definition at line 2316 of file ocrdma_hw.c.

int ocrdma_mbx_destroy_srq ( struct ocrdma_dev dev,
struct ocrdma_srq srq 
)

Definition at line 2456 of file ocrdma_hw.c.

int ocrdma_mbx_modify_qp ( struct ocrdma_dev dev,
struct ocrdma_qp qp,
struct ib_qp_attr attrs,
int  attr_mask,
enum ib_qp_state  old_qps 
)

Definition at line 2281 of file ocrdma_hw.c.

int ocrdma_mbx_modify_srq ( struct ocrdma_srq srq,
struct ib_srq_attr srq_attr 
)

Definition at line 2417 of file ocrdma_hw.c.

int ocrdma_mbx_query_qp ( struct ocrdma_dev dev,
struct ocrdma_qp qp,
struct ocrdma_qp_params param 
)

Definition at line 2098 of file ocrdma_hw.c.

int ocrdma_mbx_query_srq ( struct ocrdma_srq srq,
struct ib_srq_attr srq_attr 
)

Definition at line 2432 of file ocrdma_hw.c.

int ocrdma_qp_state_machine ( struct ocrdma_qp qp,
enum ib_qp_state  new_ib_state,
enum ib_qp_state old_ib_state 
)

Definition at line 1695 of file ocrdma_hw.c.

int ocrdma_reg_mr ( struct ocrdma_dev dev,
struct ocrdma_hw_mr hwmr,
u32  pdid,
int  acc 
)

Definition at line 1608 of file ocrdma_hw.c.

int ocrdma_resolve_dgid ( struct ocrdma_dev dev,
union ib_gid dgid,
u8 mac_addr 
)

Definition at line 2119 of file ocrdma_hw.c.

void ocrdma_ring_cq_db ( struct ocrdma_dev dev,
u16  cq_id,
bool  armed,
bool  solicited,
u16  cqe_popped 
)

Definition at line 273 of file ocrdma_hw.c.