[Openib-windows] [PATCH] cq_checks

Yossi Leybovich sleybo at mellanox.co.il
Mon Apr 17 03:58:02 PDT 2006


Fab
 
Our regression tests run on verios scenarios of bad flows 
This patch add few sanity checks to destroy/creat cq verbs.

1. check that whendestroy CQ all attached QPs were destroy
2. CQ size not bigger then ca max_cqe

This will enable our tests to run over more cases and more smoothly.
 
pls review
 
10x
Yossi 
 
Index: core/al/al_cq.c
===================================================================
--- core/al/al_cq.c (revision 1260)
+++ core/al/al_cq.c (working copy)
@@ -83,6 +83,12 @@
   return IB_INVALID_SETTING;
  }
 
+ if( p_cq_create->size > h_ca->obj.p_ci_ca->p_pnp_attr->max_cqes)
+ {
+  CL_TRACE_EXIT( AL_DBG_ERROR, g_al_dbg_lvl, ("IB_INVALID_CQ_SIZE\n")
);
+  return IB_INVALID_CQ_SIZE;
+ }
+
  h_cq = cl_zalloc( sizeof( ib_cq_t ) );
  if( !h_cq )
  {
@@ -161,6 +167,11 @@
   return IB_INVALID_CQ_HANDLE;
  }
 
+ if(h_cq->qp_list.count != 0)
+ {
+  CL_TRACE_EXIT( AL_DBG_ERROR, g_al_dbg_lvl, ("IB_RESOURCE_BUSY\n") );
+  return IB_RESOURCE_BUSY;
+ }
  ref_al_obj( &h_cq->obj );
  h_cq->obj.pfn_destroy( &h_cq->obj, pfn_destroy_cb );
 
Index: inc/iba/ib_al.h
===================================================================
--- inc/iba/ib_al.h (revision 1260)
+++ inc/iba/ib_al.h (working copy)
@@ -1707,6 +1707,9 @@
 * IB_INVALID_CQ_HANDLE
 *  The completion queue handle was invalid.
 *
+* IB_RESOURCE_BUSY
+*  There are still queue pairs associated with the completion queue.
+*
 * NOTES
 * This call destroys an existing completion queue.  Since callbacks may
be
 * outstanding against the completion queue at the time the destroy
operation

-------------- next part --------------
A non-text attachment was scrubbed...
Name: cq_checks.patch
Type: application/octet-stream
Size: 1295 bytes
Desc: cq_checks.patch
URL: <http://lists.openfabrics.org/pipermail/ofw/attachments/20060417/65675114/attachment.obj>


More information about the ofw mailing list