linux/drivers/infiniband/sw/rxe/rxe_verbs.c

// SPDX-License-Identifier: GPL-2.0 OR Linux-OpenIB
/*
 * Copyright (c) 2016 Mellanox Technologies Ltd. All rights reserved.
 * Copyright (c) 2015 System Fabric Works, Inc. All rights reserved.
 */

#include <linux/dma-mapping.h>
#include <net/addrconf.h>
#include <rdma/uverbs_ioctl.h>

#include "rxe.h"
#include "rxe_queue.h"
#include "rxe_hw_counters.h"

static int post_one_recv(struct rxe_rq *rq, const struct ib_recv_wr *ibwr);

/* dev */
static int rxe_query_device(struct ib_device *ibdev,
			    struct ib_device_attr *attr,
			    struct ib_udata *udata)
{}

static int rxe_query_port(struct ib_device *ibdev,
			  u32 port_num, struct ib_port_attr *attr)
{}

static int rxe_query_pkey(struct ib_device *ibdev,
			  u32 port_num, u16 index, u16 *pkey)
{}

static int rxe_modify_device(struct ib_device *ibdev,
			     int mask, struct ib_device_modify *attr)
{}

static int rxe_modify_port(struct ib_device *ibdev, u32 port_num,
			   int mask, struct ib_port_modify *attr)
{}

static enum rdma_link_layer rxe_get_link_layer(struct ib_device *ibdev,
					       u32 port_num)
{}

static int rxe_port_immutable(struct ib_device *ibdev, u32 port_num,
			      struct ib_port_immutable *immutable)
{}

/* uc */
static int rxe_alloc_ucontext(struct ib_ucontext *ibuc, struct ib_udata *udata)
{}

static void rxe_dealloc_ucontext(struct ib_ucontext *ibuc)
{}

/* pd */
static int rxe_alloc_pd(struct ib_pd *ibpd, struct ib_udata *udata)
{}

static int rxe_dealloc_pd(struct ib_pd *ibpd, struct ib_udata *udata)
{}

/* ah */
static int rxe_create_ah(struct ib_ah *ibah,
			 struct rdma_ah_init_attr *init_attr,
			 struct ib_udata *udata)
{}

static int rxe_modify_ah(struct ib_ah *ibah, struct rdma_ah_attr *attr)
{}

static int rxe_query_ah(struct ib_ah *ibah, struct rdma_ah_attr *attr)
{}

static int rxe_destroy_ah(struct ib_ah *ibah, u32 flags)
{}

/* srq */
static int rxe_create_srq(struct ib_srq *ibsrq, struct ib_srq_init_attr *init,
			  struct ib_udata *udata)
{}

static int rxe_modify_srq(struct ib_srq *ibsrq, struct ib_srq_attr *attr,
			  enum ib_srq_attr_mask mask,
			  struct ib_udata *udata)
{}

static int rxe_query_srq(struct ib_srq *ibsrq, struct ib_srq_attr *attr)
{}

static int rxe_post_srq_recv(struct ib_srq *ibsrq, const struct ib_recv_wr *wr,
			     const struct ib_recv_wr **bad_wr)
{}

static int rxe_destroy_srq(struct ib_srq *ibsrq, struct ib_udata *udata)
{}

/* qp */
static int rxe_create_qp(struct ib_qp *ibqp, struct ib_qp_init_attr *init,
			 struct ib_udata *udata)
{}

static int rxe_modify_qp(struct ib_qp *ibqp, struct ib_qp_attr *attr,
			 int mask, struct ib_udata *udata)
{}

static int rxe_query_qp(struct ib_qp *ibqp, struct ib_qp_attr *attr,
			int mask, struct ib_qp_init_attr *init)
{}

static int rxe_destroy_qp(struct ib_qp *ibqp, struct ib_udata *udata)
{}

/* send wr */

/* sanity check incoming send work request */
static int validate_send_wr(struct rxe_qp *qp, const struct ib_send_wr *ibwr,
			    unsigned int *maskp, unsigned int *lengthp)
{}

static int init_send_wr(struct rxe_qp *qp, struct rxe_send_wr *wr,
			 const struct ib_send_wr *ibwr)
{}

static void copy_inline_data_to_wqe(struct rxe_send_wqe *wqe,
				    const struct ib_send_wr *ibwr)
{}

static int init_send_wqe(struct rxe_qp *qp, const struct ib_send_wr *ibwr,
			 unsigned int mask, unsigned int length,
			 struct rxe_send_wqe *wqe)
{}

static int post_one_send(struct rxe_qp *qp, const struct ib_send_wr *ibwr)
{}

static int rxe_post_send_kernel(struct rxe_qp *qp,
				const struct ib_send_wr *ibwr,
				const struct ib_send_wr **bad_wr)
{}

static int rxe_post_send(struct ib_qp *ibqp, const struct ib_send_wr *wr,
			 const struct ib_send_wr **bad_wr)
{}

/* recv wr */
static int post_one_recv(struct rxe_rq *rq, const struct ib_recv_wr *ibwr)
{}

static int rxe_post_recv(struct ib_qp *ibqp, const struct ib_recv_wr *wr,
			 const struct ib_recv_wr **bad_wr)
{}

/* cq */
static int rxe_create_cq(struct ib_cq *ibcq, const struct ib_cq_init_attr *attr,
			 struct uverbs_attr_bundle *attrs)
{}

static int rxe_resize_cq(struct ib_cq *ibcq, int cqe, struct ib_udata *udata)
{}

static int rxe_poll_cq(struct ib_cq *ibcq, int num_entries, struct ib_wc *wc)
{}

static int rxe_peek_cq(struct ib_cq *ibcq, int wc_cnt)
{}

static int rxe_req_notify_cq(struct ib_cq *ibcq, enum ib_cq_notify_flags flags)
{}

static int rxe_destroy_cq(struct ib_cq *ibcq, struct ib_udata *udata)
{}

/* mr */
static struct ib_mr *rxe_get_dma_mr(struct ib_pd *ibpd, int access)
{}

static struct ib_mr *rxe_reg_user_mr(struct ib_pd *ibpd, u64 start,
				     u64 length, u64 iova, int access,
				     struct ib_udata *udata)
{}

static struct ib_mr *rxe_rereg_user_mr(struct ib_mr *ibmr, int flags,
				       u64 start, u64 length, u64 iova,
				       int access, struct ib_pd *ibpd,
				       struct ib_udata *udata)
{}

static struct ib_mr *rxe_alloc_mr(struct ib_pd *ibpd, enum ib_mr_type mr_type,
				  u32 max_num_sg)
{}

static int rxe_dereg_mr(struct ib_mr *ibmr, struct ib_udata *udata)
{}

static ssize_t parent_show(struct device *device,
			   struct device_attribute *attr, char *buf)
{}

static DEVICE_ATTR_RO(parent);

static struct attribute *rxe_dev_attributes[] =;

static const struct attribute_group rxe_attr_group =;

static int rxe_enable_driver(struct ib_device *ib_dev)
{}

static const struct ib_device_ops rxe_dev_ops =;

int rxe_register_device(struct rxe_dev *rxe, const char *ibdev_name)
{}