> Index: core/al/kernel/al_ndi_cm.c
> ===================================================================
> --- core/al/kernel/al_ndi_cm.c        (revision 3095)
> +++ core/al/kernel/al_ndi_cm.c        (working copy)
> @@ -1072,7 +1072,9 @@ __ndi_fill_cm_req(
> 
>       memset( p_cm_req, 0, sizeof(*p_cm_req) );
> 
> -     p_cm_req->service_id = IB_REQ_CM_RDMA_SID_PREFIX | (p_req->prot <<
> 16) | p_req->dst_port;
> +     p_cm_req->service_id = IB_REQ_CM_RDMA_SID_PREFIX |
> +             ((UINT64)p_req->prot) << 40 |
> +             ((UINT64)p_req->dst_port) << 48;

IMO, it's clearer and more maintainable to define values and perform operations 
in host order, with swapping done at the end..

> +/*
> + * The prefix and mask are defined in network order.
> + */
> +#define IB_REQ_CM_RDMA_SID_PREFIX                    0x0000000100000000I64
> +#define IB_REQ_CM_RDMA_SID_PREFIX_MASK               0x000000FFFFFFFFFFI64

..but if you want to define a value in network order, use something like:

#define VAL htonX(1234)

which is self documenting.  The compiler should be able to remove the actual 
computation.

- Sean
_______________________________________________
ofw mailing list
[email protected]
http://lists.openfabrics.org/cgi-bin/mailman/listinfo/ofw

Reply via email to