[ofw] Patch: swap the src and dst gids to allow mad replies to return

Tzachi Dar tzachid at mellanox.co.il
Thu Mar 25 09:08:12 PDT 2010


The following patch is needed in order to allow mads with grh to return correctly.

Thanks
Tzachi

Index: al_mad.c
===================================================================
--- al_mad.c (revision 5737)
+++ al_mad.c (working copy)
@@ -335,6 +335,13 @@
  p_mad_element->recv_opt = p_wc->recv.ud.recv_opt;

  p_mad_element->grh_valid = p_wc->recv.ud.recv_opt & IB_RECV_OPT_GRH_VALID;
+ if (p_mad_element->grh_valid) {
+  // swap the src and dst gids to allow replys to return
+  ib_gid_t tmp_gid;
+  tmp_gid = p_mad_element->p_grh1->src_gid;
+  p_mad_element->p_grh1->src_gid = p_mad_element->p_grh1->dest_gid;
+  p_mad_element->p_grh1->dest_gid = tmp_gid;
+ }

  if( p_wc->recv.ud.recv_opt & IB_RECV_OPT_IMMEDIATE )
   p_mad_element->immediate_data = p_wc->recv.ud.immediate_data;
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openfabrics.org/pipermail/ofw/attachments/20100325/771e77f8/attachment.html>


More information about the ofw mailing list