From: ftillier Date: Fri, 2 Sep 2005 21:36:42 +0000 (+0000) Subject: Make address vectors work in user-mode. Components affected are UAL and UVP. X-Git-Url: https://openfabrics.org/gitweb/?a=commitdiff_plain;h=f2e067a3aafe2789fe42df304576e5c785b7da3d;p=~shefty%2Frdma-win.git Make address vectors work in user-mode. Components affected are UAL and UVP. git-svn-id: svn://openib.tc.cornell.edu/gen1@56 ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86 --- diff --git a/trunk/core/al/user/ual_ca.c b/trunk/core/al/user/ual_ca.c index c3f08016..e1648dd0 100644 --- a/trunk/core/al/user/ual_ca.c +++ b/trunk/core/al/user/ual_ca.c @@ -271,17 +271,13 @@ ual_query_ca( if( h_ca->obj.p_ci_ca->h_ci_ca && uvp_intf.pre_query_ca ) { /* Pre call to the UVP library */ - status = uvp_intf.pre_query_ca( - h_ca->obj.p_ci_ca->h_ci_ca, &ca_ioctl ); + status = uvp_intf.pre_query_ca( h_ca->obj.p_ci_ca->h_ci_ca, + p_ca_attr, *p_size, &ca_ioctl.in.umv_buf ); if( status != IB_SUCCESS ) { - if (ca_ioctl.out.status == IB_INSUFFICIENT_MEMORY ) - { - *p_size = ca_ioctl.out.byte_cnt; - } - AL_EXIT( AL_DBG_CA ); - return status; + AL_EXIT( AL_DBG_CA ); + return status; } } diff --git a/trunk/hw/mt23108/user/SOURCES b/trunk/hw/mt23108/user/SOURCES index ed2b3d3c..4740ea9c 100644 --- a/trunk/hw/mt23108/user/SOURCES +++ b/trunk/hw/mt23108/user/SOURCES @@ -14,7 +14,6 @@ SOURCES= \ mlnx_ual_av.c \ mlnx_ual_ca.c \ mlnx_ual_cq.c \ - mlnx_ual_errh.c \ mlnx_ual_main.c \ mlnx_ual_mcast.c \ mlnx_ual_mrw.c \ diff --git a/trunk/hw/mt23108/user/hca_data.h b/trunk/hw/mt23108/user/hca_data.h new file mode 100644 index 00000000..9efcea1c --- /dev/null +++ b/trunk/hw/mt23108/user/hca_data.h @@ -0,0 +1,98 @@ +/* + * Copyright (c) 2005 SilverStorm Technologies. All rights reserved. + * + * This software is available to you under the OpenIB.org BSD license + * below: + * + * Redistribution and use in source and binary forms, with or + * without modification, are permitted provided that the following + * conditions are met: + * + * - Redistributions of source code must retain the above + * copyright notice, this list of conditions and the following + * disclaimer. + * + * - Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS + * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * $Id$ + */ + +#include +#include + + +typedef struct _ib_ca +{ + HH_hca_dev_t *p_hca_ul_info; + void *p_hca_ul_resources; + ib_ca_attr_t *p_hca_attr; + HHUL_hca_hndl_t hhul_hca_hndl; + u_int32_t priv_op; + void *p_al_ci_ca; + +} mlnx_ual_hobul_t; + + +typedef struct _ib_pd +{ + mlnx_ual_hobul_t *p_hobul; + void *p_pd_ul_resources; + HHUL_pd_hndl_t hhul_pd_hndl; + u_int32_t pd_idx; + +#define MLNX_MAX_AVS_PER_PD 0xFFFFFFFF + +} mlnx_ual_pd_info_t; + + +typedef struct _ib_cq +{ + mlnx_ual_hobul_t *p_hobul; + void *p_cq_ul_resources; + HHUL_cq_hndl_t hhul_cq_hndl; + u_int32_t cq_idx; + u_int32_t cq_size; + +} mlnx_ual_cq_info_t; + + +typedef struct _ib_qp +{ + ib_pd_handle_t h_uvp_pd; + void *p_qp_ul_resources; + HHUL_qp_hndl_t hhul_qp_hndl; + u_int32_t qp_idx; + VAPI_qp_cap_t ul_qp_cap; + IB_ts_t type; + +} mlnx_ual_qp_info_t; + + +typedef struct _ib_mw +{ + ib_pd_handle_t h_uvp_pd; + u_int32_t rkey; + HHUL_mw_hndl_t hhul_mw_hndl; + +} mlnx_ual_mw_info_t; + + +typedef struct _ib_av +{ + ib_pd_handle_t h_uvp_pd; + ib_av_attr_t *p_i_av_attr; + HHUL_ud_av_hndl_t h_av; + +} mlnx_ual_av_info_t; diff --git a/trunk/hw/mt23108/user/mlnx_ual_av.c b/trunk/hw/mt23108/user/mlnx_ual_av.c index 4102de62..6a82cd41 100644 --- a/trunk/hw/mt23108/user/mlnx_ual_av.c +++ b/trunk/hw/mt23108/user/mlnx_ual_av.c @@ -134,7 +134,7 @@ map_itom_av_attr ( ib_api_status_t mlnx_pre_create_av ( - IN const uvp_pd_handle_t h_uvp_pd, + IN const ib_pd_handle_t h_uvp_pd, IN const ib_av_attr_t *p_av_attr, IN OUT ci_umv_buf_t *p_umv_buf) { @@ -214,7 +214,7 @@ mlnx_post_create_av ( THHUL_pdm_create_ud_av (p_hobul->hhul_hca_hndl, p_pd_info->hhul_pd_hndl, &hhul_av, - &p_new_av->hhul_av_hndl)) + &p_new_av->h_av)) { CL_TRACE (MLNX_TRACE_LVL_1, mlnx_dbg_lvl, ("FAILED to create usermode UD AV\n")); @@ -224,7 +224,7 @@ mlnx_post_create_av ( p_new_av->p_i_av_attr = p_av_attr; p_new_av->h_uvp_pd = h_uvp_pd; - *ph_uvp_av = (uvp_av_handle_t) p_new_av; + *ph_uvp_av = p_new_av; p_umv_buf->p_inout_buf = NULL; } @@ -251,7 +251,7 @@ cleanup: ib_api_status_t mlnx_pre_query_av ( - IN const uvp_av_handle_t h_uvp_av, + IN const ib_av_handle_t h_uvp_av, IN OUT ci_umv_buf_t *p_umv_buf ) { FUNC_ENTER; @@ -289,7 +289,7 @@ mlnx_post_query_av ( ib_api_status_t mlnx_pre_modify_av ( - IN const uvp_av_handle_t h_uvp_av, + IN const ib_av_handle_t h_uvp_av, IN const ib_av_attr_t *p_addr_vector, IN OUT ci_umv_buf_t *p_umv_buf) { @@ -313,7 +313,7 @@ mlnx_pre_modify_av ( if (HH_OK != THHUL_pdm_modify_ud_av (p_hobul->hhul_hca_hndl, - p_av_info->hhul_av_hndl, + p_av_info->h_av, &hhul_av)) { CL_TRACE (MLNX_TRACE_LVL_1, mlnx_dbg_lvl, @@ -333,7 +333,7 @@ mlnx_pre_modify_av ( void mlnx_post_modify_av ( - IN const uvp_av_handle_t h_uvp_av, + IN const ib_av_handle_t h_uvp_av, IN ib_api_status_t ioctl_status, IN OUT ci_umv_buf_t *p_umv_buf) { @@ -345,7 +345,7 @@ mlnx_post_modify_av ( ib_api_status_t mlnx_pre_destroy_av ( - IN const uvp_av_handle_t h_uvp_av) + IN const ib_av_handle_t h_uvp_av) { FUNC_ENTER; FUNC_EXIT; @@ -355,7 +355,7 @@ mlnx_pre_destroy_av ( void mlnx_post_destroy_av ( - IN const uvp_av_handle_t h_uvp_av, + IN const ib_av_handle_t h_uvp_av, IN ib_api_status_t ioctl_status) { mlnx_ual_hobul_t *p_hobul; @@ -373,7 +373,7 @@ mlnx_post_destroy_av ( if (HH_OK != THHUL_pdm_destroy_ud_av (p_hobul->hhul_hca_hndl, - p_av_info->hhul_av_hndl)) + p_av_info->h_av)) { CL_TRACE (MLNX_TRACE_LVL_1, mlnx_dbg_lvl, ("Failed to destroy av\n")); diff --git a/trunk/hw/mt23108/user/mlnx_ual_ca.c b/trunk/hw/mt23108/user/mlnx_ual_ca.c index 760f27ba..2fa97d70 100644 --- a/trunk/hw/mt23108/user/mlnx_ual_ca.c +++ b/trunk/hw/mt23108/user/mlnx_ual_ca.c @@ -132,74 +132,55 @@ mlnx_post_open_ca ( ib_api_status_t mlnx_pre_query_ca ( - IN uvp_ca_handle_t h_uvp_ca, - IN OUT ual_query_ca_ioctl_t *p_ca_ioctl ) + IN ib_ca_handle_t h_uvp_ca, + IN ib_ca_attr_t *p_ca_attr, + IN size_t byte_count, + IN ci_umv_buf_t *p_umv_buf ) { - ib_api_status_t status = IB_SUCCESS; - mlnx_ual_hobul_t *p_hobul = (mlnx_ual_hobul_t *)((void*)h_uvp_ca); + ib_api_status_t status = IB_SUCCESS; - FUNC_ENTER; + FUNC_ENTER; - CL_ASSERT(p_hobul); - CL_ASSERT(p_ca_ioctl); + CL_ASSERT(h_uvp_ca); - /* hca_ul_info should be filled up by open_ca() */ - if ( p_hobul->p_hca_ul_info->status != HH_HCA_STATUS_OPENED ) - { - CL_TRACE (MLNX_TRACE_LVL_1, mlnx_dbg_lvl, - ("Device is not opened\n")); - status = IB_INVALID_CA_HANDLE; - return status; - } - /* first time call query_ca */ - if ( !p_hobul->p_hca_attr ) - { - /* assume if user buffer is valid then byte_cnt is valid too - * so we can preallocate ca attr buffer for post ioctl data saving - */ - if ( p_ca_ioctl->in.p_ca_attr != NULL ) + /* hca_ul_info should be filled up by open_ca() */ + if ( h_uvp_ca->p_hca_ul_info->status != HH_HCA_STATUS_OPENED ) { - p_hobul->p_hca_attr = cl_zalloc(p_ca_ioctl->in.byte_cnt); - if (! p_hobul->p_hca_attr ) - { - CL_TRACE (MLNX_TRACE_LVL_1, mlnx_dbg_lvl, - ("Failed to alloc new_ca\n")); - status = IB_INSUFFICIENT_RESOURCES; - return status; - } - } - p_ca_ioctl->in.umv_buf.input_size = sizeof(HH_hca_dev_t)+sizeof(u_int32_t); - if (p_ca_ioctl->in.umv_buf.input_size) - { - p_ca_ioctl->in.umv_buf.output_size = p_ca_ioctl->in.umv_buf.input_size; - p_ca_ioctl->in.umv_buf.p_inout_buf = cl_zalloc(p_ca_ioctl->in.umv_buf.input_size); - if (p_ca_ioctl->in.umv_buf.p_inout_buf == NULL) - { CL_TRACE (MLNX_TRACE_LVL_1, mlnx_dbg_lvl, - ("Failed to alloc priv buffer memory\n")); - status = IB_INSUFFICIENT_RESOURCES; - } - } - } - else - { - /* user query for attr size */ - if ( ! p_ca_ioctl->in.p_ca_attr ) - { - p_ca_ioctl->out.byte_cnt = p_hobul->p_hca_attr->size; - status = IB_INSUFFICIENT_MEMORY; - p_ca_ioctl->out.status = status ; + ("Device is not opened\n")); + status = IB_INVALID_CA_HANDLE; + return status; } - /* user query for ca attributes */ - else + /* + * First time call query_ca - populate our internal cached attributes + * so we can access the GID table. Note that query_ca calls *always* + * get their attributes from the kernel. + */ + if ( !h_uvp_ca->p_hca_attr ) { - cl_memcpy (p_ca_ioctl->in.p_ca_attr, p_hobul->p_hca_attr, - min (p_ca_ioctl->in.byte_cnt, p_hobul->p_hca_attr->size )); + /* + * Assume if user buffer is valid then byte_cnt is valid too + * so we can preallocate ca attr buffer for post ioctl data saving + * + * Note that we squirel the buffer away into the umv_buf and only + * set it into the HCA if the query is successful. + */ + if ( p_ca_attr != NULL ) + { + p_umv_buf->p_inout_buf = cl_zalloc(byte_count); + if ( !p_umv_buf->p_inout_buf ) + { + CL_TRACE (MLNX_TRACE_LVL_1, mlnx_dbg_lvl, + ("Failed to alloc new_ca\n")); + status = IB_INSUFFICIENT_RESOURCES; + return status; + } + } + p_umv_buf->input_size = p_umv_buf->output_size = 0; } - } - FUNC_EXIT; - return status; + FUNC_EXIT; + return status; } @@ -211,41 +192,29 @@ mlnx_post_query_ca ( IN size_t byte_count, IN ci_umv_buf_t *p_umv_buf ) { - mlnx_ual_hobul_t *p_hobul = (mlnx_ual_hobul_t *)((void*)h_uvp_ca); + FUNC_ENTER; - FUNC_ENTER; + CL_ASSERT(h_uvp_ca); + CL_ASSERT(p_umv_buf); - CL_ASSERT(p_hobul); - CL_ASSERT(p_umv_buf); - - /* - * The umv_buf query is only done as part of open_ca(). - * Verify that we performed a query before checking the results - */ - if ((IB_SUCCESS == p_umv_buf->status) && (IB_SUCCESS == ioctl_status)) - { - if ( p_ca_attr && byte_count ) + if ( ioctl_status == IB_SUCCESS && p_ca_attr && + byte_count && !h_uvp_ca->p_hca_attr ) { - cl_memcpy (p_hobul->p_hca_attr, p_ca_attr , byte_count ); - CL_TRACE (MLNX_TRACE_LVL_1, mlnx_dbg_lvl, - ("got ca_attr %d\n", byte_count)); + h_uvp_ca->p_hca_attr = p_umv_buf->p_inout_buf; + } + else if (p_umv_buf->p_inout_buf) + { + cl_free (p_umv_buf->p_inout_buf); } - } - - if (p_umv_buf->p_inout_buf) - { - cl_free (p_umv_buf->p_inout_buf); - p_umv_buf->p_inout_buf = NULL; - } - FUNC_EXIT; - return; + FUNC_EXIT; + return; } ib_api_status_t mlnx_pre_modify_ca ( - IN uvp_ca_handle_t h_uvp_ca, + IN ib_ca_handle_t h_uvp_ca, IN uint8_t port_num, IN ib_ca_mod_t ca_mod, IN const ib_port_attr_mod_t* p_port_attr_mod) @@ -258,7 +227,7 @@ mlnx_pre_modify_ca ( void mlnx_post_modify_ca ( - IN uvp_ca_handle_t h_uvp_ca, + IN ib_ca_handle_t h_uvp_ca, IN ib_api_status_t ioctl_status) { FUNC_ENTER; @@ -269,7 +238,7 @@ mlnx_post_modify_ca ( ib_api_status_t mlnx_pre_close_ca ( - IN uvp_ca_handle_t h_uvp_ca) + IN ib_ca_handle_t h_uvp_ca) { FUNC_ENTER; FUNC_EXIT; @@ -279,7 +248,7 @@ mlnx_pre_close_ca ( ib_api_status_t mlnx_post_close_ca ( - IN uvp_ca_handle_t h_uvp_ca, + IN ib_ca_handle_t h_uvp_ca, IN ib_api_status_t ioctl_status ) { mlnx_ual_hobul_t *p_hobul = (mlnx_ual_hobul_t *)((void*)h_uvp_ca); diff --git a/trunk/hw/mt23108/user/mlnx_ual_cq.c b/trunk/hw/mt23108/user/mlnx_ual_cq.c index 4bfd1e2a..8766be36 100644 --- a/trunk/hw/mt23108/user/mlnx_ual_cq.c +++ b/trunk/hw/mt23108/user/mlnx_ual_cq.c @@ -235,7 +235,7 @@ mlnx_post_create_cq ( sizeof (mlnx_ual_cq_info_t *)); CL_ASSERT(p_new_cq); - *ph_uvp_cq = (uvp_cq_handle_t) p_new_cq; + *ph_uvp_cq = p_new_cq; if ( ioctl_status == IB_SUCCESS ) { @@ -354,7 +354,7 @@ mlnx_pre_resize_cq ( void mlnx_post_resize_cq ( - IN const uvp_cq_handle_t h_uvp_cq, + IN const ib_cq_handle_t h_uvp_cq, IN ib_api_status_t ioctl_status, IN const uint32_t size, IN OUT ci_umv_buf_t *p_umv_buf) @@ -434,7 +434,7 @@ mlnx_post_resize_cq ( ib_api_status_t mlnx_pre_query_cq ( - IN const uvp_cq_handle_t h_uvp_cq, + IN const ib_cq_handle_t h_uvp_cq, IN OUT ci_umv_buf_t *p_umv_buf) { FUNC_ENTER; @@ -447,7 +447,7 @@ mlnx_pre_query_cq ( void mlnx_post_query_cq ( - IN const uvp_cq_handle_t h_uvp_cq, + IN const ib_cq_handle_t h_uvp_cq, IN ib_api_status_t ioctl_status, IN OUT ci_umv_buf_t *p_umv_buf) { @@ -459,7 +459,7 @@ mlnx_post_query_cq ( ib_api_status_t mlnx_pre_destroy_cq ( - IN const uvp_cq_handle_t h_uvp_cq) + IN const ib_cq_handle_t h_uvp_cq) { FUNC_ENTER; FUNC_EXIT; @@ -469,7 +469,7 @@ mlnx_pre_destroy_cq ( void mlnx_post_destroy_cq ( - IN const uvp_cq_handle_t h_uvp_cq, + IN const ib_cq_handle_t h_uvp_cq, IN ib_api_status_t ioctl_status) { mlnx_ual_cq_info_t *p_cq_info = (mlnx_ual_cq_info_t *) ((void*)h_uvp_cq); diff --git a/trunk/hw/mt23108/user/mlnx_ual_errh.c b/trunk/hw/mt23108/user/mlnx_ual_errh.c deleted file mode 100644 index b4e52a6a..00000000 --- a/trunk/hw/mt23108/user/mlnx_ual_errh.c +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Copyright (c) 2005 SilverStorm Technologies. All rights reserved. - * Copyright (c) 2004-2005 Mellanox Technologies, Inc. All rights reserved. - * - * This software is available to you under the OpenIB.org BSD license - * below: - * - * Redistribution and use in source and binary forms, with or - * without modification, are permitted provided that the following - * conditions are met: - * - * - Redistributions of source code must retain the above - * copyright notice, this list of conditions and the following - * disclaimer. - * - * - Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimer in the documentation and/or other materials - * provided with the distribution. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS - * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - * - * $Id$ - */ - -#include "mlnx_ual_main.h" - -extern u_int32_t mlnx_dbg_lvl; - -void -mlnx_get_errh_interface ( - IN OUT uvp_interface_t *p_uvp ) -{ - FUNC_ENTER; - - CL_ASSERT(p_uvp); - - - /* - * Error notification - * If the vendor provides these functions, UAL will - * invoke these functions when a QP/CQ error is reported by AL. - * - */ - p_uvp->err_handler = mlnx_err_handler; - - FUNC_EXIT; -} - - -void -mlnx_err_handler ( - IN const ib_async_event_rec_t *const p_err_rec) -{ - FUNC_ENTER; - FUNC_EXIT; -} - - diff --git a/trunk/hw/mt23108/user/mlnx_ual_main.c b/trunk/hw/mt23108/user/mlnx_ual_main.c index ae868345..d847f407 100644 --- a/trunk/hw/mt23108/user/mlnx_ual_main.c +++ b/trunk/hw/mt23108/user/mlnx_ual_main.c @@ -157,21 +157,11 @@ uvp_get_interface ( */ mlnx_get_cq_interface (p_uvp); - /* - * EE Management - */ -// mlnx_get_eec_interface (p_uvp); - /* * AV Management */ mlnx_get_av_interface(p_uvp); - /* - * RDD Management - */ -// mlnx_get_rdd_interface(p_uvp); - /* * Memory Region / Window Management Verbs */ @@ -182,14 +172,6 @@ uvp_get_interface ( */ mlnx_get_mcast_interface (p_uvp); - /* - * Error notification - * If the vendor provides these functions, UAL will - * invoke these functions when a QP/CQ error is reported by AL. - * - */ - mlnx_get_errh_interface (p_uvp); - /* * OS bypass (send, receive, poll/notify cq) */ diff --git a/trunk/hw/mt23108/user/mlnx_ual_main.h b/trunk/hw/mt23108/user/mlnx_ual_main.h index 06925c79..0c8a94e7 100644 --- a/trunk/hw/mt23108/user/mlnx_ual_main.h +++ b/trunk/hw/mt23108/user/mlnx_ual_main.h @@ -42,9 +42,7 @@ #include //#include -#include -#include -#include +#include "hca_data.h" #include #include #include @@ -73,64 +71,7 @@ #define MLNX_UAL_ALLOC_HCA_UL_RES 1 #define MLNX_UAL_FREE_HCA_UL_RES 2 -typedef void* __ptr64 uvp_ca_handle_t; -typedef void* __ptr64 uvp_pd_handle_t; -typedef void* __ptr64 uvp_av_handle_t; -typedef void* __ptr64 uvp_cq_handle_t; -typedef void* __ptr64 uvp_qp_handle_t; -typedef void* __ptr64 uvp_mr_handle_t; -typedef void* __ptr64 uvp_mw_handle_t; -typedef void* __ptr64 uvp_mcast_handle_t; -typedef void* __ptr64 uvp_rdd_handle_t; -typedef void* __ptr64 uvp_eec_handle_t; - typedef unsigned __int3264 cl_dev_handle_t; -typedef struct hobul { - HH_hca_dev_t *p_hca_ul_info; - void *p_hca_ul_resources; - ib_ca_attr_t *p_hca_attr; - HHUL_hca_hndl_t hhul_hca_hndl; - u_int32_t priv_op; - void *p_al_ci_ca; -} mlnx_ual_hobul_t; - -typedef struct pd_info { - mlnx_ual_hobul_t *p_hobul; - void *p_pd_ul_resources; - HHUL_pd_hndl_t hhul_pd_hndl; - u_int32_t pd_idx; -#define MLNX_MAX_AVS_PER_PD 0xFFFFFFFF -} mlnx_ual_pd_info_t; - -typedef struct cq_info { - mlnx_ual_hobul_t *p_hobul; - void *p_cq_ul_resources; - HHUL_cq_hndl_t hhul_cq_hndl; - u_int32_t cq_idx; - u_int32_t cq_size; -} mlnx_ual_cq_info_t; - -typedef struct qp_info { - uvp_pd_handle_t h_uvp_pd; - void *p_qp_ul_resources; - HHUL_qp_hndl_t hhul_qp_hndl; - u_int32_t qp_idx; - VAPI_qp_cap_t ul_qp_cap; - IB_ts_t type; - -} mlnx_ual_qp_info_t; - -typedef struct av_info { - uvp_pd_handle_t h_uvp_pd; - ib_av_attr_t *p_i_av_attr; - HHUL_ud_av_hndl_t hhul_av_hndl; -} mlnx_ual_av_info_t; - -typedef struct mw_info { - uvp_pd_handle_t h_uvp_pd; - u_int32_t rkey; - HHUL_mw_hndl_t hhul_mw_hndl; -} mlnx_ual_mw_info_t; /* @@ -159,8 +100,10 @@ mlnx_post_open_ca ( ib_api_status_t mlnx_pre_query_ca ( - IN uvp_ca_handle_t h_uvp_ca, - IN OUT ual_query_ca_ioctl_t *p_ca_ioctl ); + IN ib_ca_handle_t h_uvp_ca, + IN ib_ca_attr_t *p_ca_attr, + IN size_t byte_count, + IN ci_umv_buf_t *p_umv_buf ); void mlnx_post_query_ca ( @@ -172,23 +115,23 @@ mlnx_post_query_ca ( ib_api_status_t mlnx_pre_modify_ca ( - IN uvp_ca_handle_t h_uvp_ca, + IN ib_ca_handle_t h_uvp_ca, IN uint8_t port_num, IN ib_ca_mod_t modca_cmd, IN const ib_port_attr_mod_t* p_port_attr_mod ); void mlnx_post_modify_ca ( - IN uvp_ca_handle_t h_uvp_ca, + IN ib_ca_handle_t h_uvp_ca, IN ib_api_status_t ioctl_status); ib_api_status_t mlnx_pre_close_ca ( - IN uvp_ca_handle_t h_uvp_ca ); + IN ib_ca_handle_t h_uvp_ca ); ib_api_status_t mlnx_post_close_ca ( - IN uvp_ca_handle_t h_uvp_ca, + IN ib_ca_handle_t h_uvp_ca, IN ib_api_status_t ioctl_status ); @@ -199,7 +142,7 @@ mlnx_get_pd_interface ( ib_api_status_t mlnx_pre_allocate_pd ( - IN const uvp_ca_handle_t h_uvp_ca, + IN const ib_ca_handle_t h_uvp_ca, IN OUT ci_umv_buf_t *p_umv_buf); void @@ -211,11 +154,11 @@ mlnx_post_allocate_pd ( ib_api_status_t mlnx_pre_deallocate_pd ( - IN const uvp_pd_handle_t h_uvp_pd); + IN const ib_pd_handle_t h_uvp_pd); void mlnx_post_deallocate_pd ( - IN const uvp_pd_handle_t h_uvp_pd, + IN const ib_pd_handle_t h_uvp_pd, IN ib_api_status_t ioctl_status ); @@ -226,7 +169,7 @@ mlnx_get_av_interface ( ib_api_status_t mlnx_pre_create_av ( - IN const uvp_pd_handle_t h_uvp_pd, + IN const ib_pd_handle_t h_uvp_pd, IN const ib_av_attr_t *p_addr_vector, IN OUT ci_umv_buf_t *p_umv_buf); @@ -240,7 +183,7 @@ mlnx_post_create_av ( ib_api_status_t mlnx_pre_query_av ( - IN const uvp_av_handle_t h_uvp_av, + IN const ib_av_handle_t h_uvp_av, IN OUT ci_umv_buf_t *p_umv_buf ); void @@ -253,23 +196,23 @@ mlnx_post_query_av ( ib_api_status_t mlnx_pre_modify_av ( - IN const uvp_av_handle_t h_uvp_av, + IN const ib_av_handle_t h_uvp_av, IN const ib_av_attr_t *p_addr_vector, IN OUT ci_umv_buf_t *p_umv_buf); void mlnx_post_modify_av ( - IN const uvp_av_handle_t h_uvp_av, + IN const ib_av_handle_t h_uvp_av, IN ib_api_status_t ioctl_status, IN OUT ci_umv_buf_t *p_umv_buf); ib_api_status_t mlnx_pre_destroy_av ( - IN const uvp_av_handle_t h_uvp_av); + IN const ib_av_handle_t h_uvp_av); void mlnx_post_destroy_av ( - IN const uvp_av_handle_t h_uvp_av, + IN const ib_av_handle_t h_uvp_av, IN ib_api_status_t ioctl_status); @@ -300,29 +243,29 @@ mlnx_pre_resize_cq ( void mlnx_post_resize_cq ( - IN const uvp_cq_handle_t h_uvp_cq, + IN const ib_cq_handle_t h_uvp_cq, IN ib_api_status_t ioctl_status, IN const uint32_t size, IN OUT ci_umv_buf_t *p_umv_buf); ib_api_status_t mlnx_pre_query_cq ( - IN const uvp_cq_handle_t h_uvp_cq, + IN const ib_cq_handle_t h_uvp_cq, IN OUT ci_umv_buf_t *p_umv_buf); void mlnx_post_query_cq ( - IN const uvp_cq_handle_t h_uvp_cq, + IN const ib_cq_handle_t h_uvp_cq, IN ib_api_status_t ioctl_status, IN OUT ci_umv_buf_t *p_umv_buf); ib_api_status_t mlnx_pre_destroy_cq ( - IN const uvp_cq_handle_t h_uvp_cq); + IN const ib_cq_handle_t h_uvp_cq); void mlnx_post_destroy_cq ( - IN const uvp_cq_handle_t h_uvp_cq, + IN const ib_cq_handle_t h_uvp_cq, IN ib_api_status_t ioctl_status); /************* QP Management *************************/ @@ -332,7 +275,7 @@ mlnx_get_qp_interface ( ib_api_status_t mlnx_pre_create_qp ( - IN const uvp_pd_handle_t h_uvp_pd,// Fix me: if needed + IN const ib_pd_handle_t h_uvp_pd,// Fix me: if needed IN const ib_qp_create_t *p_create_attr, IN OUT ci_umv_buf_t *p_umv_buf); @@ -345,35 +288,35 @@ mlnx_post_create_qp ( ib_api_status_t mlnx_pre_modify_qp ( - IN const uvp_qp_handle_t h_uvp_qp, + IN const ib_qp_handle_t h_uvp_qp, IN const ib_qp_mod_t *p_modify_attr, // Fixme IN OUT ci_umv_buf_t *p_umv_buf); void mlnx_post_modify_qp ( - IN const uvp_qp_handle_t h_uvp_qp, + IN const ib_qp_handle_t h_uvp_qp, IN ib_api_status_t ioctl_status, IN OUT ci_umv_buf_t *p_umv_buf); ib_api_status_t mlnx_pre_query_qp ( - IN uvp_qp_handle_t h_uvp_qp, + IN ib_qp_handle_t h_uvp_qp, IN OUT ci_umv_buf_t *p_umv_buf); void mlnx_post_query_qp ( - IN uvp_qp_handle_t h_uvp_qp, + IN ib_qp_handle_t h_uvp_qp, IN ib_api_status_t ioctl_status, IN ib_qp_attr_t *p_query_attr, IN OUT ci_umv_buf_t *p_umv_buf); ib_api_status_t mlnx_pre_destroy_qp ( - IN const uvp_qp_handle_t h_uvp_qp); + IN const ib_qp_handle_t h_uvp_qp); void mlnx_post_destroy_qp ( - IN const uvp_qp_handle_t h_uvp_qp, + IN const ib_qp_handle_t h_uvp_qp, IN ib_api_status_t ioctl_status ); /************* MR/MW Management *************************/ @@ -383,43 +326,43 @@ mlnx_get_mrw_interface ( ib_api_status_t mlnx_pre_register_mr ( - IN const uvp_pd_handle_t h_uvp_pd, + IN const ib_pd_handle_t h_uvp_pd, IN const ib_mr_create_t *p_mr_create, IN OUT ci_umv_buf_t *p_umv_buf); void mlnx_post_register_mr ( - IN const uvp_pd_handle_t h_uvp_pd, + IN const ib_pd_handle_t h_uvp_pd, IN ib_api_status_t ioctl_status, IN const uint32_t *p_lkey, IN const uint32_t *p_rkey, - OUT const uvp_mr_handle_t *ph_uvp_mr, + OUT const ib_mr_handle_t *ph_uvp_mr, IN OUT ci_umv_buf_t *p_umv_buf); ib_api_status_t mlnx_pre_query_mr ( - IN const uvp_mr_handle_t h_uvp_mr, + IN const ib_mr_handle_t h_uvp_mr, IN OUT ci_umv_buf_t *p_umv_buf); void mlnx_post_query_mr ( - IN const uvp_mr_handle_t h_uvp_mr, + IN const ib_mr_handle_t h_uvp_mr, IN ib_api_status_t ioctl_status, IN const ib_mr_attr_t *p_mr_query, IN OUT ci_umv_buf_t *p_umv_buf); ib_api_status_t mlnx_pre_modify_mr ( - IN const uvp_mr_handle_t h_uvp_mr, - IN const uvp_pd_handle_t h_uvp_pd OPTIONAL, + IN const ib_mr_handle_t h_uvp_mr, + IN const ib_pd_handle_t h_uvp_pd OPTIONAL, IN const ib_mr_mod_t mr_mod_mask, IN const ib_mr_create_t *p_mr_create OPTIONAL, IN OUT ci_umv_buf_t *p_umv_buf); void mlnx_post_modify_mr ( - IN const uvp_mr_handle_t h_uvp_mr, - IN const uvp_pd_handle_t h_uvp_pd OPTIONAL, + IN const ib_mr_handle_t h_uvp_mr, + IN const ib_pd_handle_t h_uvp_pd OPTIONAL, IN ib_api_status_t ioctl_status, IN const uint32_t *p_lkey, IN const uint32_t *p_rkey, @@ -427,36 +370,36 @@ mlnx_post_modify_mr ( ib_api_status_t mlnx_pre_register_smr ( - IN const uvp_pd_handle_t h_uvp_pd, - IN const uvp_mr_handle_t h_uvp_mr, + IN const ib_pd_handle_t h_uvp_pd, + IN const ib_mr_handle_t h_uvp_mr, IN const ib_access_t access_ctrl, IN void *p_vaddr, IN OUT ci_umv_buf_t *p_umv_buf); void mlnx_post_register_smr ( - IN const uvp_pd_handle_t h_uvp_pd, - IN const uvp_mr_handle_t h_uvp_mr, + IN const ib_pd_handle_t h_uvp_pd, + IN const ib_mr_handle_t h_uvp_mr, IN ib_api_status_t ioctl_status, IN const void *p_vaddr, IN const uint32_t *p_lkey, IN const uint32_t *p_rkey, - OUT const uvp_mr_handle_t *ph_uvp_smr, + OUT const ib_mr_handle_t *ph_uvp_smr, IN OUT ci_umv_buf_t *p_umv_buf); ib_api_status_t mlnx_pre_deregister_mr ( - IN const uvp_mr_handle_t h_uvp_mr, + IN const ib_mr_handle_t h_uvp_mr, IN OUT ci_umv_buf_t *p_umv_buf); void mlnx_post_deregister_mr ( - IN const uvp_mr_handle_t h_uvp_mr, + IN const ib_mr_handle_t h_uvp_mr, IN OUT ci_umv_buf_t *p_umv_buf); ib_api_status_t mlnx_pre_create_mw ( - IN const uvp_pd_handle_t h_uvp_pd, + IN const ib_pd_handle_t h_uvp_pd, IN OUT ci_umv_buf_t *p_umv_buf); void @@ -469,7 +412,7 @@ mlnx_post_create_mw ( ib_api_status_t mlnx_pre_query_mw ( - IN const uvp_mw_handle_t h_uvp_mw, + IN const ib_mw_handle_t h_uvp_mw, IN OUT ci_umv_buf_t *p_umv_buf); void @@ -482,12 +425,12 @@ mlnx_post_query_mw ( ib_api_status_t mlnx_pre_destroy_mw ( - IN const uvp_mw_handle_t h_uvp_mw); + IN const ib_mw_handle_t h_uvp_mw); // IN OUT ci_umv_buf_t *p_umv_buf); void mlnx_post_destroy_mw ( - IN const uvp_mw_handle_t h_uvp_mw, + IN const ib_mw_handle_t h_uvp_mw, IN ib_api_status_t ioctl_status); @@ -499,26 +442,26 @@ mlnx_get_mcast_interface ( ib_api_status_t mlnx_pre_attach_mcast ( - IN const uvp_qp_handle_t h_uvp_qp, + IN const ib_qp_handle_t h_uvp_qp, IN const ib_gid_t *p_mcast_gid, IN const uint16_t mcast_lid, IN OUT ci_umv_buf_t *p_umv_buf); void mlnx_post_attach_mcast ( - IN const uvp_qp_handle_t h_uvp_qp, + IN const ib_qp_handle_t h_uvp_qp, IN ib_api_status_t ioctl_status, - OUT uvp_mcast_handle_t *ph_mcast, + OUT ib_mcast_handle_t *ph_mcast, IN OUT ci_umv_buf_t *p_umv_buf); ib_api_status_t mlnx_pre_detach_mcast ( - IN uvp_mcast_handle_t h_uvp_mcast, + IN ib_mcast_handle_t h_uvp_mcast, IN OUT ci_umv_buf_t *p_umv_buf); void mlnx_post_detach_mcast ( - IN uvp_mcast_handle_t h_uvp_mcast, + IN ib_mcast_handle_t h_uvp_mcast, IN ib_api_status_t ioctl_status, IN OUT ci_umv_buf_t *p_umv_buf); @@ -568,91 +511,4 @@ mlnx_peek_cq ( IN const void* __ptr64 h_cq, OUT uint32_t* const p_n_cqes ); -/************* ERROR Handler *************************/ -void -mlnx_get_errh_interface ( - IN OUT uvp_interface_t *p_uvp ); - - -void -mlnx_err_handler ( - IN const ib_async_event_rec_t *const p_err_rec); - -/************* RDD Management *************************/ -void -mlnx_get_rdd_interface ( - IN OUT uvp_interface_t *p_uvp ); - -ib_api_status_t -mlnx_pre_allocate_rdd ( - IN const uvp_ca_handle_t h_uvp_ca, - IN OUT ci_umv_buf_t *p_umv_buf); - -void -mlnx_post_allocate_rdd ( - IN const uvp_ca_handle_t h_uvp_ca, - IN ib_api_status_t ioctl_status, - OUT uvp_rdd_handle_t *ph_uvp_rdd, - IN OUT ci_umv_buf_t *p_umv_buf); - -ib_api_status_t -mlnx_pre_deallocate_rdd ( - IN const uvp_rdd_handle_t h_uvp_rdd, - IN OUT ci_umv_buf_t *p_umv_buf); - -void -mlnx_post_deallocate_rdd ( - IN const uvp_rdd_handle_t h_uvp_rdd); - -/************* EEC Management *************************/ -#ifdef EEC_MANAGEMENT -void -mlnx_get_eec_interface ( - IN OUT uvp_interface_t *p_uvp ); - -ib_api_status_t -mlnx_pre_create_eec ( - IN const uvp_rdd_handle_t h_uvp_rdd, - IN OUT ci_umv_buf_t *p_umv_buf); - -void -mlnx_post_create_eec ( - IN const uvp_rdd_handle_t h_uvp_rdd, - IN ib_api_status_t ioctl_status, - OUT uvp_eec_handle_t *p_uvp_eec, - IN OUT ci_umv_buf_t *p_umv_buf); - -ib_api_status_t -mlnx_pre_query_eec ( - IN const uvp_eec_handle_t h_uvp_eec, - IN OUT ci_umv_buf_t *p_umv_buf); - -void -mlnx_post_query_eec ( - IN const uvp_eec_handle_t h_uvp_eec, - IN ib_api_status_t ioctl_status, - IN ib_eec_attr_t *p_query_attr, - IN OUT ci_umv_buf_t *p_umv_buf); - -ib_api_status_t -mlnx_pre_modify_eec ( - IN const uvp_eec_handle_t h_uvp_eec, - IN const ib_eec_mod_t *p_modify_attr, - IN OUT ci_umv_buf_t *p_umv_buf); - -void -mlnx_post_modify_eec ( - IN const uvp_eec_handle_t h_uvp_eec, - IN ib_api_status_t ioctl_status, - IN OUT ci_umv_buf_t *p_umv_buf); - -ib_api_status_t -mlnx_pre_destroy_eec ( - IN const uvp_eec_handle_t h_uvp_eec); - -void -mlnx_post_destroy_eec ( - IN const uvp_eec_handle_t h_uvp_eec); - -#endif // EEC_MANAGEMENT #endif diff --git a/trunk/hw/mt23108/user/mlnx_ual_mcast.c b/trunk/hw/mt23108/user/mlnx_ual_mcast.c index 64edd024..f847f00d 100644 --- a/trunk/hw/mt23108/user/mlnx_ual_mcast.c +++ b/trunk/hw/mt23108/user/mlnx_ual_mcast.c @@ -57,7 +57,7 @@ mlnx_get_mcast_interface ( ib_api_status_t mlnx_pre_attach_mcast ( - IN const uvp_qp_handle_t h_uvp_qp, + IN const ib_qp_handle_t h_uvp_qp, IN const ib_gid_t *p_mcast_gid, IN const uint16_t mcast_lid, IN OUT ci_umv_buf_t *p_umv_buf) @@ -79,9 +79,9 @@ mlnx_pre_attach_mcast ( void mlnx_post_attach_mcast ( - IN const uvp_qp_handle_t h_uvp_qp, + IN const ib_qp_handle_t h_uvp_qp, IN ib_api_status_t ioctl_status, - OUT uvp_mcast_handle_t *ph_mcast, + OUT ib_mcast_handle_t *ph_mcast, IN OUT ci_umv_buf_t *p_umv_buf) { FUNC_ENTER; @@ -93,7 +93,7 @@ mlnx_post_attach_mcast ( ib_api_status_t mlnx_pre_detach_mcast ( - IN uvp_mcast_handle_t h_uvp_mcast, + IN ib_mcast_handle_t h_uvp_mcast, IN OUT ci_umv_buf_t *p_umv_buf) { FUNC_ENTER; @@ -111,7 +111,7 @@ mlnx_pre_detach_mcast ( void mlnx_post_detach_mcast ( - IN uvp_mcast_handle_t h_uvp_mcast, + IN ib_mcast_handle_t h_uvp_mcast, IN ib_api_status_t ioctl_status, IN OUT ci_umv_buf_t *p_umv_buf) { diff --git a/trunk/hw/mt23108/user/mlnx_ual_mrw.c b/trunk/hw/mt23108/user/mlnx_ual_mrw.c index 1a8a184d..2c0e808b 100644 --- a/trunk/hw/mt23108/user/mlnx_ual_mrw.c +++ b/trunk/hw/mt23108/user/mlnx_ual_mrw.c @@ -75,7 +75,7 @@ mlnx_get_mrw_interface ( ib_api_status_t mlnx_pre_register_mr ( - IN const uvp_pd_handle_t h_uvp_pd, + IN const ib_pd_handle_t h_uvp_pd, IN const ib_mr_create_t *p_mr_create, IN OUT ci_umv_buf_t *p_umv_buf) { @@ -92,11 +92,11 @@ mlnx_pre_register_mr ( void mlnx_post_register_mr ( - IN const uvp_pd_handle_t h_uvp_pd, + IN const ib_pd_handle_t h_uvp_pd, IN ib_api_status_t ioctl_status, IN const uint32_t *p_lkey, IN const uint32_t *p_rkey, - OUT const uvp_mr_handle_t *ph_uvp_mr, + OUT const ib_mr_handle_t *ph_uvp_mr, IN OUT ci_umv_buf_t *p_umv_buf) { FUNC_ENTER; @@ -107,7 +107,7 @@ mlnx_post_register_mr ( ib_api_status_t mlnx_pre_query_mr ( - IN const uvp_mr_handle_t h_uvp_mr, + IN const ib_mr_handle_t h_uvp_mr, IN OUT ci_umv_buf_t *p_umv_buf) { FUNC_ENTER; @@ -123,7 +123,7 @@ mlnx_pre_query_mr ( void mlnx_post_query_mr ( - IN const uvp_mr_handle_t h_uvp_mr, + IN const ib_mr_handle_t h_uvp_mr, IN ib_api_status_t ioctl_status, IN const ib_mr_attr_t *p_mr_query, IN OUT ci_umv_buf_t *p_umv_buf) @@ -136,8 +136,8 @@ mlnx_post_query_mr ( ib_api_status_t mlnx_pre_modify_mr ( - IN const uvp_mr_handle_t h_uvp_mr, - IN const uvp_pd_handle_t h_uvp_pd OPTIONAL, + IN const ib_mr_handle_t h_uvp_mr, + IN const ib_pd_handle_t h_uvp_pd OPTIONAL, IN const ib_mr_mod_t mr_mod_mask, IN const ib_mr_create_t *p_mr_create OPTIONAL, IN OUT ci_umv_buf_t *p_umv_buf) @@ -155,8 +155,8 @@ mlnx_pre_modify_mr ( void mlnx_post_modify_mr ( - IN const uvp_mr_handle_t h_uvp_mr, - IN const uvp_pd_handle_t h_uvp_pd OPTIONAL, + IN const ib_mr_handle_t h_uvp_mr, + IN const ib_pd_handle_t h_uvp_pd OPTIONAL, IN ib_api_status_t ioctl_status, IN const uint32_t *p_lkey, IN const uint32_t *p_rkey, @@ -170,8 +170,8 @@ mlnx_post_modify_mr ( ib_api_status_t mlnx_pre_register_smr ( - IN const uvp_pd_handle_t h_uvp_pd, - IN const uvp_mr_handle_t h_uvp_mr, + IN const ib_pd_handle_t h_uvp_pd, + IN const ib_mr_handle_t h_uvp_mr, IN const ib_access_t access_ctrl, IN void *p_vaddr, IN OUT ci_umv_buf_t *p_umv_buf) @@ -189,13 +189,13 @@ mlnx_pre_register_smr ( void mlnx_post_register_smr ( - IN const uvp_pd_handle_t h_uvp_pd, - IN const uvp_mr_handle_t h_uvp_mr, + IN const ib_pd_handle_t h_uvp_pd, + IN const ib_mr_handle_t h_uvp_mr, IN ib_api_status_t ioctl_status, IN const void *p_vaddr, IN const uint32_t *p_lkey, IN const uint32_t *p_rkey, - OUT const uvp_mr_handle_t *ph_uvp_smr, + OUT const ib_mr_handle_t *ph_uvp_smr, IN OUT ci_umv_buf_t *p_umv_buf) { FUNC_ENTER; @@ -206,7 +206,7 @@ mlnx_post_register_smr ( ib_api_status_t mlnx_pre_deregister_mr ( - IN const uvp_mr_handle_t h_uvp_mr, + IN const ib_mr_handle_t h_uvp_mr, IN OUT ci_umv_buf_t *p_umv_buf) { FUNC_ENTER; @@ -217,7 +217,7 @@ mlnx_pre_deregister_mr ( void mlnx_post_deregister_mr ( - IN const uvp_mr_handle_t h_uvp_mr, + IN const ib_mr_handle_t h_uvp_mr, IN OUT ci_umv_buf_t *p_umv_buf) { FUNC_ENTER; @@ -228,7 +228,7 @@ mlnx_post_deregister_mr ( ib_api_status_t mlnx_pre_create_mw ( - IN const uvp_pd_handle_t h_uvp_pd, + IN const ib_pd_handle_t h_uvp_pd, IN OUT ci_umv_buf_t *p_umv_buf) { ib_api_status_t status = IB_SUCCESS; @@ -310,7 +310,7 @@ mlnx_post_create_mw ( cl_memcpy (&p_new_mw, p_umv_buf->p_inout_buf, p_umv_buf->input_size); - *ph_uvp_mw = (uvp_mw_handle_t) p_new_mw; + *ph_uvp_mw = (ib_mw_handle_t) p_new_mw; if (IB_SUCCESS == status) { @@ -351,7 +351,7 @@ cleanup: ib_api_status_t mlnx_pre_query_mw ( - IN const uvp_mw_handle_t h_uvp_mw, + IN const ib_mw_handle_t h_uvp_mw, IN OUT ci_umv_buf_t *p_umv_buf) { FUNC_ENTER; @@ -384,7 +384,7 @@ mlnx_post_query_mw ( ib_api_status_t mlnx_pre_destroy_mw ( - IN const uvp_mw_handle_t h_uvp_mw) + IN const ib_mw_handle_t h_uvp_mw) { FUNC_ENTER; FUNC_EXIT; @@ -394,7 +394,7 @@ mlnx_pre_destroy_mw ( void mlnx_post_destroy_mw ( - IN const uvp_mw_handle_t h_uvp_mw, + IN const ib_mw_handle_t h_uvp_mw, IN ib_api_status_t ioctl_status) { ib_api_status_t status = IB_SUCCESS; diff --git a/trunk/hw/mt23108/user/mlnx_ual_osbypass.c b/trunk/hw/mt23108/user/mlnx_ual_osbypass.c index 3637bd3c..c69c8068 100644 --- a/trunk/hw/mt23108/user/mlnx_ual_osbypass.c +++ b/trunk/hw/mt23108/user/mlnx_ual_osbypass.c @@ -69,202 +69,6 @@ mlnx_get_osbypass_interface ( } -inline static VAPI_wr_opcode_t -map_itom_wr_opcode ( - IN ib_wr_type_t ibal_opcode, - IN boolean_t imm) -{ - VAPI_wr_opcode_t vapi_opcode; - - switch (ibal_opcode) - { - case WR_SEND: - vapi_opcode = VAPI_SEND; - break; - case WR_RDMA_WRITE: - vapi_opcode = VAPI_RDMA_WRITE; - break; - case WR_RDMA_READ: - vapi_opcode = VAPI_RDMA_READ; - break; - case WR_COMPARE_SWAP: - vapi_opcode = VAPI_ATOMIC_FETCH_AND_ADD; - break; - default: - vapi_opcode = VAPI_SEND; - break; - } - - if (imm & (VAPI_SEND == vapi_opcode || VAPI_RDMA_WRITE == vapi_opcode)) - { - vapi_opcode++; - } - - return vapi_opcode; -} - - -ib_api_status_t -map_itom_send_desc ( - IN IB_ts_t qp_type, - IN ib_send_wr_t *p_i_wqe, - OUT VAPI_sr_desc_t *p_m_swqe, - OUT u_int64_t *p_tot_len) -{ - boolean_t imm = FALSE; - u_int32_t idx; - register VAPI_sg_lst_entry_t *p_sg_list; - register ib_local_ds_t *p_i_ds; - - switch (qp_type) - { - case IB_TS_UD: - { - mlnx_ual_av_info_t *p_av_info = NULL; - - CL_TRACE (MLNX_TRACE_LVL_8, mlnx_dbg_lvl, ("Mapping UD QP\n")); - - p_av_info = (mlnx_ual_av_info_t *) p_i_wqe->dgrm.ud.h_av; - CL_ASSERT (p_av_info); - - p_m_swqe->remote_qp = CL_NTOH32 (p_i_wqe->dgrm.ud.remote_qp); - p_m_swqe->remote_qkey = CL_NTOH32 (p_i_wqe->dgrm.ud.remote_qkey); - p_m_swqe->remote_ah = p_av_info->hhul_av_hndl; - break; - } - case IB_TS_RC: - { - CL_TRACE (MLNX_TRACE_LVL_8, mlnx_dbg_lvl, ("Mapping RC QP\n")); - p_m_swqe->remote_addr = p_i_wqe->remote_ops.vaddr; - p_m_swqe->r_key = p_i_wqe->remote_ops.rkey; - p_m_swqe->compare_add = p_i_wqe->remote_ops.atomic1; - p_m_swqe->swap = p_i_wqe->remote_ops.atomic2; - break; - } - case IB_TS_RD: - case IB_TS_UC: - default: - CL_TRACE (MLNX_TRACE_LVL_1, mlnx_dbg_lvl, - ("Mapping RD/UC QP (unsupported\n")); - return IB_UNSUPPORTED; - } - - imm = (0 != (p_i_wqe->send_opt & IB_SEND_OPT_IMMEDIATE)); - p_m_swqe->fence = (MT_bool)(0 != (p_i_wqe->send_opt & IB_SEND_OPT_FENCE)); - p_m_swqe->set_se = (MT_bool)(0 != (p_i_wqe->send_opt & IB_SEND_OPT_SOLICITED)); - p_m_swqe->comp_type = (p_i_wqe->send_opt & IB_SEND_OPT_SIGNALED) ? - VAPI_SIGNALED : VAPI_UNSIGNALED; - p_m_swqe->id = p_i_wqe->wr_id; - p_m_swqe->opcode = map_itom_wr_opcode (p_i_wqe->wr_type, imm); - - if (imm) - { - p_m_swqe->imm_data = CL_NTOH32 (p_i_wqe->immediate_data); - } - - p_m_swqe->sg_lst_len = p_i_wqe->num_ds; - p_sg_list = p_m_swqe->sg_lst_p; - p_i_ds = p_i_wqe->ds_array; - *p_tot_len = 0; - - for (idx = 0; idx < p_i_wqe->num_ds; idx++) - { - p_sg_list->addr = (VAPI_virt_addr_t) (MT_virt_addr_t) p_i_ds->vaddr; - p_sg_list->len = p_i_ds->length; - p_sg_list->lkey = p_i_ds->lkey; - p_sg_list++; - *p_tot_len += p_i_ds->length + 4; // in_line data size + 4-byte length - p_i_ds++; - } - - CL_TRACE (MLNX_TRACE_LVL_8, mlnx_dbg_lvl, ("send: rqpn 0x%x qkey 0x%x\n", - p_m_swqe->remote_qp, p_m_swqe->remote_qkey)); - - return IB_SUCCESS; -} - - -ib_api_status_t -map_itom_recv_desc ( - IN ib_recv_wr_t *p_i_wqe, - OUT VAPI_rr_desc_t *p_m_rwqe) -{ - u_int32_t idx; - register VAPI_sg_lst_entry_t *p_sg_list; - register ib_local_ds_t *p_i_ds; - - p_m_rwqe->id = (VAPI_wr_id_t)p_i_wqe->wr_id; - p_m_rwqe->sg_lst_len = p_i_wqe->num_ds; - p_m_rwqe->comp_type = VAPI_SIGNALED; - - p_sg_list = p_m_rwqe->sg_lst_p; - p_i_ds = p_i_wqe->ds_array; - for (idx = 0; idx < p_i_wqe->num_ds; idx++) - { - p_sg_list->addr = (VAPI_virt_addr_t) (MT_virt_addr_t) p_i_ds->vaddr; - p_sg_list->len = p_i_ds->length; - p_sg_list->lkey = (VAPI_lkey_t)p_i_ds->lkey; - p_sg_list++; - p_i_ds++; - } - - return IB_SUCCESS; -} - - -int -map_mtoi_cqe_status ( - IN VAPI_wc_status_t m_status) -{ - switch (m_status) - { - case IB_COMP_SUCCESS: return (IB_WCS_SUCCESS); - case IB_COMP_LOC_LEN_ERR: return (IB_WCS_LOCAL_LEN_ERR); - case IB_COMP_LOC_QP_OP_ERR: return (IB_WCS_LOCAL_OP_ERR); -// case IB_COMP_LOC_EE_OP_ERR: return (IB_WCS_LOCAL_EEC_OP_ERR); - case IB_COMP_LOC_PROT_ERR: return (IB_WCS_LOCAL_PROTECTION_ERR); - case IB_COMP_WR_FLUSH_ERR: return (IB_WCS_WR_FLUSHED_ERR); - case IB_COMP_MW_BIND_ERR: return (IB_WCS_MEM_WINDOW_BIND_ERR); - case IB_COMP_REM_INV_REQ_ERR: return (IB_WCS_REM_INVALID_REQ_ERR); - case IB_COMP_REM_ACCESS_ERR: return (IB_WCS_REM_ACCESS_ERR); - case IB_COMP_REM_OP_ERR: return (IB_WCS_REM_OP_ERR); - case IB_COMP_RETRY_EXC_ERR: return (IB_WCS_TIMEOUT_RETRY_ERR); - case IB_COMP_RNR_RETRY_EXC_ERR: return (IB_WCS_RNR_RETRY_ERR); -// case IB_COMP_REM_INV_RD_REQ_ERR: return (IB_WCS_REM_INVALID_RD_REQ_ERR); - case IB_COMP_REM_ABORT_ERR: return (IB_WCS_REM_ACCESS_ERR); -// case IB_COMP_INV_EECN_ERR: return (IB_WCS_INVALID_EECN); -// case IB_COMP_INV_EEC_STATE_ERR: return (IB_WCS_INVALID_EEC_STATE); - case IB_COMP_FATAL_ERR: return (IB_WCS_REM_ACCESS_ERR); - case IB_COMP_GENERAL_ERR: return (IB_WCS_REM_ACCESS_ERR); - default: - CL_TRACE (MLNX_TRACE_LVL_1, mlnx_dbg_lvl, - ("Failed to map m_cqe->status %d\n", m_status)); - return IB_WCS_REM_ACCESS_ERR; - } - -} - - -int -map_mtoi_cqe_type ( - IN VAPI_cqe_opcode_t m_op) -{ - switch (m_op) - { - case VAPI_CQE_SQ_SEND_DATA: return IB_WC_SEND; - case VAPI_CQE_SQ_RDMA_WRITE: return IB_WC_RDMA_WRITE; - case VAPI_CQE_SQ_RDMA_READ: return IB_WC_RDMA_READ; - case VAPI_CQE_SQ_COMP_SWAP: return IB_WC_COMPARE_SWAP; - case VAPI_CQE_SQ_FETCH_ADD: return IB_WC_FETCH_ADD; - case VAPI_CQE_SQ_BIND_MRW: return IB_WC_MW_BIND; - case VAPI_CQE_RQ_SEND_DATA: return IB_WC_RECV; - case VAPI_CQE_RQ_RDMA_WITH_IMM: return IB_WC_RECV_RDMA_WRITE; - default: - return IB_WC_SEND; - } -} - - static VAPI_mrw_acl_t map_itom_access_ctrl ( IN ib_access_t i_acl) diff --git a/trunk/hw/mt23108/user/mlnx_ual_pd.c b/trunk/hw/mt23108/user/mlnx_ual_pd.c index 0c5599e4..fa4d011a 100644 --- a/trunk/hw/mt23108/user/mlnx_ual_pd.c +++ b/trunk/hw/mt23108/user/mlnx_ual_pd.c @@ -58,7 +58,7 @@ mlnx_get_pd_interface ( ib_api_status_t mlnx_pre_allocate_pd ( - IN const uvp_ca_handle_t h_uvp_ca, + IN const ib_ca_handle_t h_uvp_ca, IN OUT ci_umv_buf_t *p_umv_buf) { ib_api_status_t status = IB_SUCCESS; @@ -208,7 +208,7 @@ mlnx_post_allocate_pd ( sizeof (mlnx_ual_pd_info_t*)), sizeof (mlnx_ual_pd_info_t *)); CL_ASSERT(p_new_pd); - *ph_uvp_pd = (uvp_pd_handle_t) p_new_pd; + *ph_uvp_pd = (ib_pd_handle_t) p_new_pd; if ( ioctl_status == IB_SUCCESS ) { @@ -266,7 +266,7 @@ err: ib_api_status_t mlnx_pre_deallocate_pd ( - IN const uvp_pd_handle_t h_uvp_pd) + IN const ib_pd_handle_t h_uvp_pd) { ib_api_status_t status = IB_SUCCESS; mlnx_ual_pd_info_t *p_pd_info = (mlnx_ual_pd_info_t *)((void *)h_uvp_pd); @@ -305,7 +305,7 @@ mlnx_pre_deallocate_pd ( void mlnx_post_deallocate_pd ( - IN const uvp_pd_handle_t h_uvp_pd, + IN const ib_pd_handle_t h_uvp_pd, IN ib_api_status_t ioctl_status ) { mlnx_ual_pd_info_t *p_pd_info = (mlnx_ual_pd_info_t *)((void *)h_uvp_pd); diff --git a/trunk/hw/mt23108/user/mlnx_ual_qp.c b/trunk/hw/mt23108/user/mlnx_ual_qp.c index 21cb0099..4fff143f 100644 --- a/trunk/hw/mt23108/user/mlnx_ual_qp.c +++ b/trunk/hw/mt23108/user/mlnx_ual_qp.c @@ -77,7 +77,7 @@ map_ibal_qp_type (ib_qp_type_t ibal_qp_type) ib_api_status_t mlnx_pre_create_qp ( - IN const uvp_pd_handle_t h_uvp_pd, + IN const ib_pd_handle_t h_uvp_pd, IN const ib_qp_create_t *p_create_attr, IN OUT ci_umv_buf_t *p_umv_buf) { @@ -271,7 +271,7 @@ mlnx_post_create_qp ( sizeof (mlnx_ual_qp_info_t *)), sizeof (mlnx_ual_qp_info_t *)); CL_ASSERT(p_new_qp); - *ph_uvp_qp = (uvp_qp_handle_t) p_new_qp; + *ph_uvp_qp = (ib_qp_handle_t) p_new_qp; if ( ioctl_status == IB_SUCCESS ) { @@ -333,7 +333,7 @@ err: ib_api_status_t mlnx_pre_modify_qp ( - IN const uvp_qp_handle_t h_uvp_qp, + IN const ib_qp_handle_t h_uvp_qp, IN const ib_qp_mod_t *p_modify_attr, IN OUT ci_umv_buf_t *p_umv_buf) { @@ -364,7 +364,7 @@ mlnx_pre_modify_qp ( void mlnx_post_modify_qp ( - IN const uvp_qp_handle_t h_uvp_qp, + IN const ib_qp_handle_t h_uvp_qp, IN ib_api_status_t ioctl_status, IN OUT ci_umv_buf_t *p_umv_buf) { @@ -436,7 +436,7 @@ mlnx_post_modify_qp ( ib_api_status_t mlnx_pre_query_qp ( - IN uvp_qp_handle_t h_uvp_qp, + IN ib_qp_handle_t h_uvp_qp, IN OUT ci_umv_buf_t *p_umv_buf) { UNREFERENCED_PARAMETER(h_uvp_qp); @@ -454,7 +454,7 @@ mlnx_pre_query_qp ( void mlnx_post_query_qp ( - IN uvp_qp_handle_t h_uvp_qp, + IN ib_qp_handle_t h_uvp_qp, IN ib_api_status_t ioctl_status, IN OUT ib_qp_attr_t *p_query_attr, IN OUT ci_umv_buf_t *p_umv_buf) @@ -480,7 +480,7 @@ mlnx_post_query_qp ( ib_api_status_t mlnx_pre_destroy_qp ( - IN const uvp_qp_handle_t h_uvp_qp) + IN const ib_qp_handle_t h_uvp_qp) { UNREFERENCED_PARAMETER(h_uvp_qp); FUNC_ENTER; @@ -491,7 +491,7 @@ mlnx_pre_destroy_qp ( void mlnx_post_destroy_qp ( - IN const uvp_qp_handle_t h_uvp_qp, + IN const ib_qp_handle_t h_uvp_qp, IN ib_api_status_t ioctl_status) { mlnx_ual_qp_info_t *p_qp_info = (mlnx_ual_qp_info_t *)((void *) h_uvp_qp); diff --git a/trunk/hw/mt23108/vapi/user/SOURCES b/trunk/hw/mt23108/vapi/user/SOURCES index 66f89137..9fd8ec5d 100644 --- a/trunk/hw/mt23108/vapi/user/SOURCES +++ b/trunk/hw/mt23108/vapi/user/SOURCES @@ -16,6 +16,7 @@ MOSAL_HOME=$(MT_HOME)\mlxsys\mosal\os_dep\win THH_HOME=$(MT_HOME)\hca\hcahal\tavor INCLUDES= \ + ..\..\user; \ $(MT_HOME)\mlxsys\tools; \ $(MT_HOME)\tavor_arch_db; \ $(MT_HOME)\Hca\verbs; \ diff --git a/trunk/hw/mt23108/vapi/user/hca_data.h b/trunk/hw/mt23108/vapi/user/hca_data.h deleted file mode 100644 index 8d138218..00000000 --- a/trunk/hw/mt23108/vapi/user/hca_data.h +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright (c) 2005 SilverStorm Technologies. All rights reserved. - * - * This software is available to you under the OpenIB.org BSD license - * below: - * - * Redistribution and use in source and binary forms, with or - * without modification, are permitted provided that the following - * conditions are met: - * - * - Redistributions of source code must retain the above - * copyright notice, this list of conditions and the following - * disclaimer. - * - * - Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimer in the documentation and/or other materials - * provided with the distribution. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS - * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - * - * $Id$ - */ - -#include -#include - - -typedef struct _ib_av -{ - HHUL_ud_av_hndl_t h_av; -}; diff --git a/trunk/inc/user/iba/ib_uvp.h b/trunk/inc/user/iba/ib_uvp.h index a1956804..d92a977f 100644 --- a/trunk/inc/user/iba/ib_uvp.h +++ b/trunk/inc/user/iba/ib_uvp.h @@ -36,8 +36,6 @@ #include #include #include -#include -#include /****h* UAL_UVP_Interface/Overview user-mode Verbs * NAME @@ -247,12 +245,12 @@ typedef ib_api_status_t * * SYNOPSIS */ - typedef ib_api_status_t (AL_API *uvp_pre_query_ca) ( IN ib_ca_handle_t h_uvp_ca, - IN OUT ual_query_ca_ioctl_t *p_ca_ioctl ); - + IN ib_ca_attr_t *p_ca_attr, + IN size_t byte_count, + IN ci_umv_buf_t *p_umv_buf ); /* * DESCRIPTION * uvp_pre_query_ca() is implemented by vendor. It is the pre-ioctl routine @@ -261,6 +259,10 @@ typedef ib_api_status_t * PARAMETERS * h_uvp_ca * [in] Vendor's user-mode library handle to the open instance of the CA +* p_ca_attr +* [in] Pointer to the user's CA attribute buffer. +* byte_count +* [in] User-supplied size of the CA attribute buffer. * p_umv_buf * [in out] On input, UAL provides this buffer template. * On return from this function, p_umv_buf contains any vendor-specific @@ -2733,47 +2735,6 @@ typedef void /********/ -/****f* user-mode Verbs/uvp_err_handler -* NAME -* uvp_err_handler -- Vendor's handler for QP/CQ error notification -* -* SYNOPSIS -*/ - -typedef void -(AL_API *uvp_err_handler) ( - IN const ib_async_event_rec_t* const p_err_rec ); - -/* -* DESCRIPTION -* uvp_err_handler() is an optional error handler implemented by vendor. -* If the handler is provided, UAL will notify asynchronous errors for -* resources (e.g QP/CQ errors). Vendor could do any tracking as needed. -* -* PARAMETERS -* p_err_rec -* [in ] On input, the error record contains the code for resource error. -* The context is as appropriate for the resource. The vendor's -* error handler could take appropriate action based on the type -* of error and the context provided. The following table -* provides how to interpret the context based on the error code. -* Update for any more error code. -* ----------------------------------- -* Error Context -* ----------------------------------- -* QPERROR ib_qp_handle_t -* CQERROR ib_cq_handle_t -* -* RETURN VALUE -* NONE -* -* PORTABILITY -* User mode. -* -* SEE ALSO -* -********/ - /********/ /****s* user-mode Verbs/uvp_interface_t @@ -2906,14 +2867,6 @@ typedef struct _uvp_interface uvp_pre_detach_mcast pre_detach_mcast; uvp_post_detach_mcast_t post_detach_mcast; - /* - * Error notification - * If the vendor provides these functions, UAL will - * invoke these functions when a QP/CQ error is reported by AL. - * - */ - uvp_err_handler err_handler; - } uvp_interface_t; /********/