[ofw] [PATCH 5/7] uvp/interface: add support for reporting QP context in WCs
Sean Hefty
sean.hefty at intel.com
Thu May 15 17:48:03 PDT 2008
Extend the uvp_interface to include support for reporting the QP context in
work completions. The required changes are to allow specifying a qp_context
in the pre_create_qp() IOCTL call, and reporting the qp_context through the
work completion structure.
Signed-off-by: Sean Hefty <sean.hefty at intel.com>
---
I added a new call to avoid changes to the existing ULPs.
diff -up -r -X trunk\docs\dontdiff.txt -I '\$Id:' trunk/hw/mlx4/user/hca/verbs.c
branches\winverbs/hw/mlx4/user/hca/verbs.c
--- trunk/hw/mlx4/user/hca/verbs.c 2008-05-05 10:16:33.639000000 -0700
+++ branches\winverbs/hw/mlx4/user/hca/verbs.c 2008-05-06 00:53:02.781250000 -0700
@@ -852,6 +852,25 @@ end:
}
ib_api_status_t
+mlx4_wv_pre_create_qp (
+ IN const ib_pd_handle_t h_uvp_pd,
+ IN const uvp_qp_create_t *p_create_attr,
+ IN OUT ci_umv_buf_t *p_umv_buf,
+ OUT ib_qp_handle_t *ph_uvp_qp )
+{
+ struct mlx4_qp *qp;
+ ib_api_status_t status;
+
+ status = mlx4_pre_create_qp(h_uvp_pd, &p_create_attr->qp_create,
+ p_umv_buf, ph_uvp_qp);
+ if (status == IB_SUCCESS) {
+ qp = (struct mlx4_qp *)*ph_uvp_qp;
+ qp->ibv_qp.context = p_create_attr->context;
+ }
+ return status;
+}
+
+ib_api_status_t
mlx4_post_create_qp (
IN const ib_pd_handle_t h_uvp_pd,
IN ib_api_status_t ioctl_status,
diff -up -r -X trunk\docs\dontdiff.txt -I '\$Id:' trunk/hw/mlx4/user/hca/mlx4.c
branches\winverbs/hw/mlx4/user/hca/mlx4.c
--- trunk/hw/mlx4/user/hca/mlx4.c 2008-05-05 10:16:33.670250000 -0700
+++ branches\winverbs/hw/mlx4/user/hca/mlx4.c 2008-05-09 12:00:19.636721300 -0700
@@ -227,11 +207,8 @@ uvp_get_interface (
p_uvp->pre_destroy_srq = NULL;
p_uvp->post_destroy_srq = mlx4_post_destroy_srq;
-
- /*
- * QP Management Verbs
- */
p_uvp->pre_create_qp = mlx4_pre_create_qp;
+ p_uvp->wv_pre_create_qp = mlx4_wv_pre_create_qp;
p_uvp->post_create_qp = mlx4_post_create_qp;
p_uvp->pre_modify_qp = mlx4_pre_modify_qp;
p_uvp->post_modify_qp = mlx4_post_modify_qp;
diff -up -r -X trunk\docs\dontdiff.txt -I '\$Id:' trunk/hw/mlx4/user/hca/verbs.h
branches\winverbs/hw/mlx4/user/hca/verbs.h
--- trunk/hw/mlx4/user/hca/verbs.h 2008-05-05 10:16:33.764000000 -0700
+++ branches\winverbs/hw/mlx4/user/hca/verbs.h 2008-05-06 00:53:02.687500000 -0700
@@ -327,6 +327,13 @@ mlx4_pre_create_qp (
OUT ib_qp_handle_t *ph_uvp_qp );
ib_api_status_t
+mlx4_wv_pre_create_qp (
+ IN const ib_pd_handle_t h_uvp_pd,
+ IN const uvp_qp_create_t *p_create_attr,
+ IN OUT ci_umv_buf_t *p_umv_buf,
+ OUT ib_qp_handle_t *ph_uvp_qp );
+
+ib_api_status_t
mlx4_post_create_qp (
IN const ib_pd_handle_t h_uvp_pd,
IN ib_api_status_t ioctl_status,
diff -up -r -X trunk\docs\dontdiff.txt -I '\$Id:' trunk/hw/mthca/user/mlnx_ual_qp.c
branches\winverbs/hw/mthca/user/mlnx_ual_qp.c
--- trunk/hw/mthca/user/mlnx_ual_qp.c 2008-05-05 09:47:16.295250000 -0700
+++ branches\winverbs/hw/mthca/user/mlnx_ual_qp.c 2008-05-13 19:39:18.382375000 -0700
@@ -149,6 +149,25 @@ end:
}
static ib_api_status_t
+__wv_pre_create_qp (
+ IN const ib_pd_handle_t h_uvp_pd,
+ IN const uvp_qp_create_t *p_create_attr,
+ IN OUT ci_umv_buf_t *p_umv_buf,
+ OUT ib_qp_handle_t *ph_uvp_qp)
+{
+ struct ibv_qp *qp;
+ ib_api_status_t status;
+
+ status = __pre_create_qp(h_uvp_pd, &p_create_attr->qp_create,
+ p_umv_buf, ph_uvp_qp);
+ if (status == IB_SUCCESS) {
+ qp = (struct ibv_qp *) *ph_uvp_qp;
+ qp->context = p_create_attr->context;
+ }
+ return status;
+}
+
+static ib_api_status_t
__post_create_qp (
IN const ib_pd_handle_t FUNC_PTR64 h_uvp_pd,
IN ib_api_status_t ioctl_status,
@@ -363,8 +379,10 @@ mlnx_get_qp_interface (
p_uvp->post_query_qp = __post_query_qp;
p_uvp->pre_destroy_qp = __pre_destroy_qp;
p_uvp->post_destroy_qp = __post_destroy_qp;
+
p_uvp->nd_modify_qp = __nd_modify_qp;
- p_uvp->nd_get_qp_state = __nd_get_qp_state;
+ p_uvp->nd_get_qp_state = __nd_get_qp_state;
+ p_uvp->wv_pre_create_qp = __wv_pre_create_qp;
UVP_EXIT(UVP_DBG_SHIM);
}
diff -up -r -X trunk\docs\dontdiff.txt -I '\$Id:' trunk/inc/user/iba/ib_uvp.h branches\winverbs/inc/user/iba/ib_uvp.h
--- trunk/inc/user/iba/ib_uvp.h 2008-05-05 09:47:14.717125000 -0700
+++ branches\winverbs/inc/user/iba/ib_uvp.h 2008-05-13 19:39:18.444875000 -0700
@@ -36,6 +36,7 @@
#include <complib/cl_types.h>
#include <iba/ib_types.h>
#include <iba/ib_ci.h>
+#include <initguid.h>
/****h* UAL_UVP_Interface/user-mode Verbs
* NAME
@@ -1581,6 +1582,24 @@ typedef ib_api_status_t
*
********/
+typedef struct _uvp_qp_create
+{
+ ib_qp_create_t qp_create;
+
+ void *context;
+ uint32_t max_inline_send;
+ uint32_t initiator_depth;
+ uint32_t responder_resources;
+
+} uvp_qp_create_t;
+
+typedef ib_api_status_t
+(AL_API *uvp_wv_pre_create_qp) (
+ IN const ib_pd_handle_t h_uvp_pd,
+ IN const uvp_qp_create_t *p_create_attr,
+ IN OUT ci_umv_buf_t *p_umv_buf,
+ OUT ib_qp_handle_t *ph_uvp_qp);
+
/********/
/****f* user-mode Verbs/uvp_post_create_qp_t
@@ -3435,7 +3441,8 @@ typedef struct _uvp_interface
*/
uvp_nd_modify_qp_t nd_modify_qp;
uvp_nd_get_qp_state_t nd_get_qp_state;
-
+ uvp_wv_pre_create_qp wv_pre_create_qp;
+
} uvp_interface_t;
/********/
More information about the ofw
mailing list