]> git.pld-linux.org Git - packages/rdma-core.git/blob - rdma-core-providers-update.patch
- updated to 37.1 (ABI rdmav34, i40iw driver replaced by irdma)
[packages/rdma-core.git] / rdma-core-providers-update.patch
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
3 @@ -75,6 +75,14 @@
4         {},
5  };
6  
7 +static void iwch_free_context(struct ibv_context *ibctx)
8 +{
9 +       struct iwch_context *context = to_iwch_ctx(ibctx);
10 +
11 +       verbs_uninit_context(&context->ibv_ctx);
12 +       free(context);
13 +}
14 +
15  static const struct verbs_context_ops iwch_ctx_common_ops = {
16         .query_device = iwch_query_device,
17         .query_port = iwch_query_port,
18 @@ -98,6 +106,7 @@
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,
23  };
24  
25  static const struct verbs_context_ops iwch_ctx_t3a_ops = {
26 @@ -160,14 +169,6 @@
27         return NULL;
28  }
29  
30 -static void iwch_free_context(struct ibv_context *ibctx)
31 -{
32 -       struct iwch_context *context = to_iwch_ctx(ibctx);
33 -
34 -       verbs_uninit_context(&context->ibv_ctx);
35 -       free(context);
36 -}
37 -
38  static void iwch_uninit_device(struct verbs_device *verbs_device)
39  {
40         struct iwch_device *dev = to_iwch_dev(&verbs_device->device);
41 @@ -264,6 +265,5 @@
42         .alloc_device = iwch_device_alloc,
43         .uninit_device = iwch_uninit_device,
44         .alloc_context = iwch_alloc_context,
45 -       .free_context = iwch_free_context,
46  };
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
50 @@ -63,6 +63,18 @@
51         {},
52  };
53  
54 +/**
55 + * nes_ufree_context
56 + */
57 +static void nes_ufree_context(struct ibv_context *ibctx)
58 +{
59 +       struct nes_uvcontext *nesvctx = to_nes_uctx(ibctx);
60 +       nes_ufree_pd(&nesvctx->nesupd->ibv_pd);
61 +
62 +       verbs_uninit_context(&nesvctx->ibv_ctx);
63 +       free(nesvctx);
64 +}
65 +
66  static const struct verbs_context_ops nes_uctx_ops = {
67         .query_device = nes_uquery_device,
68         .query_port = nes_uquery_port,
69 @@ -87,6 +99,7 @@
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,
75  };
76  
77  static const struct verbs_context_ops nes_uctx_no_db_ops = {
78 @@ -163,18 +176,6 @@
79  }
80  
81  
82 -/**
83 - * nes_ufree_context
84 - */
85 -static void nes_ufree_context(struct ibv_context *ibctx)
86 -{
87 -       struct nes_uvcontext *nesvctx = to_nes_uctx(ibctx);
88 -       nes_ufree_pd(&nesvctx->nesupd->ibv_pd);
89 -
90 -       verbs_uninit_context(&nesvctx->ibv_ctx);
91 -       free(nesvctx);
92 -}
93 -
94  static void nes_uninit_device(struct verbs_device *verbs_device)
95  {
96         struct nes_udevice *dev = to_nes_udev(&verbs_device->device);
97 @@ -215,6 +216,5 @@
98         .alloc_device = nes_device_alloc,
99         .uninit_device = nes_uninit_device,
100         .alloc_context = nes_ualloc_context,
101 -       .free_context = nes_ufree_context,
102  };
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
107  }
108  
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);
115  
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
118 @@ -42,23 +42,24 @@
119  #include "iwch.h"
120  #include "iwch-abi.h"
121  
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)
124  {
125 -       struct ibv_query_device cmd;
126 +       struct ib_uverbs_ex_query_device_resp resp;
127 +       size_t resp_size = sizeof(resp);
128         uint64_t raw_fw_ver;
129         unsigned major, minor, sub_minor;
130         int ret;
131  
132 -       ret = ibv_cmd_query_device(context, attr, &raw_fw_ver, &cmd, 
133 -                                  sizeof cmd);
134 +       ret = ibv_cmd_query_device_any(context, input, attr, attr_size, &resp, &resp_size);
135         if (ret)
136                 return ret;
137  
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;
142  
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);
146  
147         return 0;
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
151  }
152  
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)
161                 return false;
162  
163 -       /* 
164 -        * Verify that the firmware major number matches.  Major number
165 -        * mismatches are fatal.  Minor number mismatches are tolerated.
166 -        */
167 -       if (ibv_get_fw_ver(value, sizeof(value), sysfs_dev))
168 -               return false;
169 -
170 -       cp = strtok(value+1, ".");
171 -       sscanf(cp, "%i", &fw_maj);
172 -       cp = strtok(NULL, ".");
173 -       sscanf(cp, "%i", &fw_min);
174 -
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",
178 -                       fw_maj, FW_MAJ);        
179 -               fflush(stderr);
180 -               return false;
181 -       }
182 -
183 -       DBGLOG("libcxgb3");
184 -
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",
188 -                       fw_min, FW_MIN);
189 -               fflush(stderr);
190 -       }
191 -
192         return true;
193  }
194  
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
198  }
199  
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
209  
210  
211  /* nes_uverbs.c */
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 {
220  /**
221   * nes_uquery_device
222   */
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)
225  {
226 -       struct ibv_query_device cmd;
227 +       struct ib_uverbs_ex_query_device_resp resp;
228 +       size_t resp_size = sizeof(resp);
229         uint64_t nes_fw_ver;
230         int ret;
231         unsigned int minor, major;
232  
233 -       ret = ibv_cmd_query_device(context, attr, &nes_fw_ver,
234 -                                       &cmd, sizeof cmd);
235 +       ret = ibv_cmd_query_device_any(context, input, attr, attr_size, &resp, &resp_size);
236         if (ret)
237                 return ret;
238  
239 +       nes_fw_ver = resp.base.fw_ver;
240         major = (nes_fw_ver >> 16) & 0xffff;
241         minor = nes_fw_ver & 0xffff;
242  
243 -       snprintf(attr->fw_ver, sizeof attr->fw_ver,
244 +       snprintf(attr->orig_attr.fw_ver, 64,
245                 "%d.%d", major, minor);
246  
247         return 0;
This page took 0.127615 seconds and 3 git commands to generate.