]> CyberLeo.Net >> Repos - FreeBSD/releng/10.0.git/blob - contrib/ofed/libibverbs/man/ibv_post_send.3
- Copy stable/10 (r259064) to releng/10.0 as part of the
[FreeBSD/releng/10.0.git] / contrib / ofed / libibverbs / man / ibv_post_send.3
1 .\" -*- nroff -*-
2 .\"
3 .TH IBV_POST_SEND 3 2006-10-31 libibverbs "Libibverbs Programmer's Manual"
4 .SH "NAME"
5 ibv_post_send \- post a list of work requests (WRs) to a send queue
6 .SH "SYNOPSIS"
7 .nf
8 .B #include <infiniband/verbs.h>
9 .sp
10 .BI "int ibv_post_send(struct ibv_qp " "*qp" ", struct ibv_send_wr " "*wr" ,
11 .BI "                  struct ibv_send_wr " "**bad_wr" );
12 .fi
13 .SH "DESCRIPTION"
14 .B ibv_post_send()
15 posts the linked list of work requests (WRs) starting with
16 .I wr
17 to the send 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_send_wr struct, as defined in <infiniband/verbs.h>.
27 .PP
28 .nf
29 struct ibv_send_wr {
30 .in +8
31 uint64_t                wr_id;                  /* User defined WR ID */
32 struct ibv_send_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 enum ibv_wr_opcode      opcode;                 /* Operation type */
36 int                     send_flags;             /* Flags of the WR properties */
37 uint32_t                imm_data;               /* Immediate data (in network byte order) */
38 union {
39 .in +8
40 struct {
41 .in +8
42 uint64_t        remote_addr;    /* Start address of remote memory buffer */
43 uint32_t        rkey;           /* Key of the remote Memory Region */
44 .in -8
45 } rdma;
46 struct {
47 .in +8
48 uint64_t        remote_addr;    /* Start address of remote memory buffer */ 
49 uint64_t        compare_add;    /* Compare operand */
50 uint64_t        swap;           /* Swap operand */
51 uint32_t        rkey;           /* Key of the remote Memory Region */
52 .in -8
53 } atomic;
54 struct {
55 .in +8
56 struct ibv_ah  *ah;             /* Address handle (AH) for the remote node address */
57 uint32_t        remote_qpn;     /* QP number of the destination QP */
58 uint32_t        remote_qkey;    /* Q_Key number of the destination QP */
59 .in -8
60 } ud;
61 .in -8
62 } wr;
63 uint32_t                xrc_remote_srq_num;     /* SRQ number of the destination XRC */
64 .in -8
65 };
66 .sp
67 .nf
68 struct ibv_sge {
69 .in +8
70 uint64_t                addr;                   /* Start address of the local memory buffer */
71 uint32_t                length;                 /* Length of the buffer */
72 uint32_t                lkey;                   /* Key of the local Memory Region */
73 .in -8
74 };
75 .fi
76 .PP
77 Each QP Transport Service Type supports a specific set of opcodes, as shown in the following table:
78 .PP
79 .nf
80 OPCODE                      | IBV_QPT_UD | IBV_QPT_UC | IBV_QPT_RC | IBV_QPT_XRC
81 \-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-+\-\-\-\-\-\-\-\-\-\-\-\-+\-\-\-\-\-\-\-\-\-\-\-\-+\-\-\-\-\-\-\-\-\-\-\-\-+\-\-\-\-\-\-\-\-\-\-\-\-
82 IBV_WR_SEND                 |     X      |     X      |     X      |     X
83 IBV_WR_SEND_WITH_IMM        |     X      |     X      |     X      |     X
84 IBV_WR_RDMA_WRITE           |            |     X      |     X      |     X
85 IBV_WR_RDMA_WRITE_WITH_IMM  |            |     X      |     X      |     X
86 IBV_WR_RDMA_READ            |            |            |     X      |     X
87 IBV_WR_ATOMIC_CMP_AND_SWP   |            |            |     X      |     X
88 IBV_WR_ATOMIC_FETCH_AND_ADD |            |            |     X      |     X
89 .fi
90 .PP
91 The attribute send_flags describes the properties of the \s-1WR\s0. It is either 0 or the bitwise \s-1OR\s0 of one or more of the following flags:
92 .PP
93 .TP
94 .B IBV_SEND_FENCE \fR Set the fence indicator.  Valid only for QPs with Transport Service Type \fBIBV_QPT_RC
95 .TP
96 .B IBV_SEND_SIGNALED \fR Set the completion notification indicator.  Relevant only if QP was created with sq_sig_all=0
97 .TP
98 .B IBV_SEND_SOLICITED \fR Set the solicited event indicator.  Valid only for Send and RDMA Write with immediate
99 .TP
100 .B IBV_SEND_INLINE \fR Send data in given gather list as inline data
101 in a send WQE.  Valid only for Send and RDMA Write.  The L_Key will not be checked.
102 .SH "RETURN VALUE"
103 .B ibv_post_send()
104 returns 0 on success, or the value of errno on failure (which indicates the failure reason).
105 .SH "NOTES"
106 The user should not alter or destroy AHs associated with WRs until
107 request is fully executed and a work completion has been retrieved
108 from the corresponding completion queue (CQ) to avoid unexpected
109 behavior.
110 .PP
111 The buffers used by a WR can only be safely reused after WR the
112 request is fully executed and a work completion has been retrieved
113 from the corresponding completion queue (CQ). However, if the
114 IBV_SEND_INLINE flag was set, the buffer can be reused immediately
115 after the call returns.
116 .SH "SEE ALSO"
117 .BR ibv_create_qp (3),
118 .BR ibv_create_xrc_rcv_qp (3),
119 .BR ibv_create_ah (3),
120 .BR ibv_post_recv (3),
121 .BR ibv_post_srq_recv (3),
122 .BR ibv_poll_cq (3)
123 .SH "AUTHORS"
124 .TP
125 Dotan Barak <dotanb@mellanox.co.il>