Skip to content

Commit 5a566b8

Browse files
authored
Create request-completions.c
1 parent df1dcc0 commit 5a566b8

File tree

1 file changed

+40
-0
lines changed

1 file changed

+40
-0
lines changed

request-completions.c

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
2+
// Polling for work completion
3+
4+
int ibv_poll_cq(struct ibv_cq *cq, int num_entries, struct ibv_wc *wc);
5+
6+
//Work Completion for each entry
7+
8+
struct ibv_wc {
9+
uint64_t wr_id; // Private context that was posted in the corresponding Work Request
10+
enum ibv_wc_status status; // The status of the Work Completion
11+
enum ibv_wc_opcode opcode; // The opcode of the Work Completion
12+
uint32_t vendor_err; // Vendor specific error syndrome
13+
uint32_t byte_len; // Number of bytes that were received
14+
uint32_t imm_data; // Immediate data, in network order, if the flags indicate that such exists
15+
uint32_t qp_num; // The local QP number that this Work Completion ended in
16+
uint32_t src_qp; // The remote QP number
17+
int wc_flags; // Work Completion flags. Or of the following flags:
18+
19+
/* IBV_WC_GRH – Indicator that the first 40 bytes of the receive buffer(s) contain a valid GRH
20+
IBV_WC_WITH_IMM – Indicator that the received message contains immediate data */
21+
22+
uint16_t pkey_index;
23+
uint16_t slid; // For UD QP: the source LID
24+
uint8_t sl; // For UD QP: the source Service Level
25+
uint8_t dlid_path_bits; // For UD QP: the destination LID path bits
26+
};
27+
28+
29+
// typical completion statuses
30+
31+
IBV_WC_SUCCESSOperation completed successfully
32+
IBV_WC_LOC_LEN_ERRLocal length error when processing SR or RR
33+
IBV_WC_LOC_PROT_ERRLocal Protection error; S/G entries doesnt point to a valid MR
34+
IBV_WC_WR_FLUSH_ERRWork Request flush error; it was processed when the QP was in Error state
35+
36+
IBV_WC_RETRY_EXC_ERRRetry exceeded; the remote QP didnt send any ACK/NACK, even after
37+
message retransmission
38+
39+
IBV_WC_RNR_RETRY_EXC_ERRReceiver Not Ready; a message that requires a Receive Request
40+
was sent, but isnt any RR in the remote QP, even after message retransmission

0 commit comments

Comments
 (0)