mirror of
https://github.com/hermitcore/libhermit.git
synced 2025-03-09 00:00:03 +01:00
minor
This commit is contained in:
parent
e9371ddaf1
commit
550935274b
3 changed files with 18 additions and 5 deletions
|
@ -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;
|
||||
};
|
||||
|
||||
/*
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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) {
|
||||
|
|
Loading…
Add table
Reference in a new issue