[openib-general] [PATCH] ib_mad: Eliminate ib_tid union

Hal Rosenstock halr at voltaire.com
Wed Oct 6 10:45:17 PDT 2004


ib_mad: Eliminate ib_tid union

Index: access/ib_mad_priv.h
===================================================================
--- access/ib_mad_priv.h	(revision 942)
+++ access/ib_mad_priv.h	(working copy)
@@ -119,7 +119,7 @@
 	struct list_head agent_send_list;
 	struct ib_mad_agent *agent;
 	u64 wr_id;			/* client WR ID */
-	union ib_tid tid;
+	u64 tid;
 	int timeout_ms;
 	int refcount;
 	enum ib_wc_status status;
Index: access/ib_mad.c
===================================================================
--- access/ib_mad.c	(revision 940)
+++ access/ib_mad.c	(working copy)
@@ -344,7 +344,7 @@
 			return -ENOMEM;	
 		}
 
-		mad_send_wr->tid.id = send_wr->wr.ud.mad->mad_hdr.tid.id;
+		mad_send_wr->tid = send_wr->wr.ud.mad->mad_hdr.tid;
 		mad_send_wr->agent = mad_agent;
 		mad_send_wr->timeout_ms = cur_send_wr->wr.ud.timeout_ms;
 		if (mad_send_wr->timeout_ms)
@@ -682,7 +682,7 @@
 	/* Whether MAD was solicited determines type of routing to MAD client
*/
 	if (solicited) {
 		/* Routing is based on high 32 bits of transaction ID of MAD  */
-		hi_tid = be32_to_cpu(mad->mad_hdr.tid.tid_field.hi_tid);
+		hi_tid = be64_to_cpu(mad->mad_hdr.tid) >> 32;
 		list_for_each_entry(entry, &port_priv->agent_list, agent_list) {
 			if (entry->agent.hi_tid == hi_tid) {
 				mad_agent = entry;
@@ -764,7 +764,7 @@
 	list_for_each_entry(mad_send_wr, &mad_agent_priv->send_list,
 			    agent_send_list) {
 
-		if (mad_send_wr->tid.id == tid) {
+		if (mad_send_wr->tid == tid) {
 			/* Verify request is still valid */
 			if (mad_send_wr->status == IB_WC_SUCCESS &&
 			    mad_send_wr->timeout_ms)
@@ -793,7 +793,7 @@
 	if (solicited) {
 		spin_lock_irqsave(&mad_agent_priv->send_list_lock, flags);
 		mad_send_wr = find_send_req(mad_agent_priv,
-					    recv->mad.mad.mad_hdr.tid.id);
+					    recv->mad.mad.mad_hdr.tid);
 		if (!mad_send_wr) {
 			spin_unlock_irqrestore(&mad_agent_priv->send_list_lock,
 					       flags);
Index: include/ib_mad.h
===================================================================
--- include/ib_mad.h	(revision 943)
+++ include/ib_mad.h	(working copy)
@@ -69,14 +69,6 @@
 	union ib_gid	dgid;
 } __attribute__ ((packed));
 
-union ib_tid {
-	u64	id;
-	struct {
-		u32	hi_tid;
-		u32	lo_tid;
-	} tid_field;
-};
-
 struct ib_mad_hdr {
 	u8	base_version;
 	u8	mgmt_class;
@@ -84,7 +76,7 @@
 	u8	method;
 	u16	status;
 	u16	class_specific;
-	union ib_tid tid;
+	u64	tid;
 	u16	attr_id;
 	u16	resv;
 	u32	attr_mod;
Index: include/ib_smi.h
===================================================================
--- include/ib_smi.h	(revision 935)
+++ include/ib_smi.h	(working copy)
@@ -41,7 +41,7 @@
 	u16	status;
 	u8	hop_ptr;
 	u8	hop_cnt;
-	union ib_tid tid;
+	u64	tid;
 	u16	attr_id;
 	u16	resv;
 	u32	attr_mod;






More information about the general mailing list