mlx5_user_ioctl_cmds.h 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170
  1. /*
  2. * Copyright (c) 2018, Mellanox Technologies inc. All rights reserved.
  3. *
  4. * This software is available to you under a choice of one of two
  5. * licenses. You may choose to be licensed under the terms of the GNU
  6. * General Public License (GPL) Version 2, available from the file
  7. * COPYING in the main directory of this source tree, or the
  8. * OpenIB.org BSD license below:
  9. *
  10. * Redistribution and use in source and binary forms, with or
  11. * without modification, are permitted provided that the following
  12. * conditions are met:
  13. *
  14. * - Redistributions of source code must retain the above
  15. * copyright notice, this list of conditions and the following
  16. * disclaimer.
  17. *
  18. * - Redistributions in binary form must reproduce the above
  19. * copyright notice, this list of conditions and the following
  20. * disclaimer in the documentation and/or other materials
  21. * provided with the distribution.
  22. *
  23. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
  24. * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  25. * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
  26. * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
  27. * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
  28. * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
  29. * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
  30. * SOFTWARE.
  31. */
  32. #ifndef MLX5_USER_IOCTL_CMDS_H
  33. #define MLX5_USER_IOCTL_CMDS_H
  34. #include <linux/types.h>
  35. #include <rdma/ib_user_ioctl_cmds.h>
  36. enum mlx5_ib_create_flow_action_attrs {
  37. /* This attribute belong to the driver namespace */
  38. MLX5_IB_ATTR_CREATE_FLOW_ACTION_FLAGS = (1U << UVERBS_ID_NS_SHIFT),
  39. };
  40. enum mlx5_ib_alloc_dm_attrs {
  41. MLX5_IB_ATTR_ALLOC_DM_RESP_START_OFFSET = (1U << UVERBS_ID_NS_SHIFT),
  42. MLX5_IB_ATTR_ALLOC_DM_RESP_PAGE_INDEX,
  43. };
  44. enum mlx5_ib_devx_methods {
  45. MLX5_IB_METHOD_DEVX_OTHER = (1U << UVERBS_ID_NS_SHIFT),
  46. MLX5_IB_METHOD_DEVX_QUERY_UAR,
  47. MLX5_IB_METHOD_DEVX_QUERY_EQN,
  48. };
  49. enum mlx5_ib_devx_other_attrs {
  50. MLX5_IB_ATTR_DEVX_OTHER_CMD_IN = (1U << UVERBS_ID_NS_SHIFT),
  51. MLX5_IB_ATTR_DEVX_OTHER_CMD_OUT,
  52. };
  53. enum mlx5_ib_devx_obj_create_attrs {
  54. MLX5_IB_ATTR_DEVX_OBJ_CREATE_HANDLE = (1U << UVERBS_ID_NS_SHIFT),
  55. MLX5_IB_ATTR_DEVX_OBJ_CREATE_CMD_IN,
  56. MLX5_IB_ATTR_DEVX_OBJ_CREATE_CMD_OUT,
  57. };
  58. enum mlx5_ib_devx_query_uar_attrs {
  59. MLX5_IB_ATTR_DEVX_QUERY_UAR_USER_IDX = (1U << UVERBS_ID_NS_SHIFT),
  60. MLX5_IB_ATTR_DEVX_QUERY_UAR_DEV_IDX,
  61. };
  62. enum mlx5_ib_devx_obj_destroy_attrs {
  63. MLX5_IB_ATTR_DEVX_OBJ_DESTROY_HANDLE = (1U << UVERBS_ID_NS_SHIFT),
  64. };
  65. enum mlx5_ib_devx_obj_modify_attrs {
  66. MLX5_IB_ATTR_DEVX_OBJ_MODIFY_HANDLE = (1U << UVERBS_ID_NS_SHIFT),
  67. MLX5_IB_ATTR_DEVX_OBJ_MODIFY_CMD_IN,
  68. MLX5_IB_ATTR_DEVX_OBJ_MODIFY_CMD_OUT,
  69. };
  70. enum mlx5_ib_devx_obj_query_attrs {
  71. MLX5_IB_ATTR_DEVX_OBJ_QUERY_HANDLE = (1U << UVERBS_ID_NS_SHIFT),
  72. MLX5_IB_ATTR_DEVX_OBJ_QUERY_CMD_IN,
  73. MLX5_IB_ATTR_DEVX_OBJ_QUERY_CMD_OUT,
  74. };
  75. enum mlx5_ib_devx_query_eqn_attrs {
  76. MLX5_IB_ATTR_DEVX_QUERY_EQN_USER_VEC = (1U << UVERBS_ID_NS_SHIFT),
  77. MLX5_IB_ATTR_DEVX_QUERY_EQN_DEV_EQN,
  78. };
  79. enum mlx5_ib_devx_obj_methods {
  80. MLX5_IB_METHOD_DEVX_OBJ_CREATE = (1U << UVERBS_ID_NS_SHIFT),
  81. MLX5_IB_METHOD_DEVX_OBJ_DESTROY,
  82. MLX5_IB_METHOD_DEVX_OBJ_MODIFY,
  83. MLX5_IB_METHOD_DEVX_OBJ_QUERY,
  84. };
  85. enum mlx5_ib_devx_umem_reg_attrs {
  86. MLX5_IB_ATTR_DEVX_UMEM_REG_HANDLE = (1U << UVERBS_ID_NS_SHIFT),
  87. MLX5_IB_ATTR_DEVX_UMEM_REG_ADDR,
  88. MLX5_IB_ATTR_DEVX_UMEM_REG_LEN,
  89. MLX5_IB_ATTR_DEVX_UMEM_REG_ACCESS,
  90. MLX5_IB_ATTR_DEVX_UMEM_REG_OUT_ID,
  91. };
  92. enum mlx5_ib_devx_umem_dereg_attrs {
  93. MLX5_IB_ATTR_DEVX_UMEM_DEREG_HANDLE = (1U << UVERBS_ID_NS_SHIFT),
  94. };
  95. enum mlx5_ib_devx_umem_methods {
  96. MLX5_IB_METHOD_DEVX_UMEM_REG = (1U << UVERBS_ID_NS_SHIFT),
  97. MLX5_IB_METHOD_DEVX_UMEM_DEREG,
  98. };
  99. enum mlx5_ib_objects {
  100. MLX5_IB_OBJECT_DEVX = (1U << UVERBS_ID_NS_SHIFT),
  101. MLX5_IB_OBJECT_DEVX_OBJ,
  102. MLX5_IB_OBJECT_DEVX_UMEM,
  103. MLX5_IB_OBJECT_FLOW_MATCHER,
  104. };
  105. enum mlx5_ib_flow_matcher_create_attrs {
  106. MLX5_IB_ATTR_FLOW_MATCHER_CREATE_HANDLE = (1U << UVERBS_ID_NS_SHIFT),
  107. MLX5_IB_ATTR_FLOW_MATCHER_MATCH_MASK,
  108. MLX5_IB_ATTR_FLOW_MATCHER_FLOW_TYPE,
  109. MLX5_IB_ATTR_FLOW_MATCHER_MATCH_CRITERIA,
  110. };
  111. enum mlx5_ib_flow_matcher_destroy_attrs {
  112. MLX5_IB_ATTR_FLOW_MATCHER_DESTROY_HANDLE = (1U << UVERBS_ID_NS_SHIFT),
  113. };
  114. enum mlx5_ib_flow_matcher_methods {
  115. MLX5_IB_METHOD_FLOW_MATCHER_CREATE = (1U << UVERBS_ID_NS_SHIFT),
  116. MLX5_IB_METHOD_FLOW_MATCHER_DESTROY,
  117. };
  118. #define MLX5_IB_DW_MATCH_PARAM 0x80
  119. struct mlx5_ib_match_params {
  120. __u32 match_params[MLX5_IB_DW_MATCH_PARAM];
  121. };
  122. enum mlx5_ib_flow_type {
  123. MLX5_IB_FLOW_TYPE_NORMAL,
  124. MLX5_IB_FLOW_TYPE_SNIFFER,
  125. MLX5_IB_FLOW_TYPE_ALL_DEFAULT,
  126. MLX5_IB_FLOW_TYPE_MC_DEFAULT,
  127. };
  128. enum mlx5_ib_create_flow_attrs {
  129. MLX5_IB_ATTR_CREATE_FLOW_HANDLE = (1U << UVERBS_ID_NS_SHIFT),
  130. MLX5_IB_ATTR_CREATE_FLOW_MATCH_VALUE,
  131. MLX5_IB_ATTR_CREATE_FLOW_DEST_QP,
  132. MLX5_IB_ATTR_CREATE_FLOW_DEST_DEVX,
  133. MLX5_IB_ATTR_CREATE_FLOW_MATCHER,
  134. };
  135. enum mlx5_ib_destoy_flow_attrs {
  136. MLX5_IB_ATTR_DESTROY_FLOW_HANDLE = (1U << UVERBS_ID_NS_SHIFT),
  137. };
  138. enum mlx5_ib_flow_methods {
  139. MLX5_IB_METHOD_CREATE_FLOW = (1U << UVERBS_ID_NS_SHIFT),
  140. MLX5_IB_METHOD_DESTROY_FLOW,
  141. };
  142. #endif