impl.cpp 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630
  1. #include "symbols.h"
  2. #include <util/generic/yexception.h>
  3. template <typename Method, typename... Args>
  4. static auto Call(Method* m, Args&&... args) {
  5. Y_ENSURE(m);
  6. return m(std::forward<Args>(args)...);
  7. }
  8. // verbs
  9. Y_HIDDEN
  10. int ibv_modify_qp(struct ibv_qp *qp, struct ibv_qp_attr *attr, int attr_mask) {
  11. return Call(IBSym()->ibv_modify_qp, qp, attr, attr_mask);
  12. }
  13. Y_HIDDEN
  14. struct ibv_ah *ibv_create_ah(struct ibv_pd *pd, struct ibv_ah_attr *attr) {
  15. return Call(IBSym()->ibv_create_ah, pd, attr);
  16. }
  17. Y_HIDDEN
  18. struct ibv_cq *ibv_create_cq(struct ibv_context *context, int cqe, void *cq_context, struct ibv_comp_channel *channel, int comp_vector) {
  19. return Call(IBSym()->ibv_create_cq, context, cqe, cq_context, channel, comp_vector);
  20. }
  21. Y_HIDDEN
  22. int ibv_destroy_ah(struct ibv_ah *ah) {
  23. return Call(IBSym()->ibv_destroy_ah, ah);
  24. }
  25. Y_HIDDEN
  26. struct ibv_qp *ibv_create_qp(struct ibv_pd *pd, struct ibv_qp_init_attr *qp_init_attr) {
  27. return Call(IBSym()->ibv_create_qp, pd, qp_init_attr);
  28. }
  29. Y_HIDDEN
  30. int ibv_fork_init() {
  31. return Call(IBSym()->ibv_fork_init);
  32. }
  33. Y_HIDDEN
  34. struct ibv_context *ibv_open_device(struct ibv_device *device) {
  35. return Call(IBSym()->ibv_open_device, device);
  36. }
  37. Y_HIDDEN
  38. int ibv_close_device(struct ibv_context *context) {
  39. return Call(IBSym()->ibv_close_device, context);
  40. }
  41. Y_HIDDEN
  42. struct ibv_pd *ibv_alloc_pd(struct ibv_context *context) {
  43. return Call(IBSym()->ibv_alloc_pd, context);
  44. }
  45. Y_HIDDEN
  46. int ibv_dealloc_pd(struct ibv_pd *pd) {
  47. return Call(IBSym()->ibv_dealloc_pd, pd);
  48. }
  49. Y_HIDDEN
  50. void ibv_free_device_list(struct ibv_device **list) {
  51. return Call(IBSym()->ibv_free_device_list, list);
  52. }
  53. Y_HIDDEN
  54. int ibv_query_device(struct ibv_context *context, struct ibv_device_attr *device_attr) {
  55. return Call(IBSym()->ibv_query_device, context, device_attr);
  56. }
  57. Y_HIDDEN
  58. struct ibv_device **ibv_get_device_list(int *num_devices) {
  59. return Call(IBSym()->ibv_get_device_list, num_devices);
  60. }
  61. Y_HIDDEN
  62. int ibv_destroy_qp(struct ibv_qp *qp) {
  63. return Call(IBSym()->ibv_destroy_qp, qp);
  64. }
  65. Y_HIDDEN
  66. struct ibv_srq *ibv_create_srq(struct ibv_pd *pd, struct ibv_srq_init_attr *srq_init_attr) {
  67. return Call(IBSym()->ibv_create_srq, pd, srq_init_attr);
  68. }
  69. Y_HIDDEN
  70. int ibv_destroy_srq(struct ibv_srq *srq) {
  71. return Call(IBSym()->ibv_destroy_srq, srq);
  72. }
  73. Y_HIDDEN
  74. int ibv_init_ah_from_wc(struct ibv_context *context, uint8_t port_num, struct ibv_wc *wc, struct ibv_grh *grh, struct ibv_ah_attr *ah_attr) {
  75. return Call(IBSym()->ibv_init_ah_from_wc, context, port_num, wc, grh, ah_attr);
  76. }
  77. Y_HIDDEN
  78. struct ibv_mr *ibv_reg_mr(struct ibv_pd *pd, void *addr, size_t length, int access) {
  79. return Call(IBSym()->ibv_reg_mr, pd, addr, length, access);
  80. }
  81. Y_HIDDEN
  82. struct ibv_mr *ibv_reg_mr_iova2(struct ibv_pd *pd, void *addr, size_t length, uint64_t iova, unsigned int access) {
  83. return Call(IBSym()->ibv_reg_mr_iova2, pd, addr, length, iova, access);
  84. }
  85. Y_HIDDEN
  86. int ibv_dereg_mr(struct ibv_mr *mr) {
  87. return Call(IBSym()->ibv_dereg_mr, mr);
  88. }
  89. Y_HIDDEN
  90. int ibv_destroy_cq(struct ibv_cq *cq) {
  91. return Call(IBSym()->ibv_destroy_cq, cq);
  92. }
  93. Y_HIDDEN
  94. int ibv_query_gid(struct ibv_context *context, uint8_t port_num, int index, union ibv_gid *gid) {
  95. return Call(IBSym()->ibv_query_gid, context, port_num, index, gid);
  96. }
  97. Y_HIDDEN
  98. int ibv_query_port(struct ibv_context *context, uint8_t port_num, struct _compat_ibv_port_attr *port_attr) {
  99. return Call(IBSym()->ibv_query_port, context, port_num, port_attr);
  100. }
  101. Y_HIDDEN
  102. const char *ibv_wc_status_str(enum ibv_wc_status status) {
  103. return Call(IBSym()->ibv_wc_status_str, status);
  104. }
  105. Y_HIDDEN
  106. const char *ibv_get_device_name(struct ibv_device *device) {
  107. return Call(IBSym()->ibv_get_device_name, device);
  108. }
  109. Y_HIDDEN
  110. int ibv_get_async_event(struct ibv_context *context, struct ibv_async_event *event) {
  111. return Call(IBSym()->ibv_get_async_event, context, event);
  112. }
  113. Y_HIDDEN
  114. const char *ibv_event_type_str(enum ibv_event_type event) {
  115. return Call(IBSym()->ibv_event_type_str, event);
  116. }
  117. Y_HIDDEN
  118. int ibv_query_qp(struct ibv_qp *qp, struct ibv_qp_attr *attr, int attr_mask, struct ibv_qp_init_attr *init_attr) {
  119. return Call(IBSym()->ibv_query_qp, qp, attr, attr_mask, init_attr);
  120. }
  121. Y_HIDDEN
  122. int ibv_resize_cq(struct ibv_cq *cq, int cqe) {
  123. return Call(IBSym()->ibv_resize_cq, cq, cqe);
  124. }
  125. Y_HIDDEN
  126. void ibv_ack_async_event(struct ibv_async_event *event) {
  127. return Call(IBSym()->ibv_ack_async_event, event);
  128. }
  129. Y_HIDDEN
  130. struct ibv_comp_channel *ibv_create_comp_channel(struct ibv_context *context) {
  131. return Call(IBSym()->ibv_create_comp_channel, context);
  132. }
  133. Y_HIDDEN
  134. int ibv_destroy_comp_channel(struct ibv_comp_channel *channel) {
  135. return Call(IBSym()->ibv_destroy_comp_channel, channel);
  136. }
  137. Y_HIDDEN
  138. int ibv_get_cq_event(struct ibv_comp_channel *channel, struct ibv_cq **cq, void **cq_context) {
  139. return Call(IBSym()->ibv_get_cq_event, channel, cq, cq_context);
  140. }
  141. Y_HIDDEN
  142. void ibv_ack_cq_events(struct ibv_cq *cq, unsigned int nevents) {
  143. return Call(IBSym()->ibv_ack_cq_events, cq, nevents);
  144. }
  145. Y_HIDDEN
  146. const char *ibv_port_state_str(enum ibv_port_state port_state) {
  147. return Call(IBSym()->ibv_port_state_str, port_state);
  148. }
  149. // rdma
  150. Y_HIDDEN
  151. int rdma_ack_cm_event(struct rdma_cm_event *event) {
  152. return Call(RDSym()->rdma_ack_cm_event, event);
  153. }
  154. Y_HIDDEN
  155. int rdma_get_cm_event(struct rdma_event_channel *channel, struct rdma_cm_event **event) {
  156. return Call(RDSym()->rdma_get_cm_event, channel, event);
  157. }
  158. Y_HIDDEN
  159. int rdma_create_qp(struct rdma_cm_id *id, struct ibv_pd *pd, struct ibv_qp_init_attr *qp_init_attr) {
  160. return Call(RDSym()->rdma_create_qp, id, pd, qp_init_attr);
  161. }
  162. Y_HIDDEN
  163. struct rdma_event_channel *rdma_create_event_channel() {
  164. return Call(RDSym()->rdma_create_event_channel);
  165. }
  166. Y_HIDDEN
  167. int rdma_create_id(struct rdma_event_channel *channel, struct rdma_cm_id **id, void *context, enum rdma_port_space ps) {
  168. return Call(RDSym()->rdma_create_id, channel, id, context, ps);
  169. }
  170. Y_HIDDEN
  171. int rdma_resolve_addr(struct rdma_cm_id *id, struct sockaddr *src_addr, struct sockaddr *dst_addr, int timeout_ms) {
  172. return Call(RDSym()->rdma_resolve_addr, id, src_addr, dst_addr, timeout_ms);
  173. }
  174. Y_HIDDEN
  175. int rdma_resolve_route(struct rdma_cm_id *id, int timeout_ms) {
  176. return Call(RDSym()->rdma_resolve_route, id, timeout_ms);
  177. }
  178. Y_HIDDEN
  179. int rdma_bind_addr(struct rdma_cm_id *id, struct sockaddr *addr) {
  180. return Call(RDSym()->rdma_bind_addr, id, addr);
  181. }
  182. Y_HIDDEN
  183. int rdma_listen(struct rdma_cm_id *id, int backlog) {
  184. return Call(RDSym()->rdma_listen, id, backlog);
  185. }
  186. Y_HIDDEN
  187. int rdma_accept(struct rdma_cm_id *id, struct rdma_conn_param *conn_param) {
  188. return Call(RDSym()->rdma_accept, id, conn_param);
  189. }
  190. Y_HIDDEN
  191. int rdma_connect(struct rdma_cm_id *id, struct rdma_conn_param *conn_param) {
  192. return Call(RDSym()->rdma_connect, id, conn_param);
  193. }
  194. Y_HIDDEN
  195. int rdma_disconnect(struct rdma_cm_id *id) {
  196. return Call(RDSym()->rdma_disconnect, id);
  197. }
  198. Y_HIDDEN
  199. int rdma_set_option(struct rdma_cm_id *id, int level, int optname, void *optval, size_t optlen) {
  200. return Call(RDSym()->rdma_set_option, id, level, optname, optval, optlen);
  201. }
  202. Y_HIDDEN
  203. int rdma_destroy_id(struct rdma_cm_id *id) {
  204. return Call(RDSym()->rdma_destroy_id, id);
  205. }
  206. Y_HIDDEN
  207. void rdma_destroy_qp(struct rdma_cm_id *id) {
  208. return Call(RDSym()->rdma_destroy_qp, id);
  209. }
  210. Y_HIDDEN
  211. struct ibv_context **rdma_get_devices(int *num_devices) {
  212. return Call(RDSym()->rdma_get_devices, num_devices);
  213. }
  214. Y_HIDDEN
  215. void rdma_free_devices(struct ibv_context **list) {
  216. return Call(RDSym()->rdma_free_devices, list);
  217. }
  218. Y_HIDDEN
  219. void rdma_destroy_event_channel(struct rdma_event_channel *channel) {
  220. return Call(RDSym()->rdma_destroy_event_channel, channel);
  221. }
  222. Y_HIDDEN
  223. int rdma_reject(struct rdma_cm_id *id, const void *private_data, uint8_t private_data_len) {
  224. return Call(RDSym()->rdma_reject, id, private_data, private_data_len);
  225. }
  226. Y_HIDDEN
  227. uint16_t rdma_get_dst_port(struct rdma_cm_id *id) {
  228. return Call(RDSym()->rdma_get_dst_port, id);
  229. }
  230. Y_HIDDEN
  231. uint16_t rdma_get_src_port(struct rdma_cm_id *id) {
  232. return Call(RDSym()->rdma_get_src_port, id);
  233. }
  234. Y_HIDDEN
  235. int rdma_getaddrinfo(const char *node, const char *service, const struct rdma_addrinfo *hints, struct rdma_addrinfo **res) {
  236. return Call(RDSym()->rdma_getaddrinfo, node, service, hints, res);
  237. }
  238. Y_HIDDEN
  239. void rdma_freeaddrinfo(struct rdma_addrinfo *res) {
  240. return Call(RDSym()->rdma_freeaddrinfo, res);
  241. }
  242. // mlx5
  243. Y_HIDDEN
  244. struct mlx5dv_var *mlx5dv_alloc_var(struct ibv_context *context, uint32_t flags) {
  245. return Call(M5Sym()->mlx5dv_alloc_var, context, flags);
  246. }
  247. Y_HIDDEN
  248. struct ibv_cq_ex *mlx5dv_create_cq(struct ibv_context *context, struct ibv_cq_init_attr_ex *cq_attr, struct mlx5dv_cq_init_attr *mlx5_cq_attr) {
  249. return Call(M5Sym()->mlx5dv_create_cq, context, cq_attr, mlx5_cq_attr);
  250. }
  251. Y_HIDDEN
  252. struct ibv_flow *mlx5dv_create_flow(struct mlx5dv_flow_matcher *matcher, struct mlx5dv_flow_match_parameters *match_value, size_t num_actions, struct mlx5dv_flow_action_attr actions_attr[]) {
  253. return Call(M5Sym()->mlx5dv_create_flow, matcher, match_value, num_actions, actions_attr);
  254. }
  255. Y_HIDDEN
  256. struct mlx5dv_flow_matcher *mlx5dv_create_flow_matcher(struct ibv_context *context, struct mlx5dv_flow_matcher_attr *matcher_attr) {
  257. return Call(M5Sym()->mlx5dv_create_flow_matcher, context, matcher_attr);
  258. }
  259. Y_HIDDEN
  260. struct ibv_qp *mlx5dv_create_qp(struct ibv_context *context, struct ibv_qp_init_attr_ex *qp_attr, struct mlx5dv_qp_init_attr *mlx5_qp_attr) {
  261. return Call(M5Sym()->mlx5dv_create_qp, context, qp_attr, mlx5_qp_attr);
  262. }
  263. Y_HIDDEN
  264. struct ibv_wq *mlx5dv_create_wq(struct ibv_context *context, struct ibv_wq_init_attr *wq_init_attr, struct mlx5dv_wq_init_attr *mlx5_wq_attr) {
  265. return Call(M5Sym()->mlx5dv_create_wq, context, wq_init_attr, mlx5_wq_attr);
  266. }
  267. Y_HIDDEN
  268. int mlx5dv_destroy_flow_matcher(struct mlx5dv_flow_matcher *matcher) {
  269. return Call(M5Sym()->mlx5dv_destroy_flow_matcher, matcher);
  270. }
  271. Y_HIDDEN
  272. struct mlx5dv_devx_uar *mlx5dv_devx_alloc_uar(struct ibv_context *context, uint32_t flags) {
  273. return Call(M5Sym()->mlx5dv_devx_alloc_uar, context, flags);
  274. }
  275. Y_HIDDEN
  276. struct mlx5dv_devx_cmd_comp *mlx5dv_devx_create_cmd_comp(struct ibv_context *context) {
  277. return Call(M5Sym()->mlx5dv_devx_create_cmd_comp, context);
  278. }
  279. Y_HIDDEN
  280. struct mlx5dv_devx_event_channel *mlx5dv_devx_create_event_channel(struct ibv_context *context, enum mlx5dv_devx_create_event_channel_flags flags) {
  281. return Call(M5Sym()->mlx5dv_devx_create_event_channel, context, flags);
  282. }
  283. Y_HIDDEN
  284. void mlx5dv_devx_destroy_cmd_comp(struct mlx5dv_devx_cmd_comp *cmd_comp) {
  285. return Call(M5Sym()->mlx5dv_devx_destroy_cmd_comp, cmd_comp);
  286. }
  287. Y_HIDDEN
  288. void mlx5dv_devx_destroy_event_channel(struct mlx5dv_devx_event_channel *event_channel) {
  289. return Call(M5Sym()->mlx5dv_devx_destroy_event_channel, event_channel);
  290. }
  291. Y_HIDDEN
  292. void mlx5dv_devx_free_uar(struct mlx5dv_devx_uar *devx_uar) {
  293. return Call(M5Sym()->mlx5dv_devx_free_uar, devx_uar);
  294. }
  295. Y_HIDDEN
  296. int mlx5dv_devx_general_cmd(struct ibv_context *context, const void *in, size_t inlen, void *out, size_t outlen) {
  297. return Call(M5Sym()->mlx5dv_devx_general_cmd, context, in, inlen, out, outlen);
  298. }
  299. Y_HIDDEN
  300. int mlx5dv_devx_get_async_cmd_comp(struct mlx5dv_devx_cmd_comp *cmd_comp, struct mlx5dv_devx_async_cmd_hdr *cmd_resp, size_t cmd_resp_len) {
  301. return Call(M5Sym()->mlx5dv_devx_get_async_cmd_comp, cmd_comp, cmd_resp, cmd_resp_len);
  302. }
  303. Y_HIDDEN
  304. ssize_t mlx5dv_devx_get_event(struct mlx5dv_devx_event_channel *event_channel, struct mlx5dv_devx_async_event_hdr *event_data, size_t event_resp_len) {
  305. return Call(M5Sym()->mlx5dv_devx_get_event, event_channel, event_data, event_resp_len);
  306. }
  307. Y_HIDDEN
  308. struct mlx5dv_devx_obj *mlx5dv_devx_obj_create(struct ibv_context *context, const void *in, size_t inlen, void *out, size_t outlen) {
  309. return Call(M5Sym()->mlx5dv_devx_obj_create, context, in, inlen, out, outlen);
  310. }
  311. Y_HIDDEN
  312. int mlx5dv_devx_obj_destroy(struct mlx5dv_devx_obj *obj) {
  313. return Call(M5Sym()->mlx5dv_devx_obj_destroy, obj);
  314. }
  315. Y_HIDDEN
  316. int mlx5dv_devx_obj_modify(struct mlx5dv_devx_obj *obj, const void *in, size_t inlen, void *out, size_t outlen) {
  317. return Call(M5Sym()->mlx5dv_devx_obj_modify, obj, in, inlen, out, outlen);
  318. }
  319. Y_HIDDEN
  320. int mlx5dv_devx_obj_query(struct mlx5dv_devx_obj *obj, const void *in, size_t inlen, void *out, size_t outlen) {
  321. return Call(M5Sym()->mlx5dv_devx_obj_query, obj, in, inlen, out, outlen);
  322. }
  323. Y_HIDDEN
  324. int mlx5dv_devx_obj_query_async(struct mlx5dv_devx_obj *obj, const void *in, size_t inlen, size_t outlen, uint64_t wr_id, struct mlx5dv_devx_cmd_comp *cmd_comp) {
  325. return Call(M5Sym()->mlx5dv_devx_obj_query_async, obj, in, inlen, outlen, wr_id, cmd_comp);
  326. }
  327. Y_HIDDEN
  328. int mlx5dv_devx_qp_query(struct ibv_qp *qp, const void *in, size_t inlen, void *out, size_t outlen) {
  329. return Call(M5Sym()->mlx5dv_devx_qp_query, qp, in, inlen, out, outlen);
  330. }
  331. Y_HIDDEN
  332. int mlx5dv_devx_query_eqn(struct ibv_context *context, uint32_t vector, uint32_t *eqn) {
  333. return Call(M5Sym()->mlx5dv_devx_query_eqn, context, vector, eqn);
  334. }
  335. Y_HIDDEN
  336. int mlx5dv_devx_subscribe_devx_event(struct mlx5dv_devx_event_channel *event_channel, struct mlx5dv_devx_obj *obj, uint16_t events_sz, uint16_t events_num[], uint64_t cookie) {
  337. return Call(M5Sym()->mlx5dv_devx_subscribe_devx_event, event_channel, obj, events_sz, events_num, cookie);
  338. }
  339. Y_HIDDEN
  340. int mlx5dv_devx_subscribe_devx_event_fd(struct mlx5dv_devx_event_channel *event_channel, int fd, struct mlx5dv_devx_obj *obj, uint16_t event_num) {
  341. return Call(M5Sym()->mlx5dv_devx_subscribe_devx_event_fd, event_channel, fd, obj, event_num);
  342. }
  343. Y_HIDDEN
  344. int mlx5dv_devx_umem_dereg(struct mlx5dv_devx_umem *umem) {
  345. return Call(M5Sym()->mlx5dv_devx_umem_dereg, umem);
  346. }
  347. Y_HIDDEN
  348. struct mlx5dv_devx_umem *mlx5dv_devx_umem_reg(struct ibv_context *ctx, void *addr, size_t size, uint32_t access) {
  349. return Call(M5Sym()->mlx5dv_devx_umem_reg, ctx, addr, size, access);
  350. }
  351. Y_HIDDEN
  352. struct mlx5dv_dr_action *mlx5dv_dr_action_create_aso(struct mlx5dv_dr_domain *domain, struct mlx5dv_devx_obj *devx_obj, uint32_t offset, uint32_t flags, uint8_t return_reg_c) {
  353. return Call(M5Sym()->mlx5dv_dr_action_create_aso, domain, devx_obj, offset, flags, return_reg_c);
  354. }
  355. Y_HIDDEN
  356. struct mlx5dv_dr_action *mlx5dv_dr_action_create_default_miss(void) {
  357. return Call(M5Sym()->mlx5dv_dr_action_create_default_miss);
  358. }
  359. Y_HIDDEN
  360. struct mlx5dv_dr_action *mlx5dv_dr_action_create_dest_array(struct mlx5dv_dr_domain *domain, size_t num_dest, struct mlx5dv_dr_action_dest_attr *dests[]) {
  361. return Call(M5Sym()->mlx5dv_dr_action_create_dest_array, domain, num_dest, dests);
  362. }
  363. Y_HIDDEN
  364. struct mlx5dv_dr_action *mlx5dv_dr_action_create_dest_devx_tir(struct mlx5dv_devx_obj *devx_obj) {
  365. return Call(M5Sym()->mlx5dv_dr_action_create_dest_devx_tir, devx_obj);
  366. }
  367. Y_HIDDEN
  368. struct mlx5dv_dr_action *mlx5dv_dr_action_create_dest_ib_port(struct mlx5dv_dr_domain *domain, uint32_t ib_port) {
  369. return Call(M5Sym()->mlx5dv_dr_action_create_dest_ib_port, domain, ib_port);
  370. }
  371. Y_HIDDEN
  372. struct mlx5dv_dr_action *mlx5dv_dr_action_create_dest_ibv_qp(struct ibv_qp *ibqp) {
  373. return Call(M5Sym()->mlx5dv_dr_action_create_dest_ibv_qp, ibqp);
  374. }
  375. Y_HIDDEN
  376. struct mlx5dv_dr_action *mlx5dv_dr_action_create_dest_table(struct mlx5dv_dr_table *table) {
  377. return Call(M5Sym()->mlx5dv_dr_action_create_dest_table, table);
  378. }
  379. Y_HIDDEN
  380. struct mlx5dv_dr_action *mlx5dv_dr_action_create_dest_vport(struct mlx5dv_dr_domain *domain, uint32_t vport) {
  381. return Call(M5Sym()->mlx5dv_dr_action_create_dest_vport, domain, vport);
  382. }
  383. Y_HIDDEN
  384. struct mlx5dv_dr_action *mlx5dv_dr_action_create_drop(void) {
  385. return Call(M5Sym()->mlx5dv_dr_action_create_drop);
  386. }
  387. Y_HIDDEN
  388. struct mlx5dv_dr_action *mlx5dv_dr_action_create_flow_counter(struct mlx5dv_devx_obj *devx_obj, uint32_t offset) {
  389. return Call(M5Sym()->mlx5dv_dr_action_create_flow_counter, devx_obj, offset);
  390. }
  391. Y_HIDDEN
  392. struct mlx5dv_dr_action *mlx5dv_dr_action_create_flow_meter(struct mlx5dv_dr_flow_meter_attr *attr) {
  393. return Call(M5Sym()->mlx5dv_dr_action_create_flow_meter, attr);
  394. }
  395. Y_HIDDEN
  396. struct mlx5dv_dr_action *mlx5dv_dr_action_create_flow_sampler(struct mlx5dv_dr_flow_sampler_attr *attr) {
  397. return Call(M5Sym()->mlx5dv_dr_action_create_flow_sampler, attr);
  398. }
  399. Y_HIDDEN
  400. struct mlx5dv_dr_action *mlx5dv_dr_action_create_modify_header(struct mlx5dv_dr_domain *domain, uint32_t flags, size_t actions_sz, __be64 actions[]) {
  401. return Call(M5Sym()->mlx5dv_dr_action_create_modify_header, domain, flags, actions_sz, actions);
  402. }
  403. Y_HIDDEN
  404. struct mlx5dv_dr_action *mlx5dv_dr_action_create_packet_reformat(struct mlx5dv_dr_domain *domain, uint32_t flags, enum mlx5dv_flow_action_packet_reformat_type reformat_type, size_t data_sz, void *data) {
  405. return Call(M5Sym()->mlx5dv_dr_action_create_packet_reformat, domain, flags, reformat_type, data_sz, data);
  406. }
  407. Y_HIDDEN
  408. struct mlx5dv_dr_action *mlx5dv_dr_action_create_pop_vlan(void) {
  409. return Call(M5Sym()->mlx5dv_dr_action_create_pop_vlan);
  410. }
  411. Y_HIDDEN
  412. struct mlx5dv_dr_action *mlx5dv_dr_action_create_push_vlan(struct mlx5dv_dr_domain *domain, __be32 vlan_hdr) {
  413. return Call(M5Sym()->mlx5dv_dr_action_create_push_vlan, domain, vlan_hdr);
  414. }
  415. Y_HIDDEN
  416. struct mlx5dv_dr_action *mlx5dv_dr_action_create_tag(uint32_t tag_value) {
  417. return Call(M5Sym()->mlx5dv_dr_action_create_tag, tag_value);
  418. }
  419. Y_HIDDEN
  420. int mlx5dv_dr_action_destroy(struct mlx5dv_dr_action *action) {
  421. return Call(M5Sym()->mlx5dv_dr_action_destroy, action);
  422. }
  423. Y_HIDDEN
  424. int mlx5dv_dr_action_modify_flow_meter(struct mlx5dv_dr_action *action, struct mlx5dv_dr_flow_meter_attr *attr, __be64 modify_field_select) {
  425. return Call(M5Sym()->mlx5dv_dr_action_modify_flow_meter, action, attr, modify_field_select);
  426. }
  427. Y_HIDDEN
  428. struct mlx5dv_dr_domain *mlx5dv_dr_domain_create(struct ibv_context *ctx, enum mlx5dv_dr_domain_type type) {
  429. return Call(M5Sym()->mlx5dv_dr_domain_create, ctx, type);
  430. }
  431. Y_HIDDEN
  432. int mlx5dv_dr_domain_destroy(struct mlx5dv_dr_domain *domain) {
  433. return Call(M5Sym()->mlx5dv_dr_domain_destroy, domain);
  434. }
  435. Y_HIDDEN
  436. void mlx5dv_dr_domain_set_reclaim_device_memory(struct mlx5dv_dr_domain *dmn, bool enable) {
  437. return Call(M5Sym()->mlx5dv_dr_domain_set_reclaim_device_memory, dmn, enable);
  438. }
  439. Y_HIDDEN
  440. int mlx5dv_dr_domain_sync(struct mlx5dv_dr_domain *domain, uint32_t flags) {
  441. return Call(M5Sym()->mlx5dv_dr_domain_sync, domain, flags);
  442. }
  443. Y_HIDDEN
  444. struct mlx5dv_dr_matcher *mlx5dv_dr_matcher_create(struct mlx5dv_dr_table *table, uint16_t priority, uint8_t match_criteria_enable, struct mlx5dv_flow_match_parameters *mask) {
  445. return Call(M5Sym()->mlx5dv_dr_matcher_create, table, priority, match_criteria_enable, mask);
  446. }
  447. Y_HIDDEN
  448. int mlx5dv_dr_matcher_destroy(struct mlx5dv_dr_matcher *matcher) {
  449. return Call(M5Sym()->mlx5dv_dr_matcher_destroy, matcher);
  450. }
  451. Y_HIDDEN
  452. struct mlx5dv_dr_rule *mlx5dv_dr_rule_create(struct mlx5dv_dr_matcher *matcher, struct mlx5dv_flow_match_parameters *value, size_t num_actions, struct mlx5dv_dr_action *actions[]) {
  453. return Call(M5Sym()->mlx5dv_dr_rule_create, matcher, value, num_actions, actions);
  454. }
  455. Y_HIDDEN
  456. int mlx5dv_dr_rule_destroy(struct mlx5dv_dr_rule *rule) {
  457. return Call(M5Sym()->mlx5dv_dr_rule_destroy, rule);
  458. }
  459. Y_HIDDEN
  460. struct mlx5dv_dr_table *mlx5dv_dr_table_create(struct mlx5dv_dr_domain *domain, uint32_t level) {
  461. return Call(M5Sym()->mlx5dv_dr_table_create, domain, level);
  462. }
  463. Y_HIDDEN
  464. int mlx5dv_dr_table_destroy(struct mlx5dv_dr_table *table) {
  465. return Call(M5Sym()->mlx5dv_dr_table_destroy, table);
  466. }
  467. Y_HIDDEN
  468. int mlx5dv_dump_dr_domain(FILE *fout, struct mlx5dv_dr_domain *domain) {
  469. return Call(M5Sym()->mlx5dv_dump_dr_domain, fout, domain);
  470. }
  471. Y_HIDDEN
  472. void mlx5dv_free_var(struct mlx5dv_var *dv_var) {
  473. return Call(M5Sym()->mlx5dv_free_var, dv_var);
  474. }
  475. Y_HIDDEN
  476. int mlx5dv_init_obj(struct mlx5dv_obj *obj, uint64_t obj_type) {
  477. return Call(M5Sym()->mlx5dv_init_obj, obj, obj_type);
  478. }
  479. Y_HIDDEN
  480. struct ibv_context *mlx5dv_open_device(struct ibv_device *device, struct mlx5dv_context_attr *attr) {
  481. return Call(M5Sym()->mlx5dv_open_device, device, attr);
  482. }
  483. Y_HIDDEN
  484. struct mlx5dv_pp *mlx5dv_pp_alloc(struct ibv_context *context, size_t pp_context_sz, const void *pp_context, uint32_t flags) {
  485. return Call(M5Sym()->mlx5dv_pp_alloc, context, pp_context_sz, pp_context, flags);
  486. }
  487. Y_HIDDEN
  488. void mlx5dv_pp_free(struct mlx5dv_pp *pp) {
  489. return Call(M5Sym()->mlx5dv_pp_free, pp);
  490. }
  491. Y_HIDDEN
  492. int mlx5dv_query_device(struct ibv_context *ctx_in, struct mlx5dv_context *attrs_out) {
  493. return Call(M5Sym()->mlx5dv_query_device, ctx_in, attrs_out);
  494. }
  495. Y_HIDDEN
  496. int mlx5dv_query_devx_port(struct ibv_context *ctx, uint32_t port_num, struct mlx5dv_devx_port *mlx5_devx_port) {
  497. return Call(M5Sym()->mlx5dv_query_devx_port, ctx, port_num, mlx5_devx_port);
  498. }
  499. Y_HIDDEN
  500. int mlx5dv_set_context_attr(struct ibv_context *context, enum mlx5dv_set_ctx_attr_type type, void *attr) {
  501. return Call(M5Sym()->mlx5dv_set_context_attr, context, type, attr);
  502. }