Home

ibvpostrecv

ibv_post_recv is a function in the libibverbs API used to post one or more receive work requests to the receive queue of a queue pair (QP). It is a core primitive for handling incoming messages in InfiniBand and RDMA communications, enabling the hardware to DMA incoming data into user buffers described by the posted work requests.

The typical prototype is: int ibv_post_recv(struct ibv_qp *qp, const struct ibv_recv_wr *wr, struct ibv_recv_wr **bad_wr); The

A receive work request describes one or more memory buffers via a linked array of scatter/gather entries

On success, ibv_post_recv returns 0 and sets bad_wr to NULL. On failure, it returns a nonzero error

Usage typically involves preparing a pool of pre-registered buffers, constructing a linked list of ibv_recv_wr with

See also: ibv_post_send.

qp
parameter
selects
the
target
queue
pair.
The
wr
parameter
points
to
the
first
receive
work
request
in
a
singly
linked
list
of
ibv_recv_wr
structures.
The
bad_wr
parameter,
if
non-NULL,
is
used
to
return
the
first
failing
receive
work
request
in
the
chain
in
case
of
an
error.
(struct
ibv_sge)
and
includes
a
work-request
identifier
(wr_id)
that
the
application
can
use
to
correlate
completions
with
posted
requests.
The
memory
buffers
referenced
by
the
SGEs
must
be
registered
with
the
protection
domain
to
be
accessible
by
the
network
hardware.
code
and
sets
bad_wr
to
point
to
the
first
problematic
receive
work
request.
Common
failure
reasons
include
an
inappropriate
QP
state,
insufficient
resources
to
queue
the
WRs,
or
unregistered
or
inaccessible
memory
regions
in
the
SGEs.
corresponding
SGEs,
and
repeatedly
posting
them
to
maintain
a
ready
set
of
buffers
for
incoming
data.
Completion
and
processing
of
received
messages
are
then
handled
through
the
completion
queue.