[openib-general] [PATCH] OpenSM/osm_resp.c: In osm_resp_make_resp_smp, set direction bit only if direct routed class

Hal Rosenstock halr at voltaire.com
Mon Aug 14 11:46:10 PDT 2006


OpenSM/osm_resp.c: In osm_resp_make_resp_smp, set direction bit only if
direct routed class

This change fixes two minor issues with osm_resp_make_resp_smp: 
1. Get/Set responses always had direction bit set. 
2. Trap represses never had direction bit set.

The direction bit needs setting in direct routed responses and it
doesn't exist in LID routed responses.

Signed-off-by: Hal Rosenstock <halr at voltaire.com>

Index: opensm/osm_resp.c
===================================================================
--- opensm/osm_resp.c	(revision 8931)
+++ opensm/osm_resp.c	(working copy)
@@ -127,7 +127,7 @@ osm_resp_make_resp_smp(
   if (p_src_smp->method == IB_MAD_METHOD_GET ||
       p_src_smp->method == IB_MAD_METHOD_SET ) {
     p_dest_smp->method = IB_MAD_METHOD_GET_RESP;
-    p_dest_smp->status = (ib_net16_t)(status | IB_SMP_DIRECTION);
+    p_dest_smp->status = status;
   }
   else if (p_src_smp->method == IB_MAD_METHOD_TRAP)
   {
@@ -143,6 +143,9 @@ osm_resp_make_resp_smp(
     goto Exit;
   }
 
+  if (p_src_smp->mgmt_class == IB_MCLASS_SUBN_DIR)
+    p_dest_smp->status |= IB_SMP_DIRECTION;
+
   p_dest_smp->dr_dlid = p_dest_smp->dr_slid;
   p_dest_smp->dr_slid = p_dest_smp->dr_dlid;
   memcpy( &p_dest_smp->data, p_payload, IB_SMP_DATA_SIZE );







More information about the general mailing list