From 550935274b6489f6e629237bd09bb6cbdcf4e631 Mon Sep 17 00:00:00 2001 From: Annika Wierichs Date: Wed, 28 Feb 2018 15:03:54 +0100 Subject: [PATCH] minor --- include/hermit/ibv_eth_cm.h | 8 ++++++-- kernel/ibv_eth_cm.c | 3 ++- usr/tests/ib/srq_eth_cm_pingpong.c | 12 ++++++++++-- 3 files changed, 18 insertions(+), 5 deletions(-) diff --git a/include/hermit/ibv_eth_cm.h b/include/hermit/ibv_eth_cm.h index a9f208eeb..bd2c5dc9d 100644 --- a/include/hermit/ibv_eth_cm.h +++ b/include/hermit/ibv_eth_cm.h @@ -30,8 +30,12 @@ * that helps to exchange destination information before a data exchange via RDMA. * LwIP socket-functions are used. * - * TODO: Not really tested + * TODO: This is just a first prototype that links. See usr/tests/ib/srq_eth_cm_pingpong.c for an + * example ping pong (not yet working). * TODO: Handle network setups comprising more than two end nodes. + * TODO: We could not include all GID raw data in the exchanged message if it is not used, i.e. if + * it is == 0 and an LID is used. Refer to rdma-core/perftest for an example + * (perftest_communication.c -> functions 'ethernet_{read,write}_keys'). */ #ifndef __IBV_ETH_CM__ @@ -49,7 +53,7 @@ struct eth_cm_dest { unsigned long long vaddr; union ibv_gid gid; unsigned srqn; - int gid_index; + // int gid_index; }; /* diff --git a/kernel/ibv_eth_cm.c b/kernel/ibv_eth_cm.c index 92336624a..daf2bd9d6 100644 --- a/kernel/ibv_eth_cm.c +++ b/kernel/ibv_eth_cm.c @@ -172,7 +172,7 @@ int eth_recv_remote_dest(int sockfd, struct eth_cm_dest *rem_dest) return 1; } - uint32_t vaddr_hi, vaddr_lo; + uint32_t vaddr_hi, vaddr_lo; // See comment in send function. sscanf(msg, KEY_PRINT_FMT_GID, (unsigned int*) &rem_dest->lid, &rem_dest->out_reads, &rem_dest->qpn, &rem_dest->psn, &rem_dest->rkey, &vaddr_hi, &vaddr_lo, @@ -196,6 +196,7 @@ int eth_send_local_dest(int sockfd, struct eth_cm_dest *local_dest) { char msg[KEY_MSG_SIZE_GID]; + // TODO: This somehow did not work for a normal 64bit vaddr, IIRC. Check why. unsigned long long host_vaddr = (unsigned long long) guest_to_host((size_t) local_dest->vaddr); uint32_t vaddr_hi, vaddr_lo; unsigned long long vaddr_hi_shfd = host_vaddr >> 32; diff --git a/usr/tests/ib/srq_eth_cm_pingpong.c b/usr/tests/ib/srq_eth_cm_pingpong.c index 42579e02f..89d6e754b 100644 --- a/usr/tests/ib/srq_eth_cm_pingpong.c +++ b/usr/tests/ib/srq_eth_cm_pingpong.c @@ -631,10 +631,13 @@ int main(int argc, char *argv[]) } int fd = -1; - if (servername) + if (servername) { + printf("Client: eth_client_connect.\n"); fd = eth_client_connect(servername, port); - else + } else { + printf("Server: eth_server_connect.\n"); fd = eth_server_connect(port); + } if (!fd) { fprintf(stderr, "Failed to open socket FD for ethernet connection manager.\n"); @@ -643,12 +646,14 @@ int main(int argc, char *argv[]) if (servername) { // Client. for (q = 0; q < num_qp; ++q) { + printf("Client: eth_send_local_dest for QP %d.\n", q); if (eth_send_local_dest(fd, &my_dest[q])) { fprintf(stderr, "Failed to send local destination via ethernet.\n"); return 1; } } for (q = 0; q < num_qp; ++q) { + printf("Client: eth_recv_rem_dest for QP %d.\n", q); if (eth_recv_remote_dest(fd, &rem_dest[q])) { fprintf(stderr, "Failed to receive remote destination via ethernet.\n"); return 1; @@ -657,12 +662,14 @@ int main(int argc, char *argv[]) } else { // Server. for (q = 0; q < num_qp; ++q) { + printf("Server: eth_recv_rem_dest for QP %d.\n", q); if (eth_recv_remote_dest(fd, &rem_dest[q])) { fprintf(stderr, "Failed to receive remote destination via ethernet.\n"); return 1; } } for (q = 0; q < num_qp; ++q) { + printf("Server: eth_send_local_dest for QP %d.\n", q); if (eth_send_local_dest(fd, &my_dest[q])) { fprintf(stderr, "Failed to send local destination via ethernet.\n"); return 1; @@ -670,6 +677,7 @@ int main(int argc, char *argv[]) } } + printf("eth_close.\n"); eth_close(fd); for (q = 0; q < num_qp; ++q) {