1UMAD_RECV(3)              OpenIB Programmer´s Manual              UMAD_RECV(3)
2
3
4

NAME

6       umad_recv - receive umad
7

SYNOPSIS

9       #include <infiniband/umad.h>
10
11       int umad_recv(int portid, void *umad, int *length, int timeout_ms);
12

DESCRIPTION

14       umad_recv()  waits  up  to  timeout_ms milliseconds for an incoming MAD
15       message to be received from the port specified by portid.
16
17       A MAD "message" consists of a single MAD packet or a  coalesced  multi‐
18       packet  RMPP  transmission.   In  the RMPP case the header of the first
19       RMPP packet is returned as the header of the buffer and the buffer data
20       contains  the coalesced data section of each subsequent RMPP MAD packet
21       within the transmission.  Thus all the RMPP headers  except  the  first
22       are not copied to user space from the kernel.
23
24       The  message  is  copied to the umad buffer if there is sufficient room
25       and the received length is indicated.   If  the  buffer  is  not  large
26       enough,  the  size  of the umad buffer needed is returned in length.  A
27       negative  timeout_ms  makes  the  function  block  until  a  packet  is
28       received. A timeout_ms parameter of zero indicates a non blocking read.
29
30       Note  length is a pointer to the length of the data portion of the umad
31       buffer.  This  means  that  umad  must  point  to  a  buffer  at  least
32       umad_size() + *length bytes long.
33
34       Note also that *length must be >= 256 bytes.  This length allows for at
35       least a single MAD packet to be returned.
36
37

RETURN VALUE

39       umad_recv() on success return the agentid; on error, errno is set and a
40       negative value is returned as follows:
41        -EINVAL       invalid  port  handle or agentid or *length is less than
42       the minimum supported
43        -EIO         receive operation failed
44        -EWOULDBLOCK non blocking read can't be fulfilled
45        -ENOSPC      The provided buffer is not long enough for  the  complete
46       message.
47

SEE ALSO

49       umad_poll(3)
50

AUTHOR

52       Hal Rosenstock <halr@voltaire.com>
53
54
55
56OpenIB                           May 11, 2007                     UMAD_RECV(3)
Impressum