1mlx5dv_create_qp(3) mlx5 Programmer’s Manual mlx5dv_create_qp(3)
2
3
4
6 mlx5dv_create_qp - creates a queue pair (QP)
7
9 #include <infiniband/mlx5dv.h>
10
11 struct ibv_qp *mlx5dv_create_qp(struct ibv_context *context,
12 struct ibv_qp_init_attr_ex *qp_attr,
13 struct mlx5dv_qp_init_attr *mlx5_qp_attr)
14
16 mlx5dv_create_qp() creates a queue pair (QP) with specific driver prop‐
17 erties.
18
20 Please see ibv_create_qp_ex(3) man page for context and qp_attr.
21
22 mlx5_qp_attr
23 struct mlx5dv_qp_init_attr {
24 uint64_t comp_mask;
25 uint32_t create_flags;
26 struct mlx5dv_dc_init_attr dc_init_attr;
27 uint64_t send_ops_flags;
28 };
29
30 comp_mask
31 Bitmask specifying what fields in the structure are valid:
32 MLX5DV_QP_INIT_ATTR_MASK_QP_CREATE_FLAGS: valid values in cre‐
33 ate_flags MLX5DV_QP_INIT_ATTR_MASK_DC: valid values in
34 dc_init_attr MLX5DV_QP_INIT_ATTR_MASK_SEND_OPS_FLAGS: valid val‐
35 ues in send_ops_flags
36
37 create_flags
38 A bitwise OR of the various values described below.
39
40 MLX5DV_QP_CREATE_TUNNEL_OFFLOADS: Enable offloading such as
41 checksum and LRO for incoming tunneling traffic.
42
43 MLX5DV_QP_CREATE_TIR_ALLOW_SELF_LOOPBACK_UC: Allow receiving
44 loopback unicast traffic.
45
46 MLX5DV_QP_CREATE_TIR_ALLOW_SELF_LOOPBACK_MC: Allow receiving
47 loopback multicast traffic.
48
49 MLX5DV_QP_CREATE_DISABLE_SCATTER_TO_CQE: Disable scatter to CQE
50 feature which is enabled by default.
51
52 MLX5DV_QP_CREATE_ALLOW_SCATTER_TO_CQE: Allow scatter to CQE for
53 requester even if the qp was not configured to signal all WRs.
54
55 MLX5DV_QP_CREATE_PACKET_BASED_CREDIT_MODE: Set QP to work in
56 end-to-end packet-based credit, instead of the default message-
57 based credits (IB spec. section 9.7.7.2).
58 It is the applications responsibility to make sure that the peer
59 QP is configured with same mode.
60
61 MLX5DV_QP_CREATE_SIG_PIPELINING: If the flag is set, the QP is
62 moved to SQD state upon encountering a signature error, and
63 IBV_EVENT_SQ_DRAINED is generated to inform about the new state.
64 The signature pipelining feature is a performance optimization,
65 which reduces latency for read operations in the storage proto‐
66 cols. The feature is optional. Creating the QP fails if the
67 kernel or device does not support the feature. In this case, an
68 application should fallback to backward compatibility mode and
69 handle read operations without the pipelining. See details
70 about the signature pipelining in mlx5dv_qp_cancel_post‐
71 ed_send_wrs(3).
72
73 dc_init_attr
74 DC init attributes.
75
76 dc_init_attr
77 struct mlx5dv_dci_streams {
78 uint8_t log_num_concurent;
79 uint8_t log_num_errored;
80 };
81
82 struct mlx5dv_dc_init_attr {
83 enum mlx5dv_dc_type dc_type;
84 union {
85 uint64_t dct_access_key;
86 struct mlx5dv_dci_streams dci_streams;
87 };
88 };
89
90 dc_type
91 MLX5DV_DCTYPE_DCT QP type: Target DC. MLX5DV_DCTYPE_DCI QP
92 type: Initiator DC.
93
94 dct_access_key
95 used to create a DCT QP.
96
97 dci_streams
98 dci_streams used to define DCI QP with multiple concurrent
99 streams. Valid when comp_mask includes MLX5DV_QP_INIT_AT‐
100 TR_MASK_DCI_STREAMS.
101
102 log_num_concurent Defines the number of parallel different
103 streams that could be handled by HW. All work request of a spe‐
104 cific stream_id are handled in order.
105
106 log_num_errored Defines the number of dci error stream channels
107 before moving DCI to an error state.
108
109 send_ops_flags
110 A bitwise OR of the various values described below.
111
112 MLX5DV_QP_EX_WITH_MR_INTERLEAVED: Enables the mlx5dv_wr_mr_in‐
113 terleaved() work requset on this QP.
114
115 MLX5DV_QP_EX_WITH_MR_LIST: Enables the mlx5dv_wr_mr_list() work
116 requset on this QP.
117
118 MLX5DV_QP_EX_WITH_MKEY_CONFIGURE: Enables the
119 mlx5dv_wr_mkey_configure() work request and the related setters
120 on this QP.
121
123 mlx5dv_qp_ex_from_ibv_qp_ex() is used to get struct mlx5dv_qp_ex for
124 accessing the send ops interfaces when IBV_QP_INIT_ATTR_SEND_OPS_FLAGS
125 is used.
126
127 The MLX5DV_QP_CREATE_DISABLE_SCATTER_TO_CQE flag should be set in cases
128 that IOVA doesn’t match the process’ VA and the message payload size is
129 small enough to trigger the scatter to CQE feature.
130
131 When device memory is used IBV_SEND_INLINE and scatter to CQE should
132 not be used, as the memcpy is not possible.
133
135 mlx5dv_create_qp() returns a pointer to the created QP, on error NULL
136 will be returned and errno will be set.
137
139 ibv_query_device_ex(3), ibv_create_qp_ex(3),
140
142 Yonatan Cohen <yonatanc@mellanox.com>
143
144
145
146mlx5 2018-9-1 mlx5dv_create_qp(3)