[openib-general] [PATCH] RFC libibverbs - Pass provider data through ibv_cmd_req_notify_cq()
Steve Wise
swise at opengridcomputing.com
Fri Oct 6 15:29:34 PDT 2006
Roland,
Here is another change I need to support kernel bypass in the driver I'm
working on. For this device, the req_notify_cq() operation cannot be
bypassed. Further, the lib needs to pass some info down to the kernel
verb to correctly implement re-arm.
This patch enables passing provider-specific data down to the kernel
verb. A kernel patch is also needed, that I will submit as a separate
RFC patch. There are no dependencies build-wise between the user and
kernel patches by the way. You just will need both patches to get
provider data passed down to your kernel verb.
Comments?
Steve.
-------------------------
Pass provider-specific data down in ibv_cmd_req_notify_cq().
From: Steve Wise <swise at opengridcomputing.com>
The Chelsio iwarp provider library needs to pass information to the
kernel verb for re-arming the CQ.
Signed-off-by: Steve Wise <swise at opengridcomputing.com>
---
libibverbs/include/infiniband/driver.h | 5 ++++-
libibverbs/src/cmd.c | 12 ++++++------
2 files changed, 10 insertions(+), 7 deletions(-)
diff --git a/libibverbs/include/infiniband/driver.h b/libibverbs/include/infiniband/driver.h
index 45bd1b0..279485b 100644
--- a/libibverbs/include/infiniband/driver.h
+++ b/libibverbs/include/infiniband/driver.h
@@ -95,7 +95,10 @@ int ibv_cmd_create_cq(struct ibv_context
struct ibv_create_cq *cmd, size_t cmd_size,
struct ibv_create_cq_resp *resp, size_t resp_size);
int ibv_cmd_poll_cq(struct ibv_cq *cq, int ne, struct ibv_wc *wc);
-int ibv_cmd_req_notify_cq(struct ibv_cq *cq, int solicited_only);
+#define IBV_CMD_REQ_NOTIFY_HAS_CMD_DATA
+int ibv_cmd_req_notify_cq(struct ibv_cq *cq, int solicited_only,
+ struct ibv_req_notify_cq *cmd, size_t cmd_size);
+
#define IBV_CMD_RESIZE_CQ_HAS_RESP_PARAMS
int ibv_cmd_resize_cq(struct ibv_cq *cq, int cqe,
struct ibv_resize_cq *cmd, size_t cmd_size,
diff --git a/libibverbs/src/cmd.c b/libibverbs/src/cmd.c
index 8dbdfe8..15eccdc 100644
--- a/libibverbs/src/cmd.c
+++ b/libibverbs/src/cmd.c
@@ -372,15 +372,15 @@ out:
return ret;
}
-int ibv_cmd_req_notify_cq(struct ibv_cq *ibcq, int solicited_only)
+int ibv_cmd_req_notify_cq(struct ibv_cq *ibcq, int solicited_only,
+ struct ibv_req_notify_cq *cmd, size_t cmd_size)
{
- struct ibv_req_notify_cq cmd;
- IBV_INIT_CMD(&cmd, sizeof cmd, REQ_NOTIFY_CQ);
- cmd.cq_handle = ibcq->handle;
- cmd.solicited = !!solicited_only;
+ IBV_INIT_CMD(cmd, cmd_size, REQ_NOTIFY_CQ);
+ cmd->cq_handle = ibcq->handle;
+ cmd->solicited = !!solicited_only;
- if (write(ibcq->context->cmd_fd, &cmd, sizeof cmd) != sizeof cmd)
+ if (write(ibcq->context->cmd_fd, cmd, cmd_size) != cmd_size)
return errno;
return 0;
More information about the general
mailing list