[openib-general] [PATCH] [kdapl CM] Fix endian conversions of service ID

Hal Rosenstock halr at voltaire.com
Tue May 24 11:32:16 PDT 2005


[kdapl CM] Fix endian conversions of service ID
Problem pointed out by James Lentini

Signed-off-by: Hal Rosenstock <halr at voltaire.com>

Index: dapl_openib_cm.c
===================================================================
-- dapl_openib_cm.c    (revision 2468)
+++ dapl_openib_cm.c    (working copy)
@@ -309,7 +309,7 @@
        if (conn->dapl_path.mtu > IB_MTU_1024)    
                conn->dapl_path.mtu = IB_MTU_1024;

-       conn->param.service_id = be64_to_cpu(conn->service_id);
+       conn->param.service_id = conn->service_id;
        conn->param.primary_path = &conn->dapl_path;
        conn->param.alternate_path = NULL;

@@ -445,8 +445,7 @@
        conn->param.local_cm_response_timeout =
DAPL_OPENIB_CM_RESPONSE_TIMEOUT;
        conn->param.max_cm_retries = DAPL_OPENIB_MAX_CM_RETRIES;

-       memcpy(&conn->service_id, &remote_conn_qual, sizeof
conn->service_id);
-
+       conn->service_id = be64_to_cpu(remote_conn_qual);
        conn->remote_ia_address = remote_ia_address;
        conn->dapl_comp.fn = &dapl_rt_comp_handler;
        conn->dapl_comp.context = conn;
@@ -627,7 +626,7 @@
        }

        status = ib_cm_listen(sp_ptr->cm_srvc_handle,
-                             be64_to_cpu(sp_ptr->conn_qual), 0);
+                             cpu_to_be64(sp_ptr->conn_qual), 0);
        if (status) {
                ib_destroy_cm_id(sp_ptr->cm_srvc_handle);
                sp_ptr->cm_srvc_handle = NULL;






More information about the general mailing list