From: ftillier Date: Mon, 20 Jun 2005 22:42:50 +0000 (+0000) Subject: Add new type for PDs - IB_PDT_UD - to allow HCA driver to control how the AV X-Git-Url: https://openfabrics.org/gitweb/?a=commitdiff_plain;h=6c0607088b2be5c9595fa718e376b292aa8bd756;p=~shefty%2Frdma-win.git Add new type for PDs - IB_PDT_UD - to allow HCA driver to control how the AV limit per PD based on intended usage. AV limit for UD PDs is identical to that of SQP PDs. git-svn-id: svn://openib.tc.cornell.edu/gen1@19 ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86 --- diff --git a/trunk/core/al/al_pd.c b/trunk/core/al/al_pd.c index 513e3c6e..08508712 100644 --- a/trunk/core/al/al_pd.c +++ b/trunk/core/al/al_pd.c @@ -123,6 +123,7 @@ alloc_pd( case IB_PDT_NORMAL: case IB_PDT_SQP: + case IB_PDT_UD: /* Allocate the protection domain. */ status = verbs_allocate_pd(h_ca, h_pd); break; diff --git a/trunk/hw/mt23108/kernel/hca_verbs.c b/trunk/hw/mt23108/kernel/hca_verbs.c index 4369a784..55326e8f 100644 --- a/trunk/hw/mt23108/kernel/hca_verbs.c +++ b/trunk/hw/mt23108/kernel/hca_verbs.c @@ -686,17 +686,27 @@ mlnx_allocate_pd ( goto cleanup; } - if( type == IB_PDT_SQP ) + switch( type ) { - if (HH_OK != THHUL_pdm_alloc_pd_avs_prep(hobul_p->hhul_hndl, g_sqp_max_avs, - PD_FOR_SQP, &hhul_pd_hndl, pd_ul_resources_p)) + case IB_PDT_SQP: + if (HH_OK != THHUL_pdm_alloc_pd_avs_prep(hobul_p->hhul_hndl, + g_sqp_max_avs, PD_FOR_SQP, &hhul_pd_hndl, pd_ul_resources_p)) { status = IB_ERROR; goto cleanup; } - } - else - { + break; + + case IB_PDT_UD: + if (HH_OK != THHUL_pdm_alloc_pd_avs_prep(hobul_p->hhul_hndl, + g_sqp_max_avs, PD_NO_FLAGS, &hhul_pd_hndl, pd_ul_resources_p)) + { + status = IB_ERROR; + goto cleanup; + } + break; + + default: if (HH_OK != THHUL_pdm_alloc_pd_prep(hobul_p->hhul_hndl, &hhul_pd_hndl, pd_ul_resources_p)) { status = IB_ERROR; goto cleanup; diff --git a/trunk/inc/iba/ib_types.h b/trunk/inc/iba/ib_types.h index 254aa3ec..022e78a5 100644 --- a/trunk/inc/iba/ib_types.h +++ b/trunk/inc/iba/ib_types.h @@ -7821,7 +7821,8 @@ typedef enum _ib_pd_type { IB_PDT_NORMAL, IB_PDT_ALIAS, - IB_PDT_SQP + IB_PDT_SQP, + IB_PDT_UD } ib_pd_type_t; /* @@ -7834,6 +7835,9 @@ typedef enum _ib_pd_type * * IB_PDT_SQP * Protection domain for special queue pair usage. +* +* IB_PDT_UD +* Protection domain for UD queue pair usage. *****/ diff --git a/trunk/ulp/ipoib/kernel/ipoib_port.c b/trunk/ulp/ipoib/kernel/ipoib_port.c index cbd5f9d7..dce61f27 100644 --- a/trunk/ulp/ipoib/kernel/ipoib_port.c +++ b/trunk/ulp/ipoib/kernel/ipoib_port.c @@ -755,7 +755,7 @@ __ib_mgr_init( /* Allocate the PD. */ status = p_port->p_adapter->p_ifc->alloc_pd( - p_port->ib_mgr.h_ca, IB_PDT_NORMAL, p_port, &p_port->ib_mgr.h_pd ); + p_port->ib_mgr.h_ca, IB_PDT_UD, p_port, &p_port->ib_mgr.h_pd ); if( status != IB_SUCCESS ) { IPOIB_TRACE_EXIT( IPOIB_DBG_ERROR,