linux-rdma.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] opensm/osm_congestion_control.c: Skip TID 0 on 32 bit wraparound
@ 2012-07-31 16:27 Hal Rosenstock
  0 siblings, 0 replies; only message in thread
From: Hal Rosenstock @ 2012-07-31 16:27 UTC (permalink / raw)
  To: Alex Netes
  Cc: linux-rdma (linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org),
	Chu, Al


Signed-off-by: Hal Rosenstock <hal-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
---
diff --git a/opensm/osm_congestion_control.c b/opensm/osm_congestion_control.c
index 640f3fa..9a9dfcd 100644
--- a/opensm/osm_congestion_control.c
+++ b/opensm/osm_congestion_control.c
@@ -82,7 +82,12 @@ static void cc_mad_post(osm_congestion_control_t *p_cc,
 	p_cc_mad->header.status = 0;
 	p_cc_mad->header.class_spec = 0;
 	p_cc_mad->header.trans_id =
-		cl_hton64((uint64_t) cl_atomic_inc(&p_cc->trans_id));
+		cl_hton64((uint64_t) cl_atomic_inc(&p_cc->trans_id) &
+			  (uint64_t) (0xFFFFFFFF));
+	if (p_cc_mad->header.trans_id == 0)
+		p_cc_mad->header.trans_id =
+			cl_hton64((uint64_t) cl_atomic_inc(&p_cc->trans_id) &
+				  (uint64_t) (0xFFFFFFFF));
 	p_cc_mad->header.attr_id = attr_id;
 	p_cc_mad->header.resv = 0;
 	p_cc_mad->header.attr_mod = attr_mod;
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2012-07-31 16:27 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-07-31 16:27 [PATCH] opensm/osm_congestion_control.c: Skip TID 0 on 32 bit wraparound Hal Rosenstock

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).