Skip to content

Commit

Permalink
fix endian converting
Browse files Browse the repository at this point in the history
  • Loading branch information
w180112 committed Aug 20, 2023
1 parent 8788cc6 commit 8323983
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
.DS_store
**/.DS_store
.vscode
2 changes: 1 addition & 1 deletion rdma_write_client.c
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ int main(int argc, char *argv[])
send_wr.sg_list = &sge;
send_wr.num_sge = 1;
send_wr.wr.rdma.rkey = ntohl(server_pdata.buf_rkey);
send_wr.wr.rdma.remote_addr = ntohl(server_pdata.buf_va);
send_wr.wr.rdma.remote_addr = ntohll(server_pdata.buf_va);

if (ibv_post_send(cm_id->qp,&send_wr,&bad_send_wr))
return 1;
Expand Down
3 changes: 2 additions & 1 deletion rdma_write_server.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
* waits for client to connect, receives two integers, and sends their sum back to the client.
*/

#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include <arpa/inet.h>
Expand Down Expand Up @@ -163,7 +164,7 @@ int main(int argc, char *argv[])
perror("rdma cm create qp error");
return err;
}
rep_pdata.buf_va = htonl((uintptr_t)buf);
rep_pdata.buf_va = htonll((uintptr_t)buf);
/* we need to prepare remote key to give to client */
rep_pdata.buf_rkey = htonl(mr->rkey);
conn_param.responder_resources = 1;
Expand Down

0 comments on commit 8323983

Please sign in to comment.