masters-thesis/listings/cm_switch.c
Dennis af25b4b828 Initial commit of master's thesis
This is the version I submitted to RWTH Aachen University at November 9,
2018.
2018-11-12 12:56:59 +01:00

49 lines
1.6 KiB
C

struct rdma_cm_event *event;
while (rdma_get_cm_event(event_channel, &event) == 0) {
switch (event->event) {
case RDMA_CM_EVENT_ADDR_RESOLVED:
// Create QP, receive CQ, and send CQ.
// Call rdma_resolve_route()
// State: STARTED
case RDMA_CM_EVENT_ADDR_ERROR:
// Try fallback and set mode rdma_cm_id to listening
// State: STARTED
case RDMA_CM_EVENT_ROUTE_RESOLVED:
// Call rdma_connect()
// State: PENDING_CONNECT
case RDMA_CM_EVENT_ROUTE_ERROR:
// Try fallback and set mode rdma_cm_id to listening
// State: STARTED
case RDMA_CM_EVENT_UNREACHABLE:
// Try fallback and set mode rdma_cm_id to listening
// State: STARTED
case RDMA_CM_EVENT_CONNECT_REQUEST:
// Create QP, receive CQ, and send CQ.
// Call rdma_accept()
// State: PENDING_CONNECT
case RDMA_CM_EVENT_CONNECT_ERROR:
// Try fallback and set mode rdma_cm_id to listening
// State: STARTED
case RDMA_CM_EVENT_REJECTED:
// Try fallback and set mode rdma_cm_id to listening
// State: STARTED
case RDMA_CM_EVENT_ESTABLISHED:
// In case of UD, save address handle from event struct
// State: CONNECTED
case RDMA_CM_EVENT_DISCONNECTED:
// Release all buffers and destroy everything
// State: STARTED
case RDMA_CM_EVENT_TIMEWAIT_EXIT:
break;
default:
// Error message: unkown event
}
rdma_ack_cm_event(event);
}