summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorDennis Dalessandro <dennis.dalessandro@intel.com>2016-01-06 10:01:17 -0800
committerDoug Ledford <dledford@redhat.com>2016-03-10 20:37:10 -0500
commit8cf4020b2ad0d19f74fed043b882da1b79f52566 (patch)
tree03de479d5faa339a0a0c346c6a3d35cc7bcd6b79 /drivers
parentcf16335a0ccf5adda3d4bad932a7e012891709c5 (diff)
downloadlinux-8cf4020b2ad0d19f74fed043b882da1b79f52566.tar.gz
IB/rdmavt: Add post send and recv stubs
This adds the post sned and recv function stubs. Reviewed-by: Mike Marciniszyn <mike.marciniszyn@intel.com> Reviewed-by: Ira Weiny <ira.weiny@intel.com> Signed-off-by: Dennis Dalessandro <dennis.dalessandro@intel.com> Signed-off-by: Doug Ledford <dledford@redhat.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/infiniband/sw/rdmavt/qp.c62
-rw-r--r--drivers/infiniband/sw/rdmavt/qp.h7
-rw-r--r--drivers/infiniband/sw/rdmavt/vt.c3
3 files changed, 71 insertions, 1 deletions
diff --git a/drivers/infiniband/sw/rdmavt/qp.c b/drivers/infiniband/sw/rdmavt/qp.c
index a59f28d16143..23a5f686e211 100644
--- a/drivers/infiniband/sw/rdmavt/qp.c
+++ b/drivers/infiniband/sw/rdmavt/qp.c
@@ -118,3 +118,65 @@ int rvt_query_qp(struct ib_qp *ibqp, struct ib_qp_attr *attr,
{
return -EOPNOTSUPP;
}
+
+/**
+ * rvt_post_receive - post a receive on a QP
+ * @ibqp: the QP to post the receive on
+ * @wr: the WR to post
+ * @bad_wr: the first bad WR is put here
+ *
+ * This may be called from interrupt context.
+ */
+int rvt_post_recv(struct ib_qp *ibqp, struct ib_recv_wr *wr,
+ struct ib_recv_wr **bad_wr)
+{
+ /*
+ * When a packet arrives the driver needs to call up to rvt to process
+ * the packet. The UD, RC, UC processing will be done in rvt, however
+ * the driver should be able to override this if it so choses. Perhaps a
+ * set of function pointers set up at registration time.
+ */
+
+ return -EOPNOTSUPP;
+}
+
+/**
+ * rvt_post_send - post a send on a QP
+ * @ibqp: the QP to post the send on
+ * @wr: the list of work requests to post
+ * @bad_wr: the first bad WR is put here
+ *
+ * This may be called from interrupt context.
+ */
+int rvt_post_send(struct ib_qp *ibqp, struct ib_send_wr *wr,
+ struct ib_send_wr **bad_wr)
+{
+ /*
+ * VT-DRIVER-API: do_send()
+ * Driver needs to have a do_send() call which is a single entry point
+ * to take an already formed packet and throw it out on the wire. Once
+ * the packet is sent the driver needs to make an upcall to rvt so the
+ * completion queue can be notified and/or any other outstanding
+ * work/book keeping can be finished.
+ *
+ * Note that there should also be a way for rvt to protect itself
+ * against hangs in the driver layer. If a send doesn't actually
+ * complete in a timely manor rvt needs to return an error event.
+ */
+
+ return -EOPNOTSUPP;
+}
+
+/**
+ * rvt_post_srq_receive - post a receive on a shared receive queue
+ * @ibsrq: the SRQ to post the receive on
+ * @wr: the list of work requests to post
+ * @bad_wr: A pointer to the first WR to cause a problem is put here
+ *
+ * This may be called from interrupt context.
+ */
+int rvt_post_srq_recv(struct ib_srq *ibsrq, struct ib_recv_wr *wr,
+ struct ib_recv_wr **bad_wr)
+{
+ return -EOPNOTSUPP;
+}
diff --git a/drivers/infiniband/sw/rdmavt/qp.h b/drivers/infiniband/sw/rdmavt/qp.h
index 43acba0ebf5d..10bc636d0423 100644
--- a/drivers/infiniband/sw/rdmavt/qp.h
+++ b/drivers/infiniband/sw/rdmavt/qp.h
@@ -63,5 +63,10 @@ int rvt_modify_qp(struct ib_qp *ibqp, struct ib_qp_attr *attr,
int rvt_destroy_qp(struct ib_qp *ibqp);
int rvt_query_qp(struct ib_qp *ibqp, struct ib_qp_attr *attr,
int attr_mask, struct ib_qp_init_attr *init_attr);
-
+int rvt_post_recv(struct ib_qp *ibqp, struct ib_recv_wr *wr,
+ struct ib_recv_wr **bad_wr);
+int rvt_post_send(struct ib_qp *ibqp, struct ib_send_wr *wr,
+ struct ib_send_wr **bad_wr);
+int rvt_post_srq_recv(struct ib_srq *ibsrq, struct ib_recv_wr *wr,
+ struct ib_recv_wr **bad_wr);
#endif /* DEF_RVTQP_H */
diff --git a/drivers/infiniband/sw/rdmavt/vt.c b/drivers/infiniband/sw/rdmavt/vt.c
index 7fd879f34725..367bc45e06e7 100644
--- a/drivers/infiniband/sw/rdmavt/vt.c
+++ b/drivers/infiniband/sw/rdmavt/vt.c
@@ -232,6 +232,9 @@ int rvt_register_device(struct rvt_dev_info *rdi)
CHECK_DRIVER_OVERRIDE(rdi, modify_qp);
CHECK_DRIVER_OVERRIDE(rdi, destroy_qp);
CHECK_DRIVER_OVERRIDE(rdi, query_qp);
+ CHECK_DRIVER_OVERRIDE(rdi, post_send);
+ CHECK_DRIVER_OVERRIDE(rdi, post_recv);
+ CHECK_DRIVER_OVERRIDE(rdi, post_srq_recv);
/* Address Handle */
CHECK_DRIVER_OVERRIDE(rdi, create_ah);