diff mbox

opensm/osm_congestion_control.c: Skip TID 0 on 32 bit wraparound

Message ID 5018075D.5030902@dev.mellanox.co.il (mailing list archive)
State Accepted
Delegated to: Alex Netes
Headers show

Commit Message

Hal Rosenstock July 31, 2012, 4:27 p.m. UTC
Signed-off-by: Hal Rosenstock <hal@mellanox.com>
---
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

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;