ib_user_ioctl_verbs.h 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161
  1. /* SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR Linux-OpenIB) */
  2. /*
  3. * Copyright (c) 2017-2018, Mellanox Technologies inc. All rights reserved.
  4. *
  5. * This software is available to you under a choice of one of two
  6. * licenses. You may choose to be licensed under the terms of the GNU
  7. * General Public License (GPL) Version 2, available from the file
  8. * COPYING in the main directory of this source tree, or the
  9. * OpenIB.org BSD license below:
  10. *
  11. * Redistribution and use in source and binary forms, with or
  12. * without modification, are permitted provided that the following
  13. * conditions are met:
  14. *
  15. * - Redistributions of source code must retain the above
  16. * copyright notice, this list of conditions and the following
  17. * disclaimer.
  18. *
  19. * - Redistributions in binary form must reproduce the above
  20. * copyright notice, this list of conditions and the following
  21. * disclaimer in the documentation and/or other materials
  22. * provided with the distribution.
  23. *
  24. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
  25. * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  26. * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
  27. * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
  28. * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
  29. * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
  30. * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
  31. * SOFTWARE.
  32. */
  33. #ifndef IB_USER_IOCTL_VERBS_H
  34. #define IB_USER_IOCTL_VERBS_H
  35. #include <linux/types.h>
  36. #ifndef RDMA_UAPI_PTR
  37. #define RDMA_UAPI_PTR(_type, _name) __aligned_u64 _name
  38. #endif
  39. enum ib_uverbs_access_flags {
  40. IB_UVERBS_ACCESS_LOCAL_WRITE = 1 << 0,
  41. IB_UVERBS_ACCESS_REMOTE_WRITE = 1 << 1,
  42. IB_UVERBS_ACCESS_REMOTE_READ = 1 << 2,
  43. IB_UVERBS_ACCESS_REMOTE_ATOMIC = 1 << 3,
  44. IB_UVERBS_ACCESS_MW_BIND = 1 << 4,
  45. IB_UVERBS_ACCESS_ZERO_BASED = 1 << 5,
  46. IB_UVERBS_ACCESS_ON_DEMAND = 1 << 6,
  47. IB_UVERBS_ACCESS_HUGETLB = 1 << 7,
  48. };
  49. enum ib_uverbs_query_port_cap_flags {
  50. IB_UVERBS_PCF_SM = 1 << 1,
  51. IB_UVERBS_PCF_NOTICE_SUP = 1 << 2,
  52. IB_UVERBS_PCF_TRAP_SUP = 1 << 3,
  53. IB_UVERBS_PCF_OPT_IPD_SUP = 1 << 4,
  54. IB_UVERBS_PCF_AUTO_MIGR_SUP = 1 << 5,
  55. IB_UVERBS_PCF_SL_MAP_SUP = 1 << 6,
  56. IB_UVERBS_PCF_MKEY_NVRAM = 1 << 7,
  57. IB_UVERBS_PCF_PKEY_NVRAM = 1 << 8,
  58. IB_UVERBS_PCF_LED_INFO_SUP = 1 << 9,
  59. IB_UVERBS_PCF_SM_DISABLED = 1 << 10,
  60. IB_UVERBS_PCF_SYS_IMAGE_GUID_SUP = 1 << 11,
  61. IB_UVERBS_PCF_PKEY_SW_EXT_PORT_TRAP_SUP = 1 << 12,
  62. IB_UVERBS_PCF_EXTENDED_SPEEDS_SUP = 1 << 14,
  63. IB_UVERBS_PCF_CM_SUP = 1 << 16,
  64. IB_UVERBS_PCF_SNMP_TUNNEL_SUP = 1 << 17,
  65. IB_UVERBS_PCF_REINIT_SUP = 1 << 18,
  66. IB_UVERBS_PCF_DEVICE_MGMT_SUP = 1 << 19,
  67. IB_UVERBS_PCF_VENDOR_CLASS_SUP = 1 << 20,
  68. IB_UVERBS_PCF_DR_NOTICE_SUP = 1 << 21,
  69. IB_UVERBS_PCF_CAP_MASK_NOTICE_SUP = 1 << 22,
  70. IB_UVERBS_PCF_BOOT_MGMT_SUP = 1 << 23,
  71. IB_UVERBS_PCF_LINK_LATENCY_SUP = 1 << 24,
  72. IB_UVERBS_PCF_CLIENT_REG_SUP = 1 << 25,
  73. /*
  74. * IsOtherLocalChangesNoticeSupported is aliased by IP_BASED_GIDS and
  75. * is inaccessible
  76. */
  77. IB_UVERBS_PCF_LINK_SPEED_WIDTH_TABLE_SUP = 1 << 27,
  78. IB_UVERBS_PCF_VENDOR_SPECIFIC_MADS_TABLE_SUP = 1 << 28,
  79. IB_UVERBS_PCF_MCAST_PKEY_TRAP_SUPPRESSION_SUP = 1 << 29,
  80. IB_UVERBS_PCF_MCAST_FDB_TOP_SUP = 1 << 30,
  81. IB_UVERBS_PCF_HIERARCHY_INFO_SUP = 1ULL << 31,
  82. /* NOTE this is an internal flag, not an IBA flag */
  83. IB_UVERBS_PCF_IP_BASED_GIDS = 1 << 26,
  84. };
  85. enum ib_uverbs_query_port_flags {
  86. IB_UVERBS_QPF_GRH_REQUIRED = 1 << 0,
  87. };
  88. enum ib_uverbs_flow_action_esp_keymat {
  89. IB_UVERBS_FLOW_ACTION_ESP_KEYMAT_AES_GCM,
  90. };
  91. enum ib_uverbs_flow_action_esp_keymat_aes_gcm_iv_algo {
  92. IB_UVERBS_FLOW_ACTION_IV_ALGO_SEQ,
  93. };
  94. struct ib_uverbs_flow_action_esp_keymat_aes_gcm {
  95. __aligned_u64 iv;
  96. __u32 iv_algo; /* Use enum ib_uverbs_flow_action_esp_keymat_aes_gcm_iv_algo */
  97. __u32 salt;
  98. __u32 icv_len;
  99. __u32 key_len;
  100. __u32 aes_key[256 / 32];
  101. };
  102. enum ib_uverbs_flow_action_esp_replay {
  103. IB_UVERBS_FLOW_ACTION_ESP_REPLAY_NONE,
  104. IB_UVERBS_FLOW_ACTION_ESP_REPLAY_BMP,
  105. };
  106. struct ib_uverbs_flow_action_esp_replay_bmp {
  107. __u32 size;
  108. };
  109. enum ib_uverbs_flow_action_esp_flags {
  110. IB_UVERBS_FLOW_ACTION_ESP_FLAGS_INLINE_CRYPTO = 0UL << 0, /* Default */
  111. IB_UVERBS_FLOW_ACTION_ESP_FLAGS_FULL_OFFLOAD = 1UL << 0,
  112. IB_UVERBS_FLOW_ACTION_ESP_FLAGS_TUNNEL = 0UL << 1, /* Default */
  113. IB_UVERBS_FLOW_ACTION_ESP_FLAGS_TRANSPORT = 1UL << 1,
  114. IB_UVERBS_FLOW_ACTION_ESP_FLAGS_DECRYPT = 0UL << 2, /* Default */
  115. IB_UVERBS_FLOW_ACTION_ESP_FLAGS_ENCRYPT = 1UL << 2,
  116. IB_UVERBS_FLOW_ACTION_ESP_FLAGS_ESN_NEW_WINDOW = 1UL << 3,
  117. };
  118. struct ib_uverbs_flow_action_esp_encap {
  119. /* This struct represents a list of pointers to flow_xxxx_filter that
  120. * encapsulates the payload in ESP tunnel mode.
  121. */
  122. RDMA_UAPI_PTR(void *, val_ptr); /* pointer to a flow_xxxx_filter */
  123. RDMA_UAPI_PTR(struct ib_uverbs_flow_action_esp_encap *, next_ptr);
  124. __u16 len; /* Len of the filter struct val_ptr points to */
  125. __u16 type; /* Use flow_spec_type enum */
  126. };
  127. struct ib_uverbs_flow_action_esp {
  128. __u32 spi;
  129. __u32 seq;
  130. __u32 tfc_pad;
  131. __u32 flags;
  132. __aligned_u64 hard_limit_pkts;
  133. };
  134. enum ib_uverbs_read_counters_flags {
  135. /* prefer read values from driver cache */
  136. IB_UVERBS_READ_COUNTERS_PREFER_CACHED = 1 << 0,
  137. };
  138. #endif