<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=US-ASCII">
<META NAME="Generator" CONTENT="MS Exchange Server version 5.5.2654.45">
<TITLE>RE: [PATCH] query-cq</TITLE>
</HEAD>
<BODY>
<BR>
<BR>
<P><FONT SIZE=2>> -----Original Message-----</FONT>
<BR><FONT SIZE=2>> From: Fab Tillier [<A HREF="mailto:ftillier@silverstorm.com">mailto:ftillier@silverstorm.com</A>] </FONT>
<BR><FONT SIZE=2>> Sent: Tuesday, September 06, 2005 10:41 PM</FONT>
<BR><FONT SIZE=2>> To: 'Yossi Leybovich'</FONT>
<BR><FONT SIZE=2>> Cc: openib-windows@openib.org; Ziv Farjun</FONT>
<BR><FONT SIZE=2>> Subject: RE: [PATCH] query-cq</FONT>
<BR><FONT SIZE=2>> </FONT>
<BR><FONT SIZE=2>> </FONT>
<BR><FONT SIZE=2>> > From: Yossi Leybovich [<A HREF="mailto:sleybo@mellanox.co.il">mailto:sleybo@mellanox.co.il</A>]</FONT>
<BR><FONT SIZE=2>> > Sent: Tuesday, September 06, 2005 7:16 AM</FONT>
<BR><FONT SIZE=2>> > </FONT>
<BR><FONT SIZE=2>> > Hello Fab,</FONT>
<BR><FONT SIZE=2>> ></FONT>
<BR><FONT SIZE=2>> > Attached is a patch for query cq, the patch also includes </FONT>
<BR><FONT SIZE=2>> few checks </FONT>
<BR><FONT SIZE=2>> > to the alts test. Our verification team found that the </FONT>
<BR><FONT SIZE=2>> return size in </FONT>
<BR><FONT SIZE=2>> > query_cq is different from the size that was return in </FONT>
<BR><FONT SIZE=2>> create_cq VERB.</FONT>
<BR><FONT SIZE=2>> > The reason is that when creating cq the THH layer allocate </FONT>
<BR><FONT SIZE=2>> some spare cqes</FONT>
<BR><FONT SIZE=2>> > (for DB coalsing) and return the size that was requested by the user</FONT>
<BR><FONT SIZE=2>> > But the query_cq IOCTL use the kernel tables for the size </FONT>
<BR><FONT SIZE=2>> which use the actual</FONT>
<BR><FONT SIZE=2>> > size (usually a bigger size).</FONT>
<BR><FONT SIZE=2>> </FONT>
<BR><FONT SIZE=2>> Isn't the bigger size the correct one to return? This seems </FONT>
<BR><FONT SIZE=2>> to be what current verb implementations do, and what the IB </FONT>
<BR><FONT SIZE=2>> spec suggests. If it isn't, don't kernel clients end up </FONT>
<BR><FONT SIZE=2>> getting the wrong value when they query their CQ size?</FONT>
</P>
<P><FONT SIZE=2>The size that was requested is the size that should be return by the query\create (both in kernel and driver),</FONT>
<BR><FONT SIZE=2>This enable the driver to use the DB caolsing mechanism.</FONT>
<BR><FONT SIZE=2>Both Kernel/User create_cq should return this size:</FONT>
<BR><FONT SIZE=2> </FONT>
<BR><FONT SIZE=2>*num_o_cqes_p= (1U << new_cq->cur_buf.log2_num_o_cqes) - 1 -</FONT>
<BR><FONT SIZE=2> new_cq->cur_buf.spare_cqes;</FONT>
</P>
<P><FONT SIZE=2>You can see the poll4wc how we use the spare cqes to save DBs</FONT>
</P>
<P><FONT SIZE=2>> </FONT>
<BR><FONT SIZE=2>> The value should be the same as what was returned in the call </FONT>
<BR><FONT SIZE=2>> to create_cq, which is </FONT>
<BR><FONT SIZE=2>> (hw\mt23108\vapi\Hca\hcahal\tavor\thhul_cqm\thhul_cqm.c@890):</FONT>
<BR><FONT SIZE=2>> </FONT>
<BR><FONT SIZE=2>> *num_o_cqes_p= (1U << new_cq->cur_buf.log2_num_o_cqes) - 1 -</FONT>
<BR><FONT SIZE=2>> new_cq->cur_buf.spare_cqes;</FONT>
<BR><FONT SIZE=2>> </FONT>
<BR><FONT SIZE=2>> If the kernel clients get fixed, then the user-mode clients </FONT>
<BR><FONT SIZE=2>> automatically get the right value and we only need to update </FONT>
<BR><FONT SIZE=2>> the ALTS test.</FONT>
</P>
<P><FONT SIZE=2>The issue is that for UL CQ the kernel get the final size </FONT>
<BR><FONT SIZE=2>so the query shouldn't move to kernel but finish in the user level (the kernel does not know about the spare cqes)</FONT>
</P>
<P><FONT SIZE=2>I attached patch that return the correct size also in CQs that were created in kernel.(+ the previous changes)</FONT>
</P>
<P><FONT SIZE=2>I didn't manage to test it because I could not make alts work in kernel ( BTW Is alts work at kernel level ? How ? )</FONT>
</P>
<P><FONT SIZE=2>Thanks</FONT>
<BR><FONT SIZE=2>Yossi </FONT>
</P>
<BR>
<P><FONT SIZE=2>Singed-off-by: Yossi Leybovich (sleyboMellanox.co.il)</FONT>
</P>
<P><FONT SIZE=2>Index: core/al/user/ual_cq.c</FONT>
<BR><FONT SIZE=2>===================================================================</FONT>
<BR><FONT SIZE=2>--- core/al/user/ual_cq.c (revision 351)</FONT>
<BR><FONT SIZE=2>+++ core/al/user/ual_cq.c (working copy)</FONT>
<BR><FONT SIZE=2>@@ -306,13 +306,24 @@</FONT>
<BR><FONT SIZE=2> {</FONT>
<BR><FONT SIZE=2> /* Pre call to the UVP library */</FONT>
<BR><FONT SIZE=2> status = uvp_intf.pre_query_cq( h_cq->h_ci_cq, &cq_ioctl.in.umv_buf );</FONT>
<BR><FONT SIZE=2>- if( status != IB_SUCCESS )</FONT>
<BR><FONT SIZE=2>+ if( status == IB_VERBS_PROCESSING_DONE )</FONT>
<BR><FONT SIZE=2> {</FONT>
<BR><FONT SIZE=2>+ /* Creation is done entirely in user mode. Issue the post call */</FONT>
<BR><FONT SIZE=2>+ if( uvp_intf.post_query_cq)</FONT>
<BR><FONT SIZE=2>+ {</FONT>
<BR><FONT SIZE=2>+ uvp_intf.post_query_cq( h_cq->h_ci_cq,</FONT>
<BR><FONT SIZE=2>+ IB_SUCCESS, p_size, &cq_ioctl.out.umv_buf );</FONT>
<BR><FONT SIZE=2>+ }</FONT>
<BR><FONT SIZE=2> AL_EXIT( AL_DBG_CQ );</FONT>
<BR><FONT SIZE=2>+ return IB_SUCCESS;</FONT>
<BR><FONT SIZE=2>+ }</FONT>
<BR><FONT SIZE=2>+ else if( status != IB_SUCCESS )</FONT>
<BR><FONT SIZE=2>+ {</FONT>
<BR><FONT SIZE=2>+ AL_EXIT( AL_DBG_CQ );</FONT>
<BR><FONT SIZE=2> return status;</FONT>
<BR><FONT SIZE=2> }</FONT>
<BR><FONT SIZE=2> }</FONT>
<BR><FONT SIZE=2>-</FONT>
<BR><FONT SIZE=2>+ </FONT>
<BR><FONT SIZE=2> cq_ioctl.in.h_cq = h_cq->obj.hdl;</FONT>
<BR><FONT SIZE=2> </FONT>
<BR><FONT SIZE=2> cl_status = do_al_dev_ioctl( UAL_QUERY_CQ,</FONT>
<BR><FONT SIZE=2>@@ -329,17 +340,18 @@</FONT>
<BR><FONT SIZE=2> else</FONT>
<BR><FONT SIZE=2> {</FONT>
<BR><FONT SIZE=2> status = cq_ioctl.out.status;</FONT>
<BR><FONT SIZE=2>- if( status == IB_SUCCESS )</FONT>
<BR><FONT SIZE=2>- *p_size = cq_ioctl.out.size;</FONT>
<BR><FONT SIZE=2> }</FONT>
<BR><FONT SIZE=2> </FONT>
<BR><FONT SIZE=2> /* Post uvp call */</FONT>
<BR><FONT SIZE=2> if( h_cq->h_ci_cq && uvp_intf.post_query_cq )</FONT>
<BR><FONT SIZE=2> {</FONT>
<BR><FONT SIZE=2> uvp_intf.post_query_cq( h_cq->h_ci_cq,</FONT>
<BR><FONT SIZE=2>- status, cq_ioctl.out.size, &cq_ioctl.out.umv_buf );</FONT>
<BR><FONT SIZE=2>+ status, &cq_ioctl.out.size, &cq_ioctl.out.umv_buf );</FONT>
<BR><FONT SIZE=2> }</FONT>
<BR><FONT SIZE=2> </FONT>
<BR><FONT SIZE=2>+ if( status == IB_SUCCESS )</FONT>
<BR><FONT SIZE=2>+ *p_size = cq_ioctl.out.size;</FONT>
<BR><FONT SIZE=2>+ </FONT>
<BR><FONT SIZE=2> AL_EXIT( AL_DBG_CQ );</FONT>
<BR><FONT SIZE=2> return status;</FONT>
<BR><FONT SIZE=2> }</FONT>
<BR><FONT SIZE=2>Index: hw/mt23108/kernel/hca_verbs.c</FONT>
<BR><FONT SIZE=2>===================================================================</FONT>
<BR><FONT SIZE=2>--- hw/mt23108/kernel/hca_verbs.c (revision 351)</FONT>
<BR><FONT SIZE=2>+++ hw/mt23108/kernel/hca_verbs.c (working copy)</FONT>
<BR><FONT SIZE=2>@@ -2119,7 +2119,7 @@</FONT>
<BR><FONT SIZE=2> ib_api_status_t status;</FONT>
<BR><FONT SIZE=2> </FONT>
<BR><FONT SIZE=2> u_int32_t hca_idx = CQ_HCA_FROM_HNDL(h_cq);</FONT>
<BR><FONT SIZE=2>- u_int32_t cq_num = CQ_NUM_FROM_HNDL(h_cq);</FONT>
<BR><FONT SIZE=2>+ u_int32_t cq_num = CQ_NUM_FROM_HNDL(h_cq); </FONT>
<BR><FONT SIZE=2> u_int32_t cq_idx;</FONT>
<BR><FONT SIZE=2> mlnx_hobul_t *hobul_p;</FONT>
<BR><FONT SIZE=2> HHUL_cq_hndl_t hhul_cq_hndl;</FONT>
<BR><FONT SIZE=2>@@ -2130,25 +2130,26 @@</FONT>
<BR><FONT SIZE=2> status = IB_INVALID_PARAMETER;</FONT>
<BR><FONT SIZE=2> goto cleanup;</FONT>
<BR><FONT SIZE=2> }</FONT>
<BR><FONT SIZE=2>+</FONT>
<BR><FONT SIZE=2> VALIDATE_INDEX(hca_idx, MLNX_MAX_HCA, IB_INVALID_CQ_HANDLE, cleanup);</FONT>
<BR><FONT SIZE=2> hobul_p = mlnx_hobul_array[hca_idx];</FONT>
<BR><FONT SIZE=2> if (NULL == hobul_p) {</FONT>
<BR><FONT SIZE=2> status = IB_INVALID_CQ_HANDLE;</FONT>
<BR><FONT SIZE=2> goto cleanup;</FONT>
<BR><FONT SIZE=2> }</FONT>
<BR><FONT SIZE=2>-</FONT>
<BR><FONT SIZE=2>+ </FONT>
<BR><FONT SIZE=2> cq_idx = cq_num & hobul_p->cq_idx_mask;</FONT>
<BR><FONT SIZE=2> VALIDATE_INDEX(cq_idx, hobul_p->max_cq, IB_INVALID_CQ_HANDLE, cleanup);</FONT>
<BR><FONT SIZE=2> if ( E_MARK_CQ != hobul_p->cq_info_tbl[cq_idx].mark) {</FONT>
<BR><FONT SIZE=2> status = IB_INVALID_CQ_HANDLE;</FONT>
<BR><FONT SIZE=2> goto cleanup;</FONT>
<BR><FONT SIZE=2>- }</FONT>
<BR><FONT SIZE=2>+ } </FONT>
<BR><FONT SIZE=2> </FONT>
<BR><FONT SIZE=2> cl_mutex_acquire(&hobul_p->cq_info_tbl[cq_idx].mutex);</FONT>
<BR><FONT SIZE=2> </FONT>
<BR><FONT SIZE=2> hhul_cq_hndl = hobul_p->cq_info_tbl[cq_idx].hhul_cq_hndl;</FONT>
<BR><FONT SIZE=2>-</FONT>
<BR><FONT SIZE=2>- if (HH_OK != THH_hob_query_cq(hobul_p->hh_hndl, cq_num, p_size)) {</FONT>
<BR><FONT SIZE=2>+ if (HH_OK != THHUL_cqm_query_cq(hobul_p->hhul_hndl, hhul_cq_hndl, p_size)){</FONT>
<BR><FONT SIZE=2>+// if (HH_OK != THH_hob_query_cq(hobul_p->hh_hndl, cq_num, p_size)) {</FONT>
<BR><FONT SIZE=2> status = IB_ERROR;</FONT>
<BR><FONT SIZE=2> goto cleanup_locked;</FONT>
<BR><FONT SIZE=2> }</FONT>
<BR><FONT SIZE=2>Index: hw/mt23108/user/mlnx_ual_cq.c</FONT>
<BR><FONT SIZE=2>===================================================================</FONT>
<BR><FONT SIZE=2>--- hw/mt23108/user/mlnx_ual_cq.c (revision 351)</FONT>
<BR><FONT SIZE=2>+++ hw/mt23108/user/mlnx_ual_cq.c (working copy)</FONT>
<BR><FONT SIZE=2>@@ -48,8 +48,8 @@</FONT>
<BR><FONT SIZE=2> p_uvp->pre_create_cq = mlnx_pre_create_cq;</FONT>
<BR><FONT SIZE=2> p_uvp->post_create_cq = mlnx_post_create_cq;</FONT>
<BR><FONT SIZE=2> </FONT>
<BR><FONT SIZE=2>- p_uvp->pre_query_cq = NULL;</FONT>
<BR><FONT SIZE=2>- p_uvp->post_query_cq = NULL;</FONT>
<BR><FONT SIZE=2>+ p_uvp->pre_query_cq = mlnx_pre_query_cq;</FONT>
<BR><FONT SIZE=2>+ p_uvp->post_query_cq = mlnx_post_query_cq;</FONT>
<BR><FONT SIZE=2> </FONT>
<BR><FONT SIZE=2> p_uvp->pre_resize_cq = mlnx_pre_resize_cq;</FONT>
<BR><FONT SIZE=2> p_uvp->post_resize_cq = mlnx_post_resize_cq;</FONT>
<BR><FONT SIZE=2>@@ -441,22 +441,37 @@</FONT>
<BR><FONT SIZE=2> CL_ASSERT(p_umv_buf);</FONT>
<BR><FONT SIZE=2> p_umv_buf->command = TRUE;</FONT>
<BR><FONT SIZE=2> FUNC_EXIT;</FONT>
<BR><FONT SIZE=2>- return IB_SUCCESS;</FONT>
<BR><FONT SIZE=2>+ return IB_VERBS_PROCESSING_DONE;</FONT>
<BR><FONT SIZE=2> }</FONT>
<BR><FONT SIZE=2> </FONT>
<BR><FONT SIZE=2> </FONT>
<BR><FONT SIZE=2> void</FONT>
<BR><FONT SIZE=2> mlnx_post_query_cq (</FONT>
<BR><FONT SIZE=2>- IN const ib_cq_handle_t h_uvp_cq,</FONT>
<BR><FONT SIZE=2>- IN ib_api_status_t ioctl_status,</FONT>
<BR><FONT SIZE=2>- IN OUT ci_umv_buf_t *p_umv_buf)</FONT>
<BR><FONT SIZE=2>+ IN const ib_cq_handle_t h_uvp_cq,</FONT>
<BR><FONT SIZE=2>+ IN ib_api_status_t ioctl_status,</FONT>
<BR><FONT SIZE=2>+ IN OUT uint32_t* const p_size,</FONT>
<BR><FONT SIZE=2>+ IN ci_umv_buf_t *p_umv_buf)</FONT>
<BR><FONT SIZE=2> {</FONT>
<BR><FONT SIZE=2>+ ib_api_status_t status;</FONT>
<BR><FONT SIZE=2>+ mlnx_ual_cq_info_t *p_cq_info = (mlnx_ual_cq_info_t *)((void*) h_uvp_cq);</FONT>
<BR><FONT SIZE=2>+</FONT>
<BR><FONT SIZE=2> FUNC_ENTER;</FONT>
<BR><FONT SIZE=2>+ CL_ASSERT(p_umv_buf);</FONT>
<BR><FONT SIZE=2>+ CL_ASSERT(p_cq_info);</FONT>
<BR><FONT SIZE=2>+</FONT>
<BR><FONT SIZE=2>+ status = ioctl_status;</FONT>
<BR><FONT SIZE=2>+ if (status == IB_SUCCESS)</FONT>
<BR><FONT SIZE=2>+ {</FONT>
<BR><FONT SIZE=2>+ *p_size = p_cq_info->cq_size;</FONT>
<BR><FONT SIZE=2>+</FONT>
<BR><FONT SIZE=2>+ status = IB_VERBS_PROCESSING_DONE;</FONT>
<BR><FONT SIZE=2>+ }</FONT>
<BR><FONT SIZE=2>+ </FONT>
<BR><FONT SIZE=2> FUNC_EXIT;</FONT>
<BR><FONT SIZE=2>- return;</FONT>
<BR><FONT SIZE=2>+ return; </FONT>
<BR><FONT SIZE=2> }</FONT>
<BR><FONT SIZE=2>+ </FONT>
<BR><FONT SIZE=2> </FONT>
<BR><FONT SIZE=2>-</FONT>
<BR><FONT SIZE=2> ib_api_status_t</FONT>
<BR><FONT SIZE=2> mlnx_pre_destroy_cq (</FONT>
<BR><FONT SIZE=2> IN const ib_cq_handle_t h_uvp_cq)</FONT>
<BR><FONT SIZE=2>Index: hw/mt23108/user/mlnx_ual_main.h</FONT>
<BR><FONT SIZE=2>===================================================================</FONT>
<BR><FONT SIZE=2>--- hw/mt23108/user/mlnx_ual_main.h (revision 351)</FONT>
<BR><FONT SIZE=2>+++ hw/mt23108/user/mlnx_ual_main.h (working copy)</FONT>
<BR><FONT SIZE=2>@@ -257,6 +257,7 @@</FONT>
<BR><FONT SIZE=2> mlnx_post_query_cq (</FONT>
<BR><FONT SIZE=2> IN const ib_cq_handle_t h_uvp_cq,</FONT>
<BR><FONT SIZE=2> IN ib_api_status_t ioctl_status,</FONT>
<BR><FONT SIZE=2>+ IN OUT uint32_t* const p_size,</FONT>
<BR><FONT SIZE=2> IN OUT ci_umv_buf_t *p_umv_buf);</FONT>
<BR><FONT SIZE=2> </FONT>
<BR><FONT SIZE=2> ib_api_status_t </FONT>
<BR><FONT SIZE=2>Index: hw/mt23108/vapi/Hca/hcahal/hhul.h</FONT>
<BR><FONT SIZE=2>===================================================================</FONT>
<BR><FONT SIZE=2>--- hw/mt23108/vapi/Hca/hcahal/hhul.h (revision 351)</FONT>
<BR><FONT SIZE=2>+++ hw/mt23108/vapi/Hca/hcahal/hhul.h (working copy)</FONT>
<BR><FONT SIZE=2>@@ -229,6 +229,10 @@</FONT>
<BR><FONT SIZE=2> VAPI_cqe_num_t cqe_num);</FONT>
<BR><FONT SIZE=2> </FONT>
<BR><FONT SIZE=2> </FONT>
<BR><FONT SIZE=2>+ HH_ret_t (*HHULIF_query_cq)(HHUL_hca_hndl_t hca_hndl,</FONT>
<BR><FONT SIZE=2>+ HHUL_cq_hndl_t cq,</FONT>
<BR><FONT SIZE=2>+ VAPI_cqe_num_t* num_o_cqes_p);</FONT>
<BR><FONT SIZE=2>+</FONT>
<BR><FONT SIZE=2> HH_ret_t (*HHULIF_req_comp_notif)(HHUL_hca_hndl_t hca_hndl,</FONT>
<BR><FONT SIZE=2> HHUL_cq_hndl_t cq,</FONT>
<BR><FONT SIZE=2> VAPI_cq_notif_type_t notif_type);</FONT>
<BR><FONT SIZE=2>Index: hw/mt23108/vapi/Hca/hcahal/tavor/thhul_cqm/thhul_cqm.c</FONT>
<BR><FONT SIZE=2>===================================================================</FONT>
<BR><FONT SIZE=2>--- hw/mt23108/vapi/Hca/hcahal/tavor/thhul_cqm/thhul_cqm.c (revision 351)</FONT>
<BR><FONT SIZE=2>+++ hw/mt23108/vapi/Hca/hcahal/tavor/thhul_cqm/thhul_cqm.c (working copy)</FONT>
<BR><FONT SIZE=2>@@ -1540,14 +1540,14 @@</FONT>
<BR><FONT SIZE=2> THHUL_cqm_count_cqe( </FONT>
<BR><FONT SIZE=2> IN HHUL_hca_hndl_t hca_hndl,</FONT>
<BR><FONT SIZE=2> IN HHUL_cq_hndl_t cq,</FONT>
<BR><FONT SIZE=2>- OUT uint32_t* const p_n_cqes )</FONT>
<BR><FONT SIZE=2>+ OUT uint32_t* const p_n_cqes )</FONT>
<BR><FONT SIZE=2> {</FONT>
<BR><FONT SIZE=2> THHUL_cq_t *cq_p= (THHUL_cq_t*)cq;</FONT>
<BR><FONT SIZE=2> VAPI_cqe_num_t cqe_num;</FONT>
<BR><FONT SIZE=2> </FONT>
<BR><FONT SIZE=2> /* parameters checks */</FONT>
<BR><FONT SIZE=2> if (cq_p == NULL) {</FONT>
<BR><FONT SIZE=2>- MTL_ERROR1("THHUL_cqm_peek_cq: NULL CQ handle.\n");</FONT>
<BR><FONT SIZE=2>+ MTL_ERROR1("THHUL_cqm_count_cqe: NULL CQ handle.\n");</FONT>
<BR><FONT SIZE=2> return IB_INVALID_CQ_HANDLE;</FONT>
<BR><FONT SIZE=2> }</FONT>
<BR><FONT SIZE=2> </FONT>
<BR><FONT SIZE=2>@@ -1608,6 +1608,31 @@</FONT>
<BR><FONT SIZE=2> }</FONT>
<BR><FONT SIZE=2> </FONT>
<BR><FONT SIZE=2> </FONT>
<BR><FONT SIZE=2>+</FONT>
<BR><FONT SIZE=2>+HH_ret_t THHUL_cqm_query_cq( </FONT>
<BR><FONT SIZE=2>+ /*IN*/ HHUL_hca_hndl_t hca_hndl, </FONT>
<BR><FONT SIZE=2>+ /*IN*/ HHUL_cq_hndl_t cq, </FONT>
<BR><FONT SIZE=2>+ /*OUT*/ VAPI_cqe_num_t *num_o_cqes_p)</FONT>
<BR><FONT SIZE=2>+{</FONT>
<BR><FONT SIZE=2>+ THHUL_cq_t *cq_p= (THHUL_cq_t*)cq;</FONT>
<BR><FONT SIZE=2>+ HH_ret_t ret=HH_OK;</FONT>
<BR><FONT SIZE=2>+</FONT>
<BR><FONT SIZE=2>+</FONT>
<BR><FONT SIZE=2>+ /* parameters checks */</FONT>
<BR><FONT SIZE=2>+ if (cq_p == NULL) {</FONT>
<BR><FONT SIZE=2>+ MTL_ERROR1("THHUL_cqm_query_cq: NULL CQ handle.\n");</FONT>
<BR><FONT SIZE=2>+ return HH_EINVAL_CQ_HNDL;</FONT>
<BR><FONT SIZE=2>+ }</FONT>
<BR><FONT SIZE=2>+</FONT>
<BR><FONT SIZE=2>+ /* Find CQE and check ownership */</FONT>
<BR><FONT SIZE=2>+ MOSAL_spinlock_dpc_lock(&(cq_p->cq_lock));</FONT>
<BR><FONT SIZE=2>+ *num_o_cqes_p= ((1U << cq_p->cur_buf.log2_num_o_cqes) -1 - cq_p->cur_buf.spare_cqes) ;</FONT>
<BR><FONT SIZE=2>+ </FONT>
<BR><FONT SIZE=2>+ MOSAL_spinlock_unlock(&(cq_p->cq_lock)); </FONT>
<BR><FONT SIZE=2>+</FONT>
<BR><FONT SIZE=2>+ return ret; </FONT>
<BR><FONT SIZE=2>+}</FONT>
<BR><FONT SIZE=2>+</FONT>
<BR><FONT SIZE=2> static void rearm_cq(THHUL_cq_t *cq_p, MT_bool solicitedNotification) {</FONT>
<BR><FONT SIZE=2> volatile u_int32_t chimeWords[2];</FONT>
<BR><FONT SIZE=2> THH_uar_t uar = cq_p->uar;</FONT>
<BR><FONT SIZE=2>Index: hw/mt23108/vapi/Hca/hcahal/tavor/thhul_cqm/thhul_cqm.h</FONT>
<BR><FONT SIZE=2>===================================================================</FONT>
<BR><FONT SIZE=2>--- hw/mt23108/vapi/Hca/hcahal/tavor/thhul_cqm/thhul_cqm.h (revision 351)</FONT>
<BR><FONT SIZE=2>+++ hw/mt23108/vapi/Hca/hcahal/tavor/thhul_cqm/thhul_cqm.h (working copy)</FONT>
<BR><FONT SIZE=2>@@ -107,9 +107,15 @@</FONT>
<BR><FONT SIZE=2> THHUL_cqm_count_cqe( </FONT>
<BR><FONT SIZE=2> IN HHUL_hca_hndl_t hca_hndl,</FONT>
<BR><FONT SIZE=2> IN HHUL_cq_hndl_t cq,</FONT>
<BR><FONT SIZE=2>- OUT uint32_t* const p_n_cqes );</FONT>
<BR><FONT SIZE=2>+ OUT uint32_t* const p_n_cqes );</FONT>
<BR><FONT SIZE=2> #endif</FONT>
<BR><FONT SIZE=2> </FONT>
<BR><FONT SIZE=2>+DLL_API HH_ret_t THHUL_cqm_query_cq( </FONT>
<BR><FONT SIZE=2>+ /*IN*/ HHUL_hca_hndl_t hca_hndl, </FONT>
<BR><FONT SIZE=2>+ /*IN*/ HHUL_cq_hndl_t cq, </FONT>
<BR><FONT SIZE=2>+/*OUT*/ VAPI_cqe_num_t *num_o_cqes_p</FONT>
<BR><FONT SIZE=2>+);</FONT>
<BR><FONT SIZE=2>+</FONT>
<BR><FONT SIZE=2> DLL_API HH_ret_t THHUL_cqm_peek_cq( </FONT>
<BR><FONT SIZE=2> /*IN*/ HHUL_hca_hndl_t hca_hndl, </FONT>
<BR><FONT SIZE=2> /*IN*/ HHUL_cq_hndl_t cq, </FONT>
<BR><FONT SIZE=2>Index: hw/mt23108/vapi/Hca/hcahal/tavor/thhul_hob/thhul_hob.c</FONT>
<BR><FONT SIZE=2>===================================================================</FONT>
<BR><FONT SIZE=2>--- hw/mt23108/vapi/Hca/hcahal/tavor/thhul_hob/thhul_hob.c (revision 351)</FONT>
<BR><FONT SIZE=2>+++ hw/mt23108/vapi/Hca/hcahal/tavor/thhul_hob/thhul_hob.c (working copy)</FONT>
<BR><FONT SIZE=2>@@ -86,6 +86,7 @@</FONT>
<BR><FONT SIZE=2> NULL /* HHULIF_poll4cqe */,</FONT>
<BR><FONT SIZE=2> NULL /* HHULIF_poll_and_rearm_cq */, </FONT>
<BR><FONT SIZE=2> THHUL_cqm_peek_cq /* HHULIF_peek_cq */,</FONT>
<BR><FONT SIZE=2>+ THHUL_cqm_query_cq /* HHULIF_query_cq */,</FONT>
<BR><FONT SIZE=2> THHUL_cqm_req_comp_notif /* HHULIF_req_comp_notif */,</FONT>
<BR><FONT SIZE=2> THHUL_cqm_req_ncomp_notif /* HHULIF_req_ncomp_notif */,</FONT>
<BR><FONT SIZE=2> THHUL_cqm_destroy_cq_done /* HHULIF_destroy_cq_done */,</FONT>
<BR><FONT SIZE=2>Index: inc/user/iba/ib_uvp.h</FONT>
<BR><FONT SIZE=2>===================================================================</FONT>
<BR><FONT SIZE=2>--- inc/user/iba/ib_uvp.h (revision 351)</FONT>
<BR><FONT SIZE=2>+++ inc/user/iba/ib_uvp.h (working copy)</FONT>
<BR><FONT SIZE=2>@@ -1789,7 +1789,7 @@</FONT>
<BR><FONT SIZE=2> (AL_API *uvp_post_query_cq_t) (</FONT>
<BR><FONT SIZE=2> IN const ib_cq_handle_t h_uvp_cq,</FONT>
<BR><FONT SIZE=2> IN ib_api_status_t ioctl_status,</FONT>
<BR><FONT SIZE=2>- IN const uint32_t size,</FONT>
<BR><FONT SIZE=2>+ IN OUT uint32_t *size,</FONT>
<BR><FONT SIZE=2> IN ci_umv_buf_t *p_umv_buf );</FONT>
<BR><FONT SIZE=2> </FONT>
<BR><FONT SIZE=2> /*</FONT>
<BR><FONT SIZE=2>@@ -1803,7 +1803,7 @@</FONT>
<BR><FONT SIZE=2> * ioctl_status</FONT>
<BR><FONT SIZE=2> * [in] The ioctl status of the AL API.</FONT>
<BR><FONT SIZE=2> * size</FONT>
<BR><FONT SIZE=2>-* [in] The size of the CQ retuned by the IOCTL.</FONT>
<BR><FONT SIZE=2>+* [in out] On input size of the CQ retuned by the IOCTL.</FONT>
<BR><FONT SIZE=2> * p_umv_buf</FONT>
<BR><FONT SIZE=2> * [in out] On input, it contains any vendor-specific private information</FONT>
<BR><FONT SIZE=2> * exchanged with the vendor's Verbs Provider Driver (uvp_pre_query_cq).</FONT>
</P>
<P><FONT FACE="Arial" SIZE=2 COLOR="#000000"></FONT>
</BODY>
</HTML>