[ofw] patch: fix the assumption that __cep_mad_send_cb is always being called at dispatch level

Tzachi Dar tzachid at mellanox.co.il
Thu Mar 4 11:06:15 PST 2010


While running some nd tests I have received the assert

CL_ASSERT( KeGetCurrentIrql() == DISPATCH_LEVEL ); al_cm_cep.c line 2218

code stack is bellow.
Since the assumption is not true, but is also assumed in the functions that are called from it I raise the dispatch level to DISPATCH_LEVEL
in this function.

Here is the patch:

Index: al_cm_cep.c
===================================================================
--- al_cm_cep.c (revision 5646)
+++ al_cm_cep.c (working copy)
@@ -2208,10 +2208,13 @@
  KLOCK_QUEUE_HANDLE hdl;
  ib_pfn_destroy_cb_t pfn_destroy_cb;
  void    *cep_context;
+ KIRQL irql;

  AL_ENTER( AL_DBG_CM );
+ UNUSED_PARAM( h_mad_svc );

- UNUSED_PARAM( h_mad_svc );
+ irql = KeRaiseIrqlToDpcLevel();
+
  CL_ASSERT( p_mad->p_next == NULL );
  CL_ASSERT( KeGetCurrentIrql() == DISPATCH_LEVEL );

@@ -2224,6 +2227,7 @@
  {
   ib_put_mad( p_mad );
   AL_EXIT( AL_DBG_CM );
+  KeLowerIrql(irql);
   return;
  }

@@ -2298,6 +2302,7 @@

  if( !cl_atomic_dec( &p_cep->ref_cnt ) && pfn_destroy_cb )
   pfn_destroy_cb( cep_context );
+ KeLowerIrql(irql);
  AL_EXIT( AL_DBG_CM );
 }

Thanks
Tzachi




0: kd> k
Child-SP          RetAddr           Call Site
fffff880`03af71d0 fffff880`04102e20 nt!RtlAssert+0xe8
fffff880`03af76f0 fffff880`040bf834 ibbus!__cep_mad_send_cb+0x120 [q:\projinf3\trunk\core\al\kernel\al_cm_cep.c @ 2216]
fffff880`03af7780 fffff880`040bf0cf ibbus!__notify_send_comp+0x2c4 [q:\projinf3\trunk\core\al\al_mad.c @ 2009]
fffff880`03af77c0 fffff880`040b8ec0 ibbus!__mad_svc_send_done+0x5bf [q:\projinf3\trunk\core\al\al_mad.c @ 1942]
fffff880`03af7810 fffff880`040631a1 ibbus!mad_disp_send_done+0x500 [q:\projinf3\trunk\core\al\al_mad.c @ 867]
fffff880`03af7860 fffff880`04063464 ibbus!__complete_send_mad+0x71 [q:\projinf3\trunk\core\al\kernel\al_smi.c @ 912]
fffff880`03af78d0 fffff880`040d0eb6 ibbus!destroying_spl_qp_svc+0x2b4 [q:\projinf3\trunk\core\al\kernel\al_smi.c @ 975]
fffff880`03af7930 fffff880`040d02f9 ibbus!destroy_obj+0x436 [q:\projinf3\trunk\core\al\al_common.c @ 606]
fffff880`03af7990 fffff880`040604d7 ibbus!async_destroy_obj+0xd9 [q:\projinf3\trunk\core\al\al_common.c @ 477]
fffff880`03af79c0 fffff880`040600d5 ibbus!spl_qp_agent_pnp+0x367 [q:\projinf3\trunk\core\al\kernel\al_smi.c @ 508]
fffff880`03af7a20 fffff880`040b11c5 ibbus!spl_qp1_agent_pnp_cb+0xb5 [q:\projinf3\trunk\core\al\kernel\al_smi.c @ 469]
fffff880`03af7a60 fffff880`040b3a3f ibbus!__pnp_notify_user+0x865 [q:\projinf3\trunk\core\al\kernel\al_pnp.c @ 555]
fffff880`03af7b00 fffff880`040b3be3 ibbus!__pnp_process_remove_port+0x35f [q:\projinf3\trunk\core\al\kernel\al_pnp.c @ 1062]
fffff880`03af7c20 fffff880`0404852f ibbus!__pnp_process_remove_ca+0xc3 [q:\projinf3\trunk\core\al\kernel\al_pnp.c @ 1101]
fffff880`03af7c80 fffff880`0404e505 ibbus!__cl_async_proc_worker+0xbf [q:\projinf3\trunk\core\complib\cl_async_proc.c @ 153]
fffff880`03af7cd0 fffff880`0404f7fc ibbus!__cl_thread_pool_routine+0x75 [q:\projinf3\trunk\core\complib\cl_threadpool.c @ 67]
fffff880`03af7d10 fffff800`01922166 ibbus!__thread_callback+0x3c [q:\projinf3\trunk\core\complib\kernel\cl_thread.c @ 48]
fffff880`03af7d40 fffff800`0165d486 nt!PspSystemThreadStartup+0x5a
fffff880`03af7d80 00000000`00000000 nt!KxStartSystemThread+0x16
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openfabrics.org/pipermail/ofw/attachments/20100304/0d7b9f00/attachment.html>


More information about the ofw mailing list