All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH ibacm 4/8] acm.c: Fix endian of transaction ID
@ 2013-08-06 11:45 Hal Rosenstock
       [not found] ` <5200E1D8.1090005-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>
  0 siblings, 1 reply; 3+ messages in thread
From: Hal Rosenstock @ 2013-08-06 11:45 UTC (permalink / raw)
  To: Hefty, Sean
  Cc: linux-rdma (linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org)


It should be in network rather than host endian.

Signed-off-by: Hal Rosenstock <hal-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
---
 src/acm.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/acm.c b/src/acm.c
index 7de5873..d68746b 100644
--- a/src/acm.c
+++ b/src/acm.c
@@ -839,7 +839,7 @@ static void acm_init_path_query(struct ib_sa_mad *mad)
 	mad->mgmt_class = IB_MGMT_CLASS_SA;
 	mad->class_version = 2;
 	mad->method = IB_METHOD_GET;
-	mad->tid = (uint64_t) atomic_inc(&tid);
+	mad->tid = htonll((uint64_t) atomic_inc(&tid));
 	mad->attr_id = IB_SA_ATTR_PATH_REC;
 }
 
@@ -1483,7 +1483,7 @@ static void acm_init_join(struct ib_sa_mad *mad, union ibv_gid *port_gid,
 	mad->mgmt_class = IB_MGMT_CLASS_SA;
 	mad->class_version = 2;
 	mad->method = IB_METHOD_SET;
-	mad->tid = (uint64_t) atomic_inc(&tid);
+	mad->tid = htonll((uint64_t) atomic_inc(&tid));
 	mad->attr_id = IB_SA_ATTR_MC_MEMBER_REC;
 	mad->comp_mask =
 		IB_COMP_MASK_MC_MGID | IB_COMP_MASK_MC_PORT_GID |
@@ -1953,7 +1953,7 @@ acm_send_resolve(struct acm_ep *ep, struct acm_dest *dest,
 	mad->class_version = 1;
 	mad->method = IB_METHOD_GET;
 	mad->control = ACM_CTRL_RESOLVE;
-	mad->tid = (uint64_t) atomic_inc(&tid);
+	mad->tid = htonll((uint64_t) atomic_inc(&tid));
 
 	rec = (struct acm_resolve_rec *) mad->data;
 	rec->src_type = (uint8_t) saddr->type;
-- 
1.7.8.2

--
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] 3+ messages in thread

* RE: [PATCH ibacm 4/8] acm.c: Fix endian of transaction ID
       [not found] ` <5200E1D8.1090005-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>
@ 2013-08-07 17:29   ` Hefty, Sean
       [not found]     ` <1828884A29C6694DAF28B7E6B8A8237388CA48A7-P5GAC/sN6hkd3b2yrw5b5LfspsVTdybXVpNB7YpNyf8@public.gmane.org>
  0 siblings, 1 reply; 3+ messages in thread
From: Hefty, Sean @ 2013-08-07 17:29 UTC (permalink / raw)
  To: Hal Rosenstock
  Cc: linux-rdma (linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org)

> It should be in network rather than host endian.

The TID is basically an abstract 64-bit handle.  I don't see that it matters what value is used, provided that the sender use it consistently.
--
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	[flat|nested] 3+ messages in thread

* Re: [PATCH ibacm 4/8] acm.c: Fix endian of transaction ID
       [not found]     ` <1828884A29C6694DAF28B7E6B8A8237388CA48A7-P5GAC/sN6hkd3b2yrw5b5LfspsVTdybXVpNB7YpNyf8@public.gmane.org>
@ 2013-08-07 18:22       ` Hal Rosenstock
  0 siblings, 0 replies; 3+ messages in thread
From: Hal Rosenstock @ 2013-08-07 18:22 UTC (permalink / raw)
  To: Hefty, Sean
  Cc: linux-rdma (linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org)

On 8/7/2013 1:29 PM, Hefty, Sean wrote:
>> It should be in network rather than host endian.
> 
> The TID is basically an abstract 64-bit handle.  I don't see that it matters what value is used, 
> provided that the sender use it consistently.

With little endian machines, the current code puts the TID in the high
bits only to be overwritten by the agent ID so the TID is effectively 0.
That being said, it works either way since currently there is only 1
outstanding query. It's a matter of better TID usage/correctness and
debug when looking at OpenSM logs as to TIDs.

-- Hal

--
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	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2013-08-07 18:22 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-08-06 11:45 [PATCH ibacm 4/8] acm.c: Fix endian of transaction ID Hal Rosenstock
     [not found] ` <5200E1D8.1090005-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>
2013-08-07 17:29   ` Hefty, Sean
     [not found]     ` <1828884A29C6694DAF28B7E6B8A8237388CA48A7-P5GAC/sN6hkd3b2yrw5b5LfspsVTdybXVpNB7YpNyf8@public.gmane.org>
2013-08-07 18:22       ` Hal Rosenstock

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.