1.2.1
by Roland Dreier
Import upstream version 1.1.2 |
1 |
.\" -*- nroff -*- |
2 |
.\" |
|
3 |
.TH IBV_POST_RECV 3 2006-10-31 libibverbs "Libibverbs Programmer's Manual" |
|
4 |
.SH "NAME" |
|
5 |
ibv_post_recv \- post a list of work requests (WRs) to a receive queue
|
|
6 |
.SH "SYNOPSIS" |
|
7 |
.nf
|
|
8 |
.B #include <infiniband/verbs.h> |
|
9 |
.sp
|
|
10 |
.BI "int ibv_post_recv(struct ibv_qp " "*qp" ", struct ibv_recv_wr " "*wr" , |
|
11 |
.BI " struct ibv_recv_wr " "**bad_wr" ); |
|
12 |
.fi
|
|
13 |
.SH "DESCRIPTION" |
|
14 |
.B ibv_post_recv() |
|
15 |
posts the linked list of work requests (WRs) starting with |
|
16 |
.I wr |
|
17 |
to the receive queue of the queue pair |
|
18 |
.I qp\fR. |
|
19 |
It stops processing WRs from this list at the first failure (that can |
|
20 |
be detected immediately while requests are being posted), and returns |
|
21 |
this failing WR through |
|
22 |
.I bad_wr\fR. |
|
23 |
.PP
|
|
24 |
The argument |
|
25 |
.I wr |
|
26 |
is an ibv_recv_wr struct, as defined in <infiniband/verbs.h>. |
|
27 |
.PP
|
|
28 |
.nf
|
|
29 |
struct ibv_recv_wr { |
|
30 |
.in +8 |
|
31 |
uint64_t wr_id; /* User defined WR ID */ |
|
32 |
struct ibv_recv_wr *next; /* Pointer to next WR in list, NULL if last WR */ |
|
33 |
struct ibv_sge *sg_list; /* Pointer to the s/g array */ |
|
34 |
int num_sge; /* Size of the s/g array */ |
|
35 |
.in -8 |
|
36 |
}; |
|
37 |
.sp
|
|
38 |
.nf
|
|
39 |
struct ibv_sge { |
|
40 |
.in +8 |
|
41 |
uint64_t addr; /* Start address of the local memory buffer */ |
|
42 |
uint32_t length; /* Length of the buffer */ |
|
43 |
uint32_t lkey; /* Key of the local Memory Region */ |
|
44 |
.in -8 |
|
45 |
}; |
|
46 |
.fi
|
|
47 |
.SH "RETURN VALUE" |
|
48 |
.B ibv_post_recv() |
|
49 |
returns 0 on success, or the value of errno on failure (which indicates the failure reason). |
|
50 |
.SH "NOTES" |
|
51 |
The buffers used by a WR can only be safely reused after WR the |
|
52 |
request is fully executed and a work completion has been retrieved |
|
53 |
from the corresponding completion queue (CQ). |
|
54 |
.PP
|
|
55 |
If the QP |
|
56 |
.I qp |
|
57 |
is associated with a shared receive queue, you must use the function |
|
58 |
.B ibv_post_srq_recv()\fR, |
|
59 |
and not |
|
60 |
.B ibv_post_recv()\fR, |
|
61 |
since the QP's own receive queue will not be used. |
|
62 |
.PP
|
|
63 |
If a WR is being posted to a UD QP, the Global Routing Header (GRH) of |
|
64 |
the incoming message will be placed in the first 40 bytes of the |
|
65 |
buffer(s) in the scatter list. If no GRH is present in the incoming |
|
66 |
message, then the first bytes will be undefined. This means that in |
|
67 |
all cases, the actual data of the incoming message will start at an |
|
68 |
offset of 40 bytes into the buffer(s) in the scatter list. |
|
69 |
.SH "SEE ALSO" |
|
70 |
.BR ibv_create_qp (3), |
|
71 |
.BR ibv_post_send (3), |
|
72 |
.BR ibv_post_srq_recv (3), |
|
73 |
.BR ibv_poll_cq (3) |
|
74 |
.SH "AUTHORS" |
|
75 |
.TP
|
|
1.2.2
by Roland Dreier
Import upstream version 1.1.3 |
76 |
Dotan Barak <dotanba@gmail.com> |