-
rdma_create_event_channel(); //Opens an event channel used to report communication events
-
rdma_create_id(); //Creates an identifier that is used to track communication information
-
rdma_bind_addr(); //associates a source address with an rdma_cm_id
-
rdma_listen(); //initiates a listen for incoming connection requests or datagram service lookup
-
rdma_get_src_port(); //listen to a unused port
-
rdma_get_cm_event(); //Retrieves a communication event.
-
copy the
rdma_cm_event
struct to a tmp struct -
rdma_ack_cm_event(); //frees a communication event
-
if
event == RDMA_CM_EVENT_CONNECT_REQUEST
:-
allocate context structure
-
ibv_alloc_pd(); //creates a protection domain
-
ibv_create_comp_channel(); //creates a completion channel
-
ibv_create_cq(); //creates a completion queue
-
ibv_req_notify_cq(); //arms the notification mechanism for the indicated completion queue
-
create a thread
poll_cq
to poll completion queue:ibv_get_cq_event(); //waits for a notification to be sent on the indicated completion channel
ibv_ack_cq_events();
ibv_req_notify_cq(); //arms the notification mechanism for the indicated completion queue
ibv_poll_cq(); //retrieves CQEs from a completion queue
- if
wc->opcode == IBV_WC_RECV
: -
-
set qp_attr, including
qp_attr->send_cq = s_ctx->cq; qp_attr->recv_cq = s_ctx->cq; qp_attr->qp_type = IBV_QPT_RC; qp_attr->cap.max_send_wr = 10; qp_attr->cap.max_recv_wr = 10; qp_attr->cap.max_send_sge = 1; qp_attr->cap.max_recv_sge = 1;
-
rdma_create_qp(); //allocates a QP associated with the specified rdma_cm_id and transitions it for sending and receiving.
-
ibv_reg_mr(); //registers a memory region (MR), associates it with a protection domain (PD), and assigns it local and remote keys (lkey, rkey)
register
conn->send_msg, conn->recv_msg, conn->rdma_local_region, conn->remote_region
-
set up a work request:
wr.wr_id = (uintptr_t)conn; wr.next = NULL; wr.sg_list = &sge; wr.num_sge = 1; sge.addr = (uintptr_t)conn->recv_msg; sge.length = sizeof(struct message); sge.lkey = conn->recv_mr->lkey;
-
ibv_post_recv(); //posts a linked list of WRs to a queue pair’s (QP) receive queue
-
set up
struct rdma_conn_params
-
print message to local message region
-
rdma_accept(); //is called from the listening side to accept a connection or datagram service lookup request.
-
-
if
event == RDMA_CM_EVENT_ESTABLISHED
:- set up connection status in connection context
-
if
event == RDMA_CM_EVENT_DISCONNECTED
:rdma_dstroy_qp();
ibv_dereg_mr();
free();
rdma_destroy_id();
Last active
July 9, 2017 04:25
-
-
Save xterat/675db0a5a6269e5ceeb6c6fcc688397f to your computer and use it in GitHub Desktop.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment