common/mlx5: move to formal ASO action API
[dpdk.git] / drivers / common / mlx5 / linux / mlx5_glue.c
1 /* SPDX-License-Identifier: BSD-3-Clause
2  * Copyright 2018 6WIND S.A.
3  * Copyright 2018 Mellanox Technologies, Ltd
4  */
5
6 #include <errno.h>
7 #include <stdalign.h>
8 #include <stddef.h>
9 #include <stdint.h>
10 #include <stdlib.h>
11 /*
12  * Not needed by this file; included to work around the lack of off_t
13  * definition for mlx5dv.h with unpatched rdma-core versions.
14  */
15 #include <sys/types.h>
16
17 #include "mlx5_glue.h"
18
19 static int
20 mlx5_glue_fork_init(void)
21 {
22         return ibv_fork_init();
23 }
24
25 static struct ibv_pd *
26 mlx5_glue_alloc_pd(struct ibv_context *context)
27 {
28         return ibv_alloc_pd(context);
29 }
30
31 static int
32 mlx5_glue_dealloc_pd(struct ibv_pd *pd)
33 {
34         return ibv_dealloc_pd(pd);
35 }
36
37 static struct ibv_device **
38 mlx5_glue_get_device_list(int *num_devices)
39 {
40         return ibv_get_device_list(num_devices);
41 }
42
43 static void
44 mlx5_glue_free_device_list(struct ibv_device **list)
45 {
46         ibv_free_device_list(list);
47 }
48
49 static struct ibv_context *
50 mlx5_glue_open_device(struct ibv_device *device)
51 {
52         return ibv_open_device(device);
53 }
54
55 static int
56 mlx5_glue_close_device(struct ibv_context *context)
57 {
58         return ibv_close_device(context);
59 }
60
61 static int
62 mlx5_glue_query_device(struct ibv_context *context,
63                        struct ibv_device_attr *device_attr)
64 {
65         return ibv_query_device(context, device_attr);
66 }
67
68 static int
69 mlx5_glue_query_device_ex(struct ibv_context *context,
70                           const struct ibv_query_device_ex_input *input,
71                           struct ibv_device_attr_ex *attr)
72 {
73         return ibv_query_device_ex(context, input, attr);
74 }
75
76 static int
77 mlx5_glue_query_rt_values_ex(struct ibv_context *context,
78                           struct ibv_values_ex *values)
79 {
80         return ibv_query_rt_values_ex(context, values);
81 }
82
83 static int
84 mlx5_glue_query_port(struct ibv_context *context, uint8_t port_num,
85                      struct ibv_port_attr *port_attr)
86 {
87         return ibv_query_port(context, port_num, port_attr);
88 }
89
90 static struct ibv_comp_channel *
91 mlx5_glue_create_comp_channel(struct ibv_context *context)
92 {
93         return ibv_create_comp_channel(context);
94 }
95
96 static int
97 mlx5_glue_destroy_comp_channel(struct ibv_comp_channel *channel)
98 {
99         return ibv_destroy_comp_channel(channel);
100 }
101
102 static struct ibv_cq *
103 mlx5_glue_create_cq(struct ibv_context *context, int cqe, void *cq_context,
104                     struct ibv_comp_channel *channel, int comp_vector)
105 {
106         return ibv_create_cq(context, cqe, cq_context, channel, comp_vector);
107 }
108
109 static int
110 mlx5_glue_destroy_cq(struct ibv_cq *cq)
111 {
112         return ibv_destroy_cq(cq);
113 }
114
115 static int
116 mlx5_glue_get_cq_event(struct ibv_comp_channel *channel, struct ibv_cq **cq,
117                        void **cq_context)
118 {
119         return ibv_get_cq_event(channel, cq, cq_context);
120 }
121
122 static void
123 mlx5_glue_ack_cq_events(struct ibv_cq *cq, unsigned int nevents)
124 {
125         ibv_ack_cq_events(cq, nevents);
126 }
127
128 static struct ibv_rwq_ind_table *
129 mlx5_glue_create_rwq_ind_table(struct ibv_context *context,
130                                struct ibv_rwq_ind_table_init_attr *init_attr)
131 {
132         return ibv_create_rwq_ind_table(context, init_attr);
133 }
134
135 static int
136 mlx5_glue_destroy_rwq_ind_table(struct ibv_rwq_ind_table *rwq_ind_table)
137 {
138         return ibv_destroy_rwq_ind_table(rwq_ind_table);
139 }
140
141 static struct ibv_wq *
142 mlx5_glue_create_wq(struct ibv_context *context,
143                     struct ibv_wq_init_attr *wq_init_attr)
144 {
145         return ibv_create_wq(context, wq_init_attr);
146 }
147
148 static int
149 mlx5_glue_destroy_wq(struct ibv_wq *wq)
150 {
151         return ibv_destroy_wq(wq);
152 }
153 static int
154 mlx5_glue_modify_wq(struct ibv_wq *wq, struct ibv_wq_attr *wq_attr)
155 {
156         return ibv_modify_wq(wq, wq_attr);
157 }
158
159 static struct ibv_flow *
160 mlx5_glue_create_flow(struct ibv_qp *qp, struct ibv_flow_attr *flow)
161 {
162         return ibv_create_flow(qp, flow);
163 }
164
165 static int
166 mlx5_glue_destroy_flow(struct ibv_flow *flow_id)
167 {
168         return ibv_destroy_flow(flow_id);
169 }
170
171 static int
172 mlx5_glue_destroy_flow_action(void *action)
173 {
174 #ifdef HAVE_IBV_FLOW_DV_SUPPORT
175 #ifdef HAVE_MLX5DV_DR
176         return mlx5dv_dr_action_destroy(action);
177 #else
178         struct mlx5dv_flow_action_attr *attr = action;
179         int res = 0;
180         switch (attr->type) {
181         case MLX5DV_FLOW_ACTION_TAG:
182                 break;
183         default:
184                 res = ibv_destroy_flow_action(attr->action);
185                 break;
186         }
187         free(action);
188         return res;
189 #endif
190 #else
191         (void)action;
192         return -ENOTSUP;
193 #endif
194 }
195
196 static struct ibv_qp *
197 mlx5_glue_create_qp(struct ibv_pd *pd, struct ibv_qp_init_attr *qp_init_attr)
198 {
199         return ibv_create_qp(pd, qp_init_attr);
200 }
201
202 static struct ibv_qp *
203 mlx5_glue_create_qp_ex(struct ibv_context *context,
204                        struct ibv_qp_init_attr_ex *qp_init_attr_ex)
205 {
206         return ibv_create_qp_ex(context, qp_init_attr_ex);
207 }
208
209 static int
210 mlx5_glue_destroy_qp(struct ibv_qp *qp)
211 {
212         return ibv_destroy_qp(qp);
213 }
214
215 static int
216 mlx5_glue_modify_qp(struct ibv_qp *qp, struct ibv_qp_attr *attr, int attr_mask)
217 {
218         return ibv_modify_qp(qp, attr, attr_mask);
219 }
220
221 static struct ibv_mr *
222 mlx5_glue_reg_mr(struct ibv_pd *pd, void *addr, size_t length, int access)
223 {
224         return ibv_reg_mr(pd, addr, length, access);
225 }
226
227 static struct ibv_mr *
228 mlx5_glue_alloc_null_mr(struct ibv_pd *pd)
229 {
230 #ifdef HAVE_IBV_DEVX_OBJ
231         return ibv_alloc_null_mr(pd);
232 #else
233         (void)pd;
234         errno = ENOTSUP;
235         return NULL;
236 #endif
237 }
238
239 static int
240 mlx5_glue_dereg_mr(struct ibv_mr *mr)
241 {
242         return ibv_dereg_mr(mr);
243 }
244
245 static struct ibv_counter_set *
246 mlx5_glue_create_counter_set(struct ibv_context *context,
247                              struct ibv_counter_set_init_attr *init_attr)
248 {
249 #ifndef HAVE_IBV_DEVICE_COUNTERS_SET_V42
250         (void)context;
251         (void)init_attr;
252         return NULL;
253 #else
254         return ibv_create_counter_set(context, init_attr);
255 #endif
256 }
257
258 static int
259 mlx5_glue_destroy_counter_set(struct ibv_counter_set *cs)
260 {
261 #ifndef HAVE_IBV_DEVICE_COUNTERS_SET_V42
262         (void)cs;
263         return -ENOTSUP;
264 #else
265         return ibv_destroy_counter_set(cs);
266 #endif
267 }
268
269 static int
270 mlx5_glue_describe_counter_set(struct ibv_context *context,
271                                uint16_t counter_set_id,
272                                struct ibv_counter_set_description *cs_desc)
273 {
274 #ifndef HAVE_IBV_DEVICE_COUNTERS_SET_V42
275         (void)context;
276         (void)counter_set_id;
277         (void)cs_desc;
278         return -ENOTSUP;
279 #else
280         return ibv_describe_counter_set(context, counter_set_id, cs_desc);
281 #endif
282 }
283
284 static int
285 mlx5_glue_query_counter_set(struct ibv_query_counter_set_attr *query_attr,
286                             struct ibv_counter_set_data *cs_data)
287 {
288 #ifndef HAVE_IBV_DEVICE_COUNTERS_SET_V42
289         (void)query_attr;
290         (void)cs_data;
291         return -ENOTSUP;
292 #else
293         return ibv_query_counter_set(query_attr, cs_data);
294 #endif
295 }
296
297 static struct ibv_counters *
298 mlx5_glue_create_counters(struct ibv_context *context,
299                           struct ibv_counters_init_attr *init_attr)
300 {
301 #ifndef HAVE_IBV_DEVICE_COUNTERS_SET_V45
302         (void)context;
303         (void)init_attr;
304         errno = ENOTSUP;
305         return NULL;
306 #else
307         return ibv_create_counters(context, init_attr);
308 #endif
309 }
310
311 static int
312 mlx5_glue_destroy_counters(struct ibv_counters *counters)
313 {
314 #ifndef HAVE_IBV_DEVICE_COUNTERS_SET_V45
315         (void)counters;
316         return -ENOTSUP;
317 #else
318         return ibv_destroy_counters(counters);
319 #endif
320 }
321
322 static int
323 mlx5_glue_attach_counters(struct ibv_counters *counters,
324                           struct ibv_counter_attach_attr *attr,
325                           struct ibv_flow *flow)
326 {
327 #ifndef HAVE_IBV_DEVICE_COUNTERS_SET_V45
328         (void)counters;
329         (void)attr;
330         (void)flow;
331         return -ENOTSUP;
332 #else
333         return ibv_attach_counters_point_flow(counters, attr, flow);
334 #endif
335 }
336
337 static int
338 mlx5_glue_query_counters(struct ibv_counters *counters,
339                          uint64_t *counters_value,
340                          uint32_t ncounters,
341                          uint32_t flags)
342 {
343 #ifndef HAVE_IBV_DEVICE_COUNTERS_SET_V45
344         (void)counters;
345         (void)counters_value;
346         (void)ncounters;
347         (void)flags;
348         return -ENOTSUP;
349 #else
350         return ibv_read_counters(counters, counters_value, ncounters, flags);
351 #endif
352 }
353
354 static void
355 mlx5_glue_ack_async_event(struct ibv_async_event *event)
356 {
357         ibv_ack_async_event(event);
358 }
359
360 static int
361 mlx5_glue_get_async_event(struct ibv_context *context,
362                           struct ibv_async_event *event)
363 {
364         return ibv_get_async_event(context, event);
365 }
366
367 static const char *
368 mlx5_glue_port_state_str(enum ibv_port_state port_state)
369 {
370         return ibv_port_state_str(port_state);
371 }
372
373 static struct ibv_cq *
374 mlx5_glue_cq_ex_to_cq(struct ibv_cq_ex *cq)
375 {
376         return ibv_cq_ex_to_cq(cq);
377 }
378
379 static void *
380 mlx5_glue_dr_create_flow_action_dest_flow_tbl(void *tbl)
381 {
382 #ifdef HAVE_MLX5DV_DR
383         return mlx5dv_dr_action_create_dest_table(tbl);
384 #else
385         (void)tbl;
386         errno = ENOTSUP;
387         return NULL;
388 #endif
389 }
390
391 static void *
392 mlx5_glue_dr_create_flow_action_dest_port(void *domain, uint32_t port)
393 {
394 #ifdef HAVE_MLX5DV_DR_DEVX_PORT
395         return mlx5dv_dr_action_create_dest_ib_port(domain, port);
396 #else
397 #ifdef HAVE_MLX5DV_DR_ESWITCH
398         return mlx5dv_dr_action_create_dest_vport(domain, port);
399 #else
400         (void)domain;
401         (void)port;
402         errno = ENOTSUP;
403         return NULL;
404 #endif
405 #endif
406 }
407
408 static void *
409 mlx5_glue_dr_create_flow_action_drop(void)
410 {
411 #ifdef HAVE_MLX5DV_DR_ESWITCH
412         return mlx5dv_dr_action_create_drop();
413 #else
414         errno = ENOTSUP;
415         return NULL;
416 #endif
417 }
418
419 static void *
420 mlx5_glue_dr_create_flow_action_push_vlan(struct mlx5dv_dr_domain *domain,
421                                           rte_be32_t vlan_tag)
422 {
423 #ifdef HAVE_MLX5DV_DR_VLAN
424         return mlx5dv_dr_action_create_push_vlan(domain, vlan_tag);
425 #else
426         (void)domain;
427         (void)vlan_tag;
428         errno = ENOTSUP;
429         return NULL;
430 #endif
431 }
432
433 static void *
434 mlx5_glue_dr_create_flow_action_pop_vlan(void)
435 {
436 #ifdef HAVE_MLX5DV_DR_VLAN
437         return mlx5dv_dr_action_create_pop_vlan();
438 #else
439         errno = ENOTSUP;
440         return NULL;
441 #endif
442 }
443
444 static void *
445 mlx5_glue_dr_create_flow_tbl(void *domain, uint32_t level)
446 {
447 #ifdef HAVE_MLX5DV_DR
448         return mlx5dv_dr_table_create(domain, level);
449 #else
450         (void)domain;
451         (void)level;
452         errno = ENOTSUP;
453         return NULL;
454 #endif
455 }
456
457 static int
458 mlx5_glue_dr_destroy_flow_tbl(void *tbl)
459 {
460 #ifdef HAVE_MLX5DV_DR
461         return mlx5dv_dr_table_destroy(tbl);
462 #else
463         (void)tbl;
464         errno = ENOTSUP;
465         return errno;
466 #endif
467 }
468
469 static void *
470 mlx5_glue_dr_create_domain(struct ibv_context *ctx,
471                            enum  mlx5dv_dr_domain_type domain)
472 {
473 #ifdef HAVE_MLX5DV_DR
474         return mlx5dv_dr_domain_create(ctx, domain);
475 #else
476         (void)ctx;
477         (void)domain;
478         errno = ENOTSUP;
479         return NULL;
480 #endif
481 }
482
483 static int
484 mlx5_glue_dr_destroy_domain(void *domain)
485 {
486 #ifdef HAVE_MLX5DV_DR
487         return mlx5dv_dr_domain_destroy(domain);
488 #else
489         (void)domain;
490         errno = ENOTSUP;
491         return errno;
492 #endif
493 }
494
495 static int
496 mlx5_glue_dr_sync_domain(void *domain, uint32_t flags)
497 {
498 #ifdef HAVE_MLX5DV_DR
499         return mlx5dv_dr_domain_sync(domain, flags);
500 #else
501         (void)domain;
502         (void)flags;
503         errno = ENOTSUP;
504         return errno;
505 #endif
506 }
507
508 static struct ibv_cq_ex *
509 mlx5_glue_dv_create_cq(struct ibv_context *context,
510                        struct ibv_cq_init_attr_ex *cq_attr,
511                        struct mlx5dv_cq_init_attr *mlx5_cq_attr)
512 {
513         return mlx5dv_create_cq(context, cq_attr, mlx5_cq_attr);
514 }
515
516 static struct ibv_wq *
517 mlx5_glue_dv_create_wq(struct ibv_context *context,
518                        struct ibv_wq_init_attr *wq_attr,
519                        struct mlx5dv_wq_init_attr *mlx5_wq_attr)
520 {
521 #ifndef HAVE_IBV_DEVICE_STRIDING_RQ_SUPPORT
522         (void)context;
523         (void)wq_attr;
524         (void)mlx5_wq_attr;
525         errno = ENOTSUP;
526         return NULL;
527 #else
528         return mlx5dv_create_wq(context, wq_attr, mlx5_wq_attr);
529 #endif
530 }
531
532 static int
533 mlx5_glue_dv_query_device(struct ibv_context *ctx,
534                           struct mlx5dv_context *attrs_out)
535 {
536         return mlx5dv_query_device(ctx, attrs_out);
537 }
538
539 static int
540 mlx5_glue_dv_set_context_attr(struct ibv_context *ibv_ctx,
541                               enum mlx5dv_set_ctx_attr_type type, void *attr)
542 {
543         return mlx5dv_set_context_attr(ibv_ctx, type, attr);
544 }
545
546 static int
547 mlx5_glue_dv_init_obj(struct mlx5dv_obj *obj, uint64_t obj_type)
548 {
549         return mlx5dv_init_obj(obj, obj_type);
550 }
551
552 static struct ibv_qp *
553 mlx5_glue_dv_create_qp(struct ibv_context *context,
554                        struct ibv_qp_init_attr_ex *qp_init_attr_ex,
555                        struct mlx5dv_qp_init_attr *dv_qp_init_attr)
556 {
557 #ifdef HAVE_IBV_DEVICE_TUNNEL_SUPPORT
558         return mlx5dv_create_qp(context, qp_init_attr_ex, dv_qp_init_attr);
559 #else
560         (void)context;
561         (void)qp_init_attr_ex;
562         (void)dv_qp_init_attr;
563         errno = ENOTSUP;
564         return NULL;
565 #endif
566 }
567
568 static void *
569 mlx5_glue_dv_create_flow_matcher(struct ibv_context *context,
570                                  struct mlx5dv_flow_matcher_attr *matcher_attr,
571                                  void *tbl)
572 {
573 #ifdef HAVE_IBV_FLOW_DV_SUPPORT
574 #ifdef HAVE_MLX5DV_DR
575         (void)context;
576         return mlx5dv_dr_matcher_create(tbl, matcher_attr->priority,
577                                         matcher_attr->match_criteria_enable,
578                                         matcher_attr->match_mask);
579 #else
580         (void)tbl;
581         return mlx5dv_create_flow_matcher(context, matcher_attr);
582 #endif
583 #else
584         (void)context;
585         (void)matcher_attr;
586         (void)tbl;
587         errno = ENOTSUP;
588         return NULL;
589 #endif
590 }
591
592 static void *
593 mlx5_glue_dv_create_flow(void *matcher,
594                          void *match_value,
595                          size_t num_actions,
596                          void *actions[])
597 {
598 #ifdef HAVE_IBV_FLOW_DV_SUPPORT
599 #ifdef HAVE_MLX5DV_DR
600         return mlx5dv_dr_rule_create(matcher, match_value, num_actions,
601                                      (struct mlx5dv_dr_action **)actions);
602 #else
603         size_t i;
604         struct mlx5dv_flow_action_attr actions_attr[8];
605
606         if (num_actions > 8)
607                 return NULL;
608         for (i = 0; i < num_actions; i++)
609                 actions_attr[i] =
610                         *((struct mlx5dv_flow_action_attr *)(actions[i]));
611         return mlx5dv_create_flow(matcher, match_value,
612                                   num_actions, actions_attr);
613 #endif
614 #else
615         (void)matcher;
616         (void)match_value;
617         (void)num_actions;
618         (void)actions;
619         return NULL;
620 #endif
621 }
622
623 static void *
624 mlx5_glue_dv_create_flow_action_counter(void *counter_obj, uint32_t offset)
625 {
626 #ifdef HAVE_IBV_FLOW_DV_SUPPORT
627 #ifdef HAVE_MLX5DV_DR
628         return mlx5dv_dr_action_create_flow_counter(counter_obj, offset);
629 #else
630         struct mlx5dv_flow_action_attr *action;
631
632         (void)offset;
633         action = malloc(sizeof(*action));
634         if (!action)
635                 return NULL;
636         action->type = MLX5DV_FLOW_ACTION_COUNTERS_DEVX;
637         action->obj = counter_obj;
638         return action;
639 #endif
640 #else
641         (void)counter_obj;
642         (void)offset;
643         errno = ENOTSUP;
644         return NULL;
645 #endif
646 }
647
648 static void *
649 mlx5_glue_dv_create_flow_action_dest_ibv_qp(void *qp)
650 {
651 #ifdef HAVE_IBV_FLOW_DV_SUPPORT
652 #ifdef HAVE_MLX5DV_DR
653         return mlx5dv_dr_action_create_dest_ibv_qp(qp);
654 #else
655         struct mlx5dv_flow_action_attr *action;
656
657         action = malloc(sizeof(*action));
658         if (!action)
659                 return NULL;
660         action->type = MLX5DV_FLOW_ACTION_DEST_IBV_QP;
661         action->obj = qp;
662         return action;
663 #endif
664 #else
665         (void)qp;
666         errno = ENOTSUP;
667         return NULL;
668 #endif
669 }
670
671 static void *
672 mlx5_glue_dv_create_flow_action_dest_devx_tir(void *tir)
673 {
674 #ifdef HAVE_MLX5DV_DR_ACTION_DEST_DEVX_TIR
675         return mlx5dv_dr_action_create_dest_devx_tir(tir);
676 #else
677         (void)tir;
678         errno = ENOTSUP;
679         return NULL;
680 #endif
681 }
682
683 static void *
684 mlx5_glue_dv_create_flow_action_modify_header
685                                         (struct ibv_context *ctx,
686                                          enum mlx5dv_flow_table_type ft_type,
687                                          void *domain, uint64_t flags,
688                                          size_t actions_sz,
689                                          uint64_t actions[])
690 {
691 #ifdef HAVE_IBV_FLOW_DV_SUPPORT
692 #ifdef HAVE_MLX5DV_DR
693         (void)ctx;
694         (void)ft_type;
695         return mlx5dv_dr_action_create_modify_header(domain, flags, actions_sz,
696                                                      (__be64 *)actions);
697 #else
698         struct mlx5dv_flow_action_attr *action;
699
700         (void)domain;
701         (void)flags;
702         action = malloc(sizeof(*action));
703         if (!action)
704                 return NULL;
705         action->type = MLX5DV_FLOW_ACTION_IBV_FLOW_ACTION;
706         action->action = mlx5dv_create_flow_action_modify_header
707                 (ctx, actions_sz, actions, ft_type);
708         return action;
709 #endif
710 #else
711         (void)ctx;
712         (void)ft_type;
713         (void)domain;
714         (void)flags;
715         (void)actions_sz;
716         (void)actions;
717         errno = ENOTSUP;
718         return NULL;
719 #endif
720 }
721
722 static void *
723 mlx5_glue_dv_create_flow_action_packet_reformat
724                 (struct ibv_context *ctx,
725                  enum mlx5dv_flow_action_packet_reformat_type reformat_type,
726                  enum mlx5dv_flow_table_type ft_type,
727                  struct mlx5dv_dr_domain *domain,
728                  uint32_t flags, size_t data_sz, void *data)
729 {
730 #ifdef HAVE_IBV_FLOW_DV_SUPPORT
731 #ifdef HAVE_MLX5DV_DR
732         (void)ctx;
733         (void)ft_type;
734         return mlx5dv_dr_action_create_packet_reformat(domain, flags,
735                                                        reformat_type, data_sz,
736                                                        data);
737 #else
738         (void)domain;
739         (void)flags;
740         struct mlx5dv_flow_action_attr *action;
741
742         action = malloc(sizeof(*action));
743         if (!action)
744                 return NULL;
745         action->type = MLX5DV_FLOW_ACTION_IBV_FLOW_ACTION;
746         action->action = mlx5dv_create_flow_action_packet_reformat
747                 (ctx, data_sz, data, reformat_type, ft_type);
748         return action;
749 #endif
750 #else
751         (void)ctx;
752         (void)reformat_type;
753         (void)ft_type;
754         (void)domain;
755         (void)flags;
756         (void)data_sz;
757         (void)data;
758         errno = ENOTSUP;
759         return NULL;
760 #endif
761 }
762
763 static void *
764 mlx5_glue_dv_create_flow_action_tag(uint32_t tag)
765 {
766 #ifdef HAVE_IBV_FLOW_DV_SUPPORT
767 #ifdef HAVE_MLX5DV_DR
768         return mlx5dv_dr_action_create_tag(tag);
769 #else /* HAVE_MLX5DV_DR */
770         struct mlx5dv_flow_action_attr *action;
771
772         action = malloc(sizeof(*action));
773         if (!action)
774                 return NULL;
775         action->type = MLX5DV_FLOW_ACTION_TAG;
776         action->tag_value = tag;
777         return action;
778 #endif /* HAVE_MLX5DV_DR */
779 #else /* HAVE_IBV_FLOW_DV_SUPPORT */
780         (void)tag;
781         errno = ENOTSUP;
782         return NULL;
783 #endif /* HAVE_IBV_FLOW_DV_SUPPORT */
784 }
785
786 static void *
787 mlx5_glue_dv_create_flow_action_meter(struct mlx5dv_dr_flow_meter_attr *attr)
788 {
789 #if defined(HAVE_MLX5DV_DR) && defined(HAVE_MLX5_DR_CREATE_ACTION_FLOW_METER)
790         return mlx5dv_dr_action_create_flow_meter(attr);
791 #else
792         (void)attr;
793         errno = ENOTSUP;
794         return NULL;
795 #endif
796 }
797
798 static int
799 mlx5_glue_dv_modify_flow_action_meter(void *action,
800                                       struct mlx5dv_dr_flow_meter_attr *attr,
801                                       uint64_t modify_bits)
802 {
803 #if defined(HAVE_MLX5DV_DR) && defined(HAVE_MLX5_DR_CREATE_ACTION_FLOW_METER)
804         return mlx5dv_dr_action_modify_flow_meter(action, attr, modify_bits);
805 #else
806         (void)action;
807         (void)attr;
808         (void)modify_bits;
809         errno = ENOTSUP;
810         return errno;
811 #endif
812 }
813
814 static void *
815 mlx5_glue_dv_create_flow_action_aso(struct mlx5dv_dr_domain *domain,
816                                     void *aso_obj,
817                                     uint32_t offset,
818                                     uint32_t flags,
819                                     uint8_t return_reg_c)
820 {
821 #if defined(HAVE_MLX5DV_DR) && defined(HAVE_MLX5_DR_CREATE_ACTION_ASO)
822         return mlx5dv_dr_action_create_aso(domain, aso_obj, offset,
823                                            flags, return_reg_c);
824 #else
825         (void)domain;
826         (void)aso_obj;
827         (void)offset;
828         (void)flags;
829         (void)return_reg_c;
830         errno = ENOTSUP;
831         return NULL;
832 #endif
833 }
834
835 static void *
836 mlx5_glue_dr_create_flow_action_default_miss(void)
837 {
838 #if defined(HAVE_MLX5DV_DR) && defined(HAVE_MLX5_DR_CREATE_ACTION_DEFAULT_MISS)
839         return mlx5dv_dr_action_create_default_miss();
840 #else
841         errno = ENOTSUP;
842         return NULL;
843 #endif
844 }
845
846 static int
847 mlx5_glue_dv_destroy_flow(void *flow_id)
848 {
849 #ifdef HAVE_MLX5DV_DR
850         return mlx5dv_dr_rule_destroy(flow_id);
851 #else
852         return ibv_destroy_flow(flow_id);
853 #endif
854 }
855
856 static int
857 mlx5_glue_dv_destroy_flow_matcher(void *matcher)
858 {
859 #ifdef HAVE_IBV_FLOW_DV_SUPPORT
860 #ifdef HAVE_MLX5DV_DR
861         return mlx5dv_dr_matcher_destroy(matcher);
862 #else
863         return mlx5dv_destroy_flow_matcher(matcher);
864 #endif
865 #else
866         (void)matcher;
867         errno = ENOTSUP;
868         return errno;
869 #endif
870 }
871
872 static struct ibv_context *
873 mlx5_glue_dv_open_device(struct ibv_device *device)
874 {
875 #ifdef HAVE_IBV_DEVX_OBJ
876         return mlx5dv_open_device(device,
877                                   &(struct mlx5dv_context_attr){
878                                         .flags = MLX5DV_CONTEXT_FLAGS_DEVX,
879                                   });
880 #else
881         (void)device;
882         errno = ENOTSUP;
883         return NULL;
884 #endif
885 }
886
887 static struct mlx5dv_devx_obj *
888 mlx5_glue_devx_obj_create(struct ibv_context *ctx,
889                           const void *in, size_t inlen,
890                           void *out, size_t outlen)
891 {
892 #ifdef HAVE_IBV_DEVX_OBJ
893         return mlx5dv_devx_obj_create(ctx, in, inlen, out, outlen);
894 #else
895         (void)ctx;
896         (void)in;
897         (void)inlen;
898         (void)out;
899         (void)outlen;
900         errno = ENOTSUP;
901         return NULL;
902 #endif
903 }
904
905 static int
906 mlx5_glue_devx_obj_destroy(struct mlx5dv_devx_obj *obj)
907 {
908 #ifdef HAVE_IBV_DEVX_OBJ
909         return mlx5dv_devx_obj_destroy(obj);
910 #else
911         (void)obj;
912         return -ENOTSUP;
913 #endif
914 }
915
916 static int
917 mlx5_glue_devx_obj_query(struct mlx5dv_devx_obj *obj,
918                          const void *in, size_t inlen,
919                          void *out, size_t outlen)
920 {
921 #ifdef HAVE_IBV_DEVX_OBJ
922         return mlx5dv_devx_obj_query(obj, in, inlen, out, outlen);
923 #else
924         (void)obj;
925         (void)in;
926         (void)inlen;
927         (void)out;
928         (void)outlen;
929         return -ENOTSUP;
930 #endif
931 }
932
933 static int
934 mlx5_glue_devx_obj_modify(struct mlx5dv_devx_obj *obj,
935                           const void *in, size_t inlen,
936                           void *out, size_t outlen)
937 {
938 #ifdef HAVE_IBV_DEVX_OBJ
939         return mlx5dv_devx_obj_modify(obj, in, inlen, out, outlen);
940 #else
941         (void)obj;
942         (void)in;
943         (void)inlen;
944         (void)out;
945         (void)outlen;
946         return -ENOTSUP;
947 #endif
948 }
949
950 static int
951 mlx5_glue_devx_general_cmd(struct ibv_context *ctx,
952                            const void *in, size_t inlen,
953                            void *out, size_t outlen)
954 {
955 #ifdef HAVE_IBV_DEVX_OBJ
956         return mlx5dv_devx_general_cmd(ctx, in, inlen, out, outlen);
957 #else
958         (void)ctx;
959         (void)in;
960         (void)inlen;
961         (void)out;
962         (void)outlen;
963         return -ENOTSUP;
964 #endif
965 }
966
967 static struct mlx5dv_devx_cmd_comp *
968 mlx5_glue_devx_create_cmd_comp(struct ibv_context *ctx)
969 {
970 #ifdef HAVE_IBV_DEVX_ASYNC
971         return mlx5dv_devx_create_cmd_comp(ctx);
972 #else
973         (void)ctx;
974         errno = -ENOTSUP;
975         return NULL;
976 #endif
977 }
978
979 static void
980 mlx5_glue_devx_destroy_cmd_comp(struct mlx5dv_devx_cmd_comp *cmd_comp)
981 {
982 #ifdef HAVE_IBV_DEVX_ASYNC
983         mlx5dv_devx_destroy_cmd_comp(cmd_comp);
984 #else
985         (void)cmd_comp;
986         errno = -ENOTSUP;
987 #endif
988 }
989
990 static int
991 mlx5_glue_devx_obj_query_async(struct mlx5dv_devx_obj *obj, const void *in,
992                                size_t inlen, size_t outlen, uint64_t wr_id,
993                                struct mlx5dv_devx_cmd_comp *cmd_comp)
994 {
995 #ifdef HAVE_IBV_DEVX_ASYNC
996         return mlx5dv_devx_obj_query_async(obj, in, inlen, outlen, wr_id,
997                                            cmd_comp);
998 #else
999         (void)obj;
1000         (void)in;
1001         (void)inlen;
1002         (void)outlen;
1003         (void)wr_id;
1004         (void)cmd_comp;
1005         return -ENOTSUP;
1006 #endif
1007 }
1008
1009 static int
1010 mlx5_glue_devx_get_async_cmd_comp(struct mlx5dv_devx_cmd_comp *cmd_comp,
1011                                   struct mlx5dv_devx_async_cmd_hdr *cmd_resp,
1012                                   size_t cmd_resp_len)
1013 {
1014 #ifdef HAVE_IBV_DEVX_ASYNC
1015         return mlx5dv_devx_get_async_cmd_comp(cmd_comp, cmd_resp,
1016                                               cmd_resp_len);
1017 #else
1018         (void)cmd_comp;
1019         (void)cmd_resp;
1020         (void)cmd_resp_len;
1021         return -ENOTSUP;
1022 #endif
1023 }
1024
1025 static struct mlx5dv_devx_umem *
1026 mlx5_glue_devx_umem_reg(struct ibv_context *context, void *addr, size_t size,
1027                         uint32_t access)
1028 {
1029 #ifdef HAVE_IBV_DEVX_OBJ
1030         return mlx5dv_devx_umem_reg(context, addr, size, access);
1031 #else
1032         (void)context;
1033         (void)addr;
1034         (void)size;
1035         (void)access;
1036         errno = -ENOTSUP;
1037         return NULL;
1038 #endif
1039 }
1040
1041 static int
1042 mlx5_glue_devx_umem_dereg(struct mlx5dv_devx_umem *dv_devx_umem)
1043 {
1044 #ifdef HAVE_IBV_DEVX_OBJ
1045         return mlx5dv_devx_umem_dereg(dv_devx_umem);
1046 #else
1047         (void)dv_devx_umem;
1048         return -ENOTSUP;
1049 #endif
1050 }
1051
1052 static int
1053 mlx5_glue_devx_qp_query(struct ibv_qp *qp,
1054                         const void *in, size_t inlen,
1055                         void *out, size_t outlen)
1056 {
1057 #ifdef HAVE_IBV_DEVX_QP
1058         return mlx5dv_devx_qp_query(qp, in, inlen, out, outlen);
1059 #else
1060         (void)qp;
1061         (void)in;
1062         (void)inlen;
1063         (void)out;
1064         (void)outlen;
1065         errno = ENOTSUP;
1066         return errno;
1067 #endif
1068 }
1069
1070 static int
1071 mlx5_glue_devx_port_query(struct ibv_context *ctx,
1072                           uint32_t port_num,
1073                           struct mlx5dv_devx_port *mlx5_devx_port)
1074 {
1075 #ifdef HAVE_MLX5DV_DR_DEVX_PORT
1076         return mlx5dv_query_devx_port(ctx, port_num, mlx5_devx_port);
1077 #else
1078         (void)ctx;
1079         (void)port_num;
1080         (void)mlx5_devx_port;
1081         errno = ENOTSUP;
1082         return errno;
1083 #endif
1084 }
1085
1086 static int
1087 mlx5_glue_dr_dump_domain(FILE *file, void *domain)
1088 {
1089 #ifdef HAVE_MLX5_DR_FLOW_DUMP
1090         return mlx5dv_dump_dr_domain(file, domain);
1091 #else
1092         RTE_SET_USED(file);
1093         RTE_SET_USED(domain);
1094         return -ENOTSUP;
1095 #endif
1096 }
1097
1098 static void *
1099 mlx5_glue_dr_create_flow_action_sampler
1100                         (struct mlx5dv_dr_flow_sampler_attr *attr)
1101 {
1102 #ifdef HAVE_MLX5_DR_CREATE_ACTION_FLOW_SAMPLE
1103         return mlx5dv_dr_action_create_flow_sampler(attr);
1104 #else
1105         (void)attr;
1106         errno = ENOTSUP;
1107         return NULL;
1108 #endif
1109 }
1110
1111 static void *
1112 mlx5_glue_dr_action_create_dest_array
1113                         (void *domain,
1114                          size_t num_dest,
1115                          struct mlx5dv_dr_action_dest_attr *dests[])
1116 {
1117 #ifdef HAVE_MLX5_DR_CREATE_ACTION_DEST_ARRAY
1118         return mlx5dv_dr_action_create_dest_array
1119                                 (domain,
1120                                 num_dest,
1121                                 dests);
1122 #else
1123         (void)domain;
1124         (void)num_dest;
1125         (void)dests;
1126         errno = ENOTSUP;
1127         return NULL;
1128 #endif
1129 }
1130
1131 static int
1132 mlx5_glue_devx_query_eqn(struct ibv_context *ctx, uint32_t cpus,
1133                          uint32_t *eqn)
1134 {
1135 #ifdef HAVE_IBV_DEVX_OBJ
1136         return mlx5dv_devx_query_eqn(ctx, cpus, eqn);
1137 #else
1138         (void)ctx;
1139         (void)cpus;
1140         (void)eqn;
1141         return -ENOTSUP;
1142 #endif
1143 }
1144
1145 static struct mlx5dv_devx_event_channel *
1146 mlx5_glue_devx_create_event_channel(struct ibv_context *ctx, int flags)
1147 {
1148 #ifdef HAVE_IBV_DEVX_EVENT
1149         return mlx5dv_devx_create_event_channel(ctx, flags);
1150 #else
1151         (void)ctx;
1152         (void)flags;
1153         errno = ENOTSUP;
1154         return NULL;
1155 #endif
1156 }
1157
1158 static void
1159 mlx5_glue_devx_destroy_event_channel(struct mlx5dv_devx_event_channel *eventc)
1160 {
1161 #ifdef HAVE_IBV_DEVX_EVENT
1162         mlx5dv_devx_destroy_event_channel(eventc);
1163 #else
1164         (void)eventc;
1165 #endif
1166 }
1167
1168 static int
1169 mlx5_glue_devx_subscribe_devx_event(struct mlx5dv_devx_event_channel *eventc,
1170                                     struct mlx5dv_devx_obj *obj,
1171                                     uint16_t events_sz, uint16_t events_num[],
1172                                     uint64_t cookie)
1173 {
1174 #ifdef HAVE_IBV_DEVX_EVENT
1175         return mlx5dv_devx_subscribe_devx_event(eventc, obj, events_sz,
1176                                                 events_num, cookie);
1177 #else
1178         (void)eventc;
1179         (void)obj;
1180         (void)events_sz;
1181         (void)events_num;
1182         (void)cookie;
1183         return -ENOTSUP;
1184 #endif
1185 }
1186
1187 static int
1188 mlx5_glue_devx_subscribe_devx_event_fd(struct mlx5dv_devx_event_channel *eventc,
1189                                        int fd, struct mlx5dv_devx_obj *obj,
1190                                        uint16_t event_num)
1191 {
1192 #ifdef HAVE_IBV_DEVX_EVENT
1193         return mlx5dv_devx_subscribe_devx_event_fd(eventc, fd, obj, event_num);
1194 #else
1195         (void)eventc;
1196         (void)fd;
1197         (void)obj;
1198         (void)event_num;
1199         return -ENOTSUP;
1200 #endif
1201 }
1202
1203 static ssize_t
1204 mlx5_glue_devx_get_event(struct mlx5dv_devx_event_channel *eventc,
1205                          struct mlx5dv_devx_async_event_hdr *event_data,
1206                          size_t event_resp_len)
1207 {
1208 #ifdef HAVE_IBV_DEVX_EVENT
1209         return mlx5dv_devx_get_event(eventc, event_data, event_resp_len);
1210 #else
1211         (void)eventc;
1212         (void)event_data;
1213         (void)event_resp_len;
1214         errno = ENOTSUP;
1215         return -1;
1216 #endif
1217 }
1218
1219 static struct mlx5dv_devx_uar *
1220 mlx5_glue_devx_alloc_uar(struct ibv_context *context, uint32_t flags)
1221 {
1222 #ifdef HAVE_IBV_DEVX_OBJ
1223         return mlx5dv_devx_alloc_uar(context, flags);
1224 #else
1225         (void)context;
1226         (void)flags;
1227         errno = ENOTSUP;
1228         return NULL;
1229 #endif
1230 }
1231
1232 static void
1233 mlx5_glue_devx_free_uar(struct mlx5dv_devx_uar *devx_uar)
1234 {
1235 #ifdef HAVE_IBV_DEVX_OBJ
1236         mlx5dv_devx_free_uar(devx_uar);
1237 #else
1238         (void)devx_uar;
1239 #endif
1240 }
1241
1242 static struct mlx5dv_var *
1243 mlx5_glue_dv_alloc_var(struct ibv_context *context, uint32_t flags)
1244 {
1245 #ifdef HAVE_IBV_VAR
1246         return mlx5dv_alloc_var(context, flags);
1247 #else
1248         (void)context;
1249         (void)flags;
1250         errno = ENOTSUP;
1251         return NULL;
1252 #endif
1253 }
1254
1255 static void
1256 mlx5_glue_dv_free_var(struct mlx5dv_var *var)
1257 {
1258 #ifdef HAVE_IBV_VAR
1259         mlx5dv_free_var(var);
1260 #else
1261         (void)var;
1262         errno = ENOTSUP;
1263 #endif
1264 }
1265
1266 static void
1267 mlx5_glue_dr_reclaim_domain_memory(void *domain, uint32_t enable)
1268 {
1269 #ifdef HAVE_MLX5DV_DR_MEM_RECLAIM
1270         mlx5dv_dr_domain_set_reclaim_device_memory(domain, enable);
1271 #else
1272         (void)(enable);
1273         (void)(domain);
1274 #endif
1275 }
1276
1277 static struct mlx5dv_pp *
1278 mlx5_glue_dv_alloc_pp(struct ibv_context *context,
1279                       size_t pp_context_sz,
1280                       const void *pp_context,
1281                       uint32_t flags)
1282 {
1283 #ifdef HAVE_MLX5DV_PP_ALLOC
1284         return mlx5dv_pp_alloc(context, pp_context_sz, pp_context, flags);
1285 #else
1286         RTE_SET_USED(context);
1287         RTE_SET_USED(pp_context_sz);
1288         RTE_SET_USED(pp_context);
1289         RTE_SET_USED(flags);
1290         errno = ENOTSUP;
1291         return NULL;
1292 #endif
1293 }
1294
1295 static void
1296 mlx5_glue_dv_free_pp(struct mlx5dv_pp *pp)
1297 {
1298 #ifdef HAVE_MLX5DV_PP_ALLOC
1299         mlx5dv_pp_free(pp);
1300 #else
1301         RTE_SET_USED(pp);
1302 #endif
1303 }
1304
1305 __rte_cache_aligned
1306 const struct mlx5_glue *mlx5_glue = &(const struct mlx5_glue) {
1307         .version = MLX5_GLUE_VERSION,
1308         .fork_init = mlx5_glue_fork_init,
1309         .alloc_pd = mlx5_glue_alloc_pd,
1310         .dealloc_pd = mlx5_glue_dealloc_pd,
1311         .get_device_list = mlx5_glue_get_device_list,
1312         .free_device_list = mlx5_glue_free_device_list,
1313         .open_device = mlx5_glue_open_device,
1314         .close_device = mlx5_glue_close_device,
1315         .query_device = mlx5_glue_query_device,
1316         .query_device_ex = mlx5_glue_query_device_ex,
1317         .query_rt_values_ex = mlx5_glue_query_rt_values_ex,
1318         .query_port = mlx5_glue_query_port,
1319         .create_comp_channel = mlx5_glue_create_comp_channel,
1320         .destroy_comp_channel = mlx5_glue_destroy_comp_channel,
1321         .create_cq = mlx5_glue_create_cq,
1322         .destroy_cq = mlx5_glue_destroy_cq,
1323         .get_cq_event = mlx5_glue_get_cq_event,
1324         .ack_cq_events = mlx5_glue_ack_cq_events,
1325         .create_rwq_ind_table = mlx5_glue_create_rwq_ind_table,
1326         .destroy_rwq_ind_table = mlx5_glue_destroy_rwq_ind_table,
1327         .create_wq = mlx5_glue_create_wq,
1328         .destroy_wq = mlx5_glue_destroy_wq,
1329         .modify_wq = mlx5_glue_modify_wq,
1330         .create_flow = mlx5_glue_create_flow,
1331         .destroy_flow = mlx5_glue_destroy_flow,
1332         .destroy_flow_action = mlx5_glue_destroy_flow_action,
1333         .create_qp = mlx5_glue_create_qp,
1334         .create_qp_ex = mlx5_glue_create_qp_ex,
1335         .destroy_qp = mlx5_glue_destroy_qp,
1336         .modify_qp = mlx5_glue_modify_qp,
1337         .reg_mr = mlx5_glue_reg_mr,
1338         .alloc_null_mr = mlx5_glue_alloc_null_mr,
1339         .dereg_mr = mlx5_glue_dereg_mr,
1340         .create_counter_set = mlx5_glue_create_counter_set,
1341         .destroy_counter_set = mlx5_glue_destroy_counter_set,
1342         .describe_counter_set = mlx5_glue_describe_counter_set,
1343         .query_counter_set = mlx5_glue_query_counter_set,
1344         .create_counters = mlx5_glue_create_counters,
1345         .destroy_counters = mlx5_glue_destroy_counters,
1346         .attach_counters = mlx5_glue_attach_counters,
1347         .query_counters = mlx5_glue_query_counters,
1348         .ack_async_event = mlx5_glue_ack_async_event,
1349         .get_async_event = mlx5_glue_get_async_event,
1350         .port_state_str = mlx5_glue_port_state_str,
1351         .cq_ex_to_cq = mlx5_glue_cq_ex_to_cq,
1352         .dr_create_flow_action_dest_flow_tbl =
1353                 mlx5_glue_dr_create_flow_action_dest_flow_tbl,
1354         .dr_create_flow_action_dest_port =
1355                 mlx5_glue_dr_create_flow_action_dest_port,
1356         .dr_create_flow_action_drop =
1357                 mlx5_glue_dr_create_flow_action_drop,
1358         .dr_create_flow_action_push_vlan =
1359                 mlx5_glue_dr_create_flow_action_push_vlan,
1360         .dr_create_flow_action_pop_vlan =
1361                 mlx5_glue_dr_create_flow_action_pop_vlan,
1362         .dr_create_flow_tbl = mlx5_glue_dr_create_flow_tbl,
1363         .dr_destroy_flow_tbl = mlx5_glue_dr_destroy_flow_tbl,
1364         .dr_create_domain = mlx5_glue_dr_create_domain,
1365         .dr_destroy_domain = mlx5_glue_dr_destroy_domain,
1366         .dr_sync_domain = mlx5_glue_dr_sync_domain,
1367         .dv_create_cq = mlx5_glue_dv_create_cq,
1368         .dv_create_wq = mlx5_glue_dv_create_wq,
1369         .dv_query_device = mlx5_glue_dv_query_device,
1370         .dv_set_context_attr = mlx5_glue_dv_set_context_attr,
1371         .dv_init_obj = mlx5_glue_dv_init_obj,
1372         .dv_create_qp = mlx5_glue_dv_create_qp,
1373         .dv_create_flow_matcher = mlx5_glue_dv_create_flow_matcher,
1374         .dv_create_flow = mlx5_glue_dv_create_flow,
1375         .dv_create_flow_action_counter =
1376                 mlx5_glue_dv_create_flow_action_counter,
1377         .dv_create_flow_action_dest_ibv_qp =
1378                 mlx5_glue_dv_create_flow_action_dest_ibv_qp,
1379         .dv_create_flow_action_dest_devx_tir =
1380                 mlx5_glue_dv_create_flow_action_dest_devx_tir,
1381         .dv_create_flow_action_modify_header =
1382                 mlx5_glue_dv_create_flow_action_modify_header,
1383         .dv_create_flow_action_packet_reformat =
1384                 mlx5_glue_dv_create_flow_action_packet_reformat,
1385         .dv_create_flow_action_tag =  mlx5_glue_dv_create_flow_action_tag,
1386         .dv_create_flow_action_meter = mlx5_glue_dv_create_flow_action_meter,
1387         .dv_modify_flow_action_meter = mlx5_glue_dv_modify_flow_action_meter,
1388         .dv_create_flow_action_aso = mlx5_glue_dv_create_flow_action_aso,
1389         .dr_create_flow_action_default_miss =
1390                 mlx5_glue_dr_create_flow_action_default_miss,
1391         .dv_destroy_flow = mlx5_glue_dv_destroy_flow,
1392         .dv_destroy_flow_matcher = mlx5_glue_dv_destroy_flow_matcher,
1393         .dv_open_device = mlx5_glue_dv_open_device,
1394         .devx_obj_create = mlx5_glue_devx_obj_create,
1395         .devx_obj_destroy = mlx5_glue_devx_obj_destroy,
1396         .devx_obj_query = mlx5_glue_devx_obj_query,
1397         .devx_obj_modify = mlx5_glue_devx_obj_modify,
1398         .devx_general_cmd = mlx5_glue_devx_general_cmd,
1399         .devx_create_cmd_comp = mlx5_glue_devx_create_cmd_comp,
1400         .devx_destroy_cmd_comp = mlx5_glue_devx_destroy_cmd_comp,
1401         .devx_obj_query_async = mlx5_glue_devx_obj_query_async,
1402         .devx_get_async_cmd_comp = mlx5_glue_devx_get_async_cmd_comp,
1403         .devx_umem_reg = mlx5_glue_devx_umem_reg,
1404         .devx_umem_dereg = mlx5_glue_devx_umem_dereg,
1405         .devx_qp_query = mlx5_glue_devx_qp_query,
1406         .devx_port_query = mlx5_glue_devx_port_query,
1407         .dr_dump_domain = mlx5_glue_dr_dump_domain,
1408         .dr_reclaim_domain_memory = mlx5_glue_dr_reclaim_domain_memory,
1409         .dr_create_flow_action_sampler =
1410                 mlx5_glue_dr_create_flow_action_sampler,
1411         .dr_create_flow_action_dest_array =
1412                 mlx5_glue_dr_action_create_dest_array,
1413         .devx_query_eqn = mlx5_glue_devx_query_eqn,
1414         .devx_create_event_channel = mlx5_glue_devx_create_event_channel,
1415         .devx_destroy_event_channel = mlx5_glue_devx_destroy_event_channel,
1416         .devx_subscribe_devx_event = mlx5_glue_devx_subscribe_devx_event,
1417         .devx_subscribe_devx_event_fd = mlx5_glue_devx_subscribe_devx_event_fd,
1418         .devx_get_event = mlx5_glue_devx_get_event,
1419         .devx_alloc_uar = mlx5_glue_devx_alloc_uar,
1420         .devx_free_uar = mlx5_glue_devx_free_uar,
1421         .dv_alloc_var = mlx5_glue_dv_alloc_var,
1422         .dv_free_var = mlx5_glue_dv_free_var,
1423         .dv_alloc_pp = mlx5_glue_dv_alloc_pp,
1424         .dv_free_pp = mlx5_glue_dv_free_pp,
1425 };