1 --- rdma-core-28.0/providers/cxgb3/iwch.c.orig 2020-02-12 21:21:08.971189494 +0100
2 +++ rdma-core-28.0/providers/cxgb3/iwch.c 2020-02-12 21:28:50.972019955 +0100
7 +static void iwch_free_context(struct ibv_context *ibctx)
9 + struct iwch_context *context = to_iwch_ctx(ibctx);
11 + verbs_uninit_context(&context->ibv_ctx);
15 static const struct verbs_context_ops iwch_ctx_common_ops = {
16 .query_device = iwch_query_device,
17 .query_port = iwch_query_port,
19 .detach_mcast = iwch_detach_mcast,
20 .post_srq_recv = iwch_post_srq_recv,
21 .req_notify_cq = iwch_arm_cq,
22 + .free_context = iwch_free_context,
25 static const struct verbs_context_ops iwch_ctx_t3a_ops = {
30 -static void iwch_free_context(struct ibv_context *ibctx)
32 - struct iwch_context *context = to_iwch_ctx(ibctx);
34 - verbs_uninit_context(&context->ibv_ctx);
38 static void iwch_uninit_device(struct verbs_device *verbs_device)
40 struct iwch_device *dev = to_iwch_dev(&verbs_device->device);
42 .alloc_device = iwch_device_alloc,
43 .uninit_device = iwch_uninit_device,
44 .alloc_context = iwch_alloc_context,
45 - .free_context = iwch_free_context,
47 PROVIDER_DRIVER(cxgb3, iwch_dev_ops);
48 --- rdma-core-28.0/providers/nes/nes_umain.c.orig 2020-02-12 22:09:28.778813223 +0100
49 +++ rdma-core-28.0/providers/nes/nes_umain.c 2020-02-13 16:19:10.874608034 +0100
57 +static void nes_ufree_context(struct ibv_context *ibctx)
59 + struct nes_uvcontext *nesvctx = to_nes_uctx(ibctx);
60 + nes_ufree_pd(&nesvctx->nesupd->ibv_pd);
62 + verbs_uninit_context(&nesvctx->ibv_ctx);
66 static const struct verbs_context_ops nes_uctx_ops = {
67 .query_device = nes_uquery_device,
68 .query_port = nes_uquery_port,
70 .attach_mcast = nes_uattach_mcast,
71 .detach_mcast = nes_udetach_mcast,
72 - .async_event = nes_async_event
73 + .async_event = nes_async_event,
74 + .free_context = nes_ufree_context,
77 static const struct verbs_context_ops nes_uctx_no_db_ops = {
85 -static void nes_ufree_context(struct ibv_context *ibctx)
87 - struct nes_uvcontext *nesvctx = to_nes_uctx(ibctx);
88 - nes_ufree_pd(&nesvctx->nesupd->ibv_pd);
90 - verbs_uninit_context(&nesvctx->ibv_ctx);
94 static void nes_uninit_device(struct verbs_device *verbs_device)
96 struct nes_udevice *dev = to_nes_udev(&verbs_device->device);
98 .alloc_device = nes_device_alloc,
99 .uninit_device = nes_uninit_device,
100 .alloc_context = nes_ualloc_context,
101 - .free_context = nes_ufree_context,
103 PROVIDER_DRIVER(nes, nes_udev_ops);
104 --- rdma-core-37.1/providers/cxgb3/iwch.h.orig 2021-10-23 21:31:34.732657063 +0200
105 +++ rdma-core-37.1/providers/cxgb3/iwch.h 2021-10-24 08:37:17.256269862 +0200
106 @@ -143,7 +143,8 @@ static inline unsigned long long_log2(un
109 extern int iwch_query_device(struct ibv_context *context,
110 - struct ibv_device_attr *attr);
111 + const struct ibv_query_device_ex_input *input,
112 + struct ibv_device_attr_ex *attr, size_t attr_size);
113 extern int iwch_query_port(struct ibv_context *context, uint8_t port,
114 struct ibv_port_attr *attr);
116 --- rdma-core-37.1/providers/cxgb3/verbs.c.orig 2021-10-23 21:31:34.735990379 +0200
117 +++ rdma-core-37.1/providers/cxgb3/verbs.c 2021-10-24 09:00:27.472071750 +0200
120 #include "iwch-abi.h"
122 -int iwch_query_device(struct ibv_context *context, struct ibv_device_attr *attr)
123 +int iwch_query_device(struct ibv_context *context, const struct ibv_query_device_ex_input *input, struct ibv_device_attr_ex *attr, size_t attr_size)
125 - struct ibv_query_device cmd;
126 + struct ib_uverbs_ex_query_device_resp resp;
127 + size_t resp_size = sizeof(resp);
129 unsigned major, minor, sub_minor;
132 - ret = ibv_cmd_query_device(context, attr, &raw_fw_ver, &cmd,
134 + ret = ibv_cmd_query_device_any(context, input, attr, attr_size, &resp, &resp_size);
138 + raw_fw_ver = resp.base.fw_ver;
139 major = (raw_fw_ver >> 32) & 0xffff;
140 minor = (raw_fw_ver >> 16) & 0xffff;
141 sub_minor = raw_fw_ver & 0xffff;
143 - snprintf(attr->fw_ver, sizeof attr->fw_ver,
144 + snprintf(attr->orig_attr.fw_ver, 64,
145 "%d.%d.%d", major, minor, sub_minor);
148 --- rdma-core-37.1/providers/cxgb3/iwch.c.orig 2021-10-23 21:31:35.429319956 +0200
149 +++ rdma-core-37.1/providers/cxgb3/iwch.c 2021-10-25 18:20:12.958721287 +0200
150 @@ -84,7 +84,7 @@ static void iwch_free_context(struct ibv
153 static const struct verbs_context_ops iwch_ctx_common_ops = {
154 - .query_device = iwch_query_device,
155 + .query_device_ex = iwch_query_device,
156 .query_port = iwch_query_port,
157 .alloc_pd = iwch_alloc_pd,
158 .dealloc_pd = iwch_free_pd,
159 @@ -185,35 +185,6 @@ static bool iwch_device_match(struct ver
160 if (!sysfs_dev->match)
164 - * Verify that the firmware major number matches. Major number
165 - * mismatches are fatal. Minor number mismatches are tolerated.
167 - if (ibv_get_fw_ver(value, sizeof(value), sysfs_dev))
170 - cp = strtok(value+1, ".");
171 - sscanf(cp, "%i", &fw_maj);
172 - cp = strtok(NULL, ".");
173 - sscanf(cp, "%i", &fw_min);
175 - if (fw_maj < FW_MAJ) {
176 - fprintf(stderr, "libcxgb3: Fatal firmware version mismatch. "
177 - "Firmware major number is %u and libcxgb3 needs %u.\n",
183 - DBGLOG("libcxgb3");
185 - if ((signed int)fw_min < FW_MIN) {
186 - PDBG("libcxgb3: non-fatal firmware version mismatch. "
187 - "Firmware minor number is %u and libcxgb3 needs %u.\n",
195 --- rdma-core-37.1/providers/nes/nes_umain.c.orig 2021-10-23 21:31:35.429319956 +0200
196 +++ rdma-core-37.1/providers/nes/nes_umain.c 2021-10-25 20:11:56.505738392 +0200
197 @@ -76,7 +76,7 @@ static void nes_ufree_context(struct ibv
200 static const struct verbs_context_ops nes_uctx_ops = {
201 - .query_device = nes_uquery_device,
202 + .query_device_ex = nes_uquery_device,
203 .query_port = nes_uquery_port,
204 .alloc_pd = nes_ualloc_pd,
205 .dealloc_pd = nes_ufree_pd,
206 --- rdma-core-37.1/providers/nes/nes_umain.h.orig 2021-10-23 21:31:34.749323640 +0200
207 +++ rdma-core-37.1/providers/nes/nes_umain.h 2021-10-25 20:13:09.838674447 +0200
208 @@ -346,7 +346,7 @@ static inline struct nes_uqp *to_nes_uqp
212 -int nes_uquery_device(struct ibv_context *, struct ibv_device_attr *);
213 +int nes_uquery_device(struct ibv_context *, const struct ibv_query_device_ex_input *, struct ibv_device_attr_ex *, size_t);
214 int nes_uquery_port(struct ibv_context *, uint8_t, struct ibv_port_attr *);
215 struct ibv_pd *nes_ualloc_pd(struct ibv_context *);
216 int nes_ufree_pd(struct ibv_pd *);
217 --- rdma-core-37.1/providers/nes/nes_uverbs.c.orig 2021-10-23 21:31:34.749323640 +0200
218 +++ rdma-core-37.1/providers/nes/nes_uverbs.c 2021-10-25 20:17:56.213789687 +0200
219 @@ -74,22 +74,23 @@ struct nes_ud_recv_wr {
223 -int nes_uquery_device(struct ibv_context *context, struct ibv_device_attr *attr)
224 +int nes_uquery_device(struct ibv_context *context, const struct ibv_query_device_ex_input *input, struct ibv_device_attr_ex *attr, size_t attr_size)
226 - struct ibv_query_device cmd;
227 + struct ib_uverbs_ex_query_device_resp resp;
228 + size_t resp_size = sizeof(resp);
231 unsigned int minor, major;
233 - ret = ibv_cmd_query_device(context, attr, &nes_fw_ver,
235 + ret = ibv_cmd_query_device_any(context, input, attr, attr_size, &resp, &resp_size);
239 + nes_fw_ver = resp.base.fw_ver;
240 major = (nes_fw_ver >> 16) & 0xffff;
241 minor = nes_fw_ver & 0xffff;
243 - snprintf(attr->fw_ver, sizeof attr->fw_ver,
244 + snprintf(attr->orig_attr.fw_ver, 64,
245 "%d.%d", major, minor);