1IBV_POST_RECV(3)        Libibverbs Programmer's Manual        IBV_POST_RECV(3)
2
3
4

NAME

6       ibv_post_recv - post a list of work requests (WRs) to a receive queue
7

SYNOPSIS

9       #include <infiniband/verbs.h>
10
11       int ibv_post_recv(struct ibv_qp *qp, struct ibv_recv_wr *wr,
12                         struct ibv_recv_wr **bad_wr);
13

DESCRIPTION

15       ibv_post_recv()  posts  the linked list of work requests (WRs) starting
16       with wr to the receive queue of the queue pair qp.  It stops processing
17       WRs  from  this list at the first failure (that can be detected immedi‐
18       ately while requests are being posted), and  returns  this  failing  WR
19       through bad_wr.
20
21       The  argument  wr  is  an  ibv_recv_wr  struct,  as defined in <infini‐
22       band/verbs.h>.
23
24       struct ibv_recv_wr {
25               uint64_t                wr_id;     /* User defined WR ID */
26               struct ibv_recv_wr     *next;      /* Pointer to next WR in list, NULL if last WR */
27               struct ibv_sge         *sg_list;   /* Pointer to the s/g array */
28               int                     num_sge;   /* Size of the s/g array */
29       };
30
31       struct ibv_sge {
32               uint64_t                addr;      /* Start address of the local memory buffer */
33               uint32_t                length;    /* Length of the buffer */
34               uint32_t                lkey;      /* Key of the local Memory Region */
35       };
36

RETURN VALUE

38       ibv_post_recv() returns 0 on success, or the value of errno on  failure
39       (which indicates the failure reason).
40

NOTES

42       The buffers used by a WR can only be safely reused after WR the request
43       is fully executed and a work completion has  been  retrieved  from  the
44       corresponding completion queue (CQ).
45
46       If  the  QP  qp is associated with a shared receive queue, you must use
47       the function ibv_post_srq_recv(), and not  ibv_post_recv(),  since  the
48       QP's own receive queue will not be used.
49
50       If  a WR is being posted to a UD QP, the Global Routing Header (GRH) of
51       the incoming message will be placed in the first 40 bytes of  the  buf‐
52       fer(s)  in the scatter list.  If no GRH is present in the incoming mes‐
53       sage, then the first bytes will be undefined.  This means that  in  all
54       cases,  the actual data of the incoming message will start at an offset
55       of 40 bytes into the buffer(s) in the scatter list.
56

SEE ALSO

58       ibv_create_qp(3),        ibv_post_send(3),        ibv_post_srq_recv(3),
59       ibv_poll_cq(3)
60

AUTHORS

62       Dotan Barak <dotanba@gmail.com>
63
64
65
66libibverbs                        2006-10-31                  IBV_POST_RECV(3)
Impressum