#include <linux/init.h>
#include <linux/slab.h>
#include <linux/errno.h>
#include <rdma/ib_user_verbs.h>
#include <rdma/ib_addr.h>
#include <rdma/uverbs_ioctl.h>
#include "usnic_abi.h"
#include "usnic_ib.h"
#include "usnic_common_util.h"
#include "usnic_ib_qp_grp.h"
#include "usnic_ib_verbs.h"
#include "usnic_fwd.h"
#include "usnic_log.h"
#include "usnic_uiom.h"
#include "usnic_transport.h"
#define USNIC_DEFAULT_TRANSPORT …
const struct usnic_vnic_res_spec min_transport_spec[USNIC_TRANSPORT_MAX] = …;
static void usnic_ib_fw_string_to_u64(char *fw_ver_str, u64 *fw_ver)
{ … }
static int usnic_ib_fill_create_qp_resp(struct usnic_ib_qp_grp *qp_grp,
struct ib_udata *udata)
{ … }
static int
find_free_vf_and_create_qp_grp(struct ib_qp *qp,
struct usnic_transport_spec *trans_spec,
struct usnic_vnic_res_spec *res_spec)
{ … }
static void qp_grp_destroy(struct usnic_ib_qp_grp *qp_grp)
{ … }
static int create_qp_validate_user_data(struct usnic_ib_create_qp_cmd cmd)
{ … }
enum rdma_link_layer usnic_ib_port_link_layer(struct ib_device *device,
u32 port_num)
{ … }
int usnic_ib_query_device(struct ib_device *ibdev,
struct ib_device_attr *props,
struct ib_udata *uhw)
{ … }
int usnic_ib_query_port(struct ib_device *ibdev, u32 port,
struct ib_port_attr *props)
{ … }
int usnic_ib_query_qp(struct ib_qp *qp, struct ib_qp_attr *qp_attr,
int qp_attr_mask,
struct ib_qp_init_attr *qp_init_attr)
{ … }
int usnic_ib_query_gid(struct ib_device *ibdev, u32 port, int index,
union ib_gid *gid)
{ … }
int usnic_ib_alloc_pd(struct ib_pd *ibpd, struct ib_udata *udata)
{ … }
int usnic_ib_dealloc_pd(struct ib_pd *pd, struct ib_udata *udata)
{ … }
int usnic_ib_create_qp(struct ib_qp *ibqp, struct ib_qp_init_attr *init_attr,
struct ib_udata *udata)
{ … }
int usnic_ib_destroy_qp(struct ib_qp *qp, struct ib_udata *udata)
{ … }
int usnic_ib_modify_qp(struct ib_qp *ibqp, struct ib_qp_attr *attr,
int attr_mask, struct ib_udata *udata)
{ … }
int usnic_ib_create_cq(struct ib_cq *ibcq, const struct ib_cq_init_attr *attr,
struct uverbs_attr_bundle *attrs)
{ … }
int usnic_ib_destroy_cq(struct ib_cq *cq, struct ib_udata *udata)
{ … }
struct ib_mr *usnic_ib_reg_mr(struct ib_pd *pd, u64 start, u64 length,
u64 virt_addr, int access_flags,
struct ib_udata *udata)
{ … }
int usnic_ib_dereg_mr(struct ib_mr *ibmr, struct ib_udata *udata)
{ … }
int usnic_ib_alloc_ucontext(struct ib_ucontext *uctx, struct ib_udata *udata)
{ … }
void usnic_ib_dealloc_ucontext(struct ib_ucontext *ibcontext)
{ … }
int usnic_ib_mmap(struct ib_ucontext *context,
struct vm_area_struct *vma)
{ … }