#include <linux/kref.h>
#include <rdma/ib_umem.h>
#include <rdma/ib_user_verbs.h>
#include <rdma/ib_cache.h>
#include "mlx5_ib.h"
#include "srq.h"
#include "qp.h"
#define UVERBS_MODULE_NAME …
#include <rdma/uverbs_named_ioctl.h>
static void mlx5_ib_cq_comp(struct mlx5_core_cq *cq, struct mlx5_eqe *eqe)
{ … }
static void mlx5_ib_cq_event(struct mlx5_core_cq *mcq, enum mlx5_event type)
{ … }
static void *get_cqe(struct mlx5_ib_cq *cq, int n)
{ … }
static u8 sw_ownership_bit(int n, int nent)
{ … }
static void *get_sw_cqe(struct mlx5_ib_cq *cq, int n)
{ … }
static void *next_cqe_sw(struct mlx5_ib_cq *cq)
{ … }
static enum ib_wc_opcode get_umr_comp(struct mlx5_ib_wq *wq, int idx)
{ … }
static void handle_good_req(struct ib_wc *wc, struct mlx5_cqe64 *cqe,
struct mlx5_ib_wq *wq, int idx)
{ … }
enum { … };
static void handle_responder(struct ib_wc *wc, struct mlx5_cqe64 *cqe,
struct mlx5_ib_qp *qp)
{ … }
static void dump_cqe(struct mlx5_ib_dev *dev, struct mlx5_err_cqe *cqe,
struct ib_wc *wc, const char *level)
{ … }
static void mlx5_handle_error_cqe(struct mlx5_ib_dev *dev,
struct mlx5_err_cqe *cqe,
struct ib_wc *wc)
{ … }
static void handle_atomics(struct mlx5_ib_qp *qp, struct mlx5_cqe64 *cqe64,
u16 tail, u16 head)
{ … }
static void free_cq_buf(struct mlx5_ib_dev *dev, struct mlx5_ib_cq_buf *buf)
{ … }
static void get_sig_err_item(struct mlx5_sig_err_cqe *cqe,
struct ib_sig_err *item)
{ … }
static void sw_comp(struct mlx5_ib_qp *qp, int num_entries, struct ib_wc *wc,
int *npolled, bool is_send)
{ … }
static void mlx5_ib_poll_sw_comp(struct mlx5_ib_cq *cq, int num_entries,
struct ib_wc *wc, int *npolled)
{ … }
static int mlx5_poll_one(struct mlx5_ib_cq *cq,
struct mlx5_ib_qp **cur_qp,
struct ib_wc *wc)
{ … }
static int poll_soft_wc(struct mlx5_ib_cq *cq, int num_entries,
struct ib_wc *wc, bool is_fatal_err)
{ … }
int mlx5_ib_poll_cq(struct ib_cq *ibcq, int num_entries, struct ib_wc *wc)
{ … }
int mlx5_ib_arm_cq(struct ib_cq *ibcq, enum ib_cq_notify_flags flags)
{ … }
static int alloc_cq_frag_buf(struct mlx5_ib_dev *dev,
struct mlx5_ib_cq_buf *buf,
int nent,
int cqe_size)
{ … }
enum { … };
static int mini_cqe_res_format_to_hw(struct mlx5_ib_dev *dev, u8 format)
{ … }
static int create_cq_user(struct mlx5_ib_dev *dev, struct ib_udata *udata,
struct mlx5_ib_cq *cq, int entries, u32 **cqb,
int *cqe_size, int *index, int *inlen,
struct uverbs_attr_bundle *attrs)
{ … }
static void destroy_cq_user(struct mlx5_ib_cq *cq, struct ib_udata *udata)
{ … }
static void init_cq_frag_buf(struct mlx5_ib_cq_buf *buf)
{ … }
static int create_cq_kernel(struct mlx5_ib_dev *dev, struct mlx5_ib_cq *cq,
int entries, int cqe_size,
u32 **cqb, int *index, int *inlen)
{ … }
static void destroy_cq_kernel(struct mlx5_ib_dev *dev, struct mlx5_ib_cq *cq)
{ … }
static void notify_soft_wc_handler(struct work_struct *work)
{ … }
int mlx5_ib_create_cq(struct ib_cq *ibcq, const struct ib_cq_init_attr *attr,
struct uverbs_attr_bundle *attrs)
{ … }
int mlx5_ib_destroy_cq(struct ib_cq *cq, struct ib_udata *udata)
{ … }
static int is_equal_rsn(struct mlx5_cqe64 *cqe64, u32 rsn)
{ … }
void __mlx5_ib_cq_clean(struct mlx5_ib_cq *cq, u32 rsn, struct mlx5_ib_srq *srq)
{ … }
void mlx5_ib_cq_clean(struct mlx5_ib_cq *cq, u32 qpn, struct mlx5_ib_srq *srq)
{ … }
int mlx5_ib_modify_cq(struct ib_cq *cq, u16 cq_count, u16 cq_period)
{ … }
static int resize_user(struct mlx5_ib_dev *dev, struct mlx5_ib_cq *cq,
int entries, struct ib_udata *udata,
int *cqe_size)
{ … }
static int resize_kernel(struct mlx5_ib_dev *dev, struct mlx5_ib_cq *cq,
int entries, int cqe_size)
{ … }
static int copy_resize_cqes(struct mlx5_ib_cq *cq)
{ … }
int mlx5_ib_resize_cq(struct ib_cq *ibcq, int entries, struct ib_udata *udata)
{ … }
int mlx5_ib_get_cqe_size(struct ib_cq *ibcq)
{ … }
int mlx5_ib_generate_wc(struct ib_cq *ibcq, struct ib_wc *wc)
{ … }
ADD_UVERBS_ATTRIBUTES_SIMPLE(
mlx5_ib_cq_create,
UVERBS_OBJECT_CQ,
UVERBS_METHOD_CQ_CREATE,
UVERBS_ATTR_PTR_IN(
MLX5_IB_ATTR_CREATE_CQ_UAR_INDEX,
UVERBS_ATTR_TYPE(u32),
UA_OPTIONAL));
const struct uapi_definition mlx5_ib_create_cq_defs[] = …;