sa.h 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136
  1. /*
  2. * Copyright (c) 2004 Topspin Communications. All rights reserved.
  3. * Copyright (c) 2005 Voltaire, 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 INFINIBAND_SA_H
  34. #define INFINIBAND_SA_H
  35. #include <infiniband/verbs.h>
  36. #include <linux/types.h>
  37. struct ibv_sa_path_rec {
  38. /* reserved */
  39. /* reserved */
  40. union ibv_gid dgid;
  41. union ibv_gid sgid;
  42. __be16 dlid;
  43. __be16 slid;
  44. int raw_traffic;
  45. /* reserved */
  46. __be32 flow_label;
  47. uint8_t hop_limit;
  48. uint8_t traffic_class;
  49. int reversible;
  50. uint8_t numb_path;
  51. __be16 pkey;
  52. /* reserved */
  53. uint8_t sl;
  54. uint8_t mtu_selector;
  55. uint8_t mtu;
  56. uint8_t rate_selector;
  57. uint8_t rate;
  58. uint8_t packet_life_time_selector;
  59. uint8_t packet_life_time;
  60. uint8_t preference;
  61. };
  62. struct ibv_sa_mcmember_rec {
  63. union ibv_gid mgid;
  64. union ibv_gid port_gid;
  65. uint32_t qkey;
  66. uint16_t mlid;
  67. uint8_t mtu_selector;
  68. uint8_t mtu;
  69. uint8_t traffic_class;
  70. uint16_t pkey;
  71. uint8_t rate_selector;
  72. uint8_t rate;
  73. uint8_t packet_life_time_selector;
  74. uint8_t packet_life_time;
  75. uint8_t sl;
  76. uint32_t flow_label;
  77. uint8_t hop_limit;
  78. uint8_t scope;
  79. uint8_t join_state;
  80. int proxy_join;
  81. };
  82. struct ibv_sa_service_rec {
  83. uint64_t id;
  84. union ibv_gid gid;
  85. uint16_t pkey;
  86. /* uint16_t resv; */
  87. uint32_t lease;
  88. uint8_t key[16];
  89. uint8_t name[64];
  90. uint8_t data8[16];
  91. uint16_t data16[8];
  92. uint32_t data32[4];
  93. uint64_t data64[2];
  94. };
  95. #define IBV_PATH_RECORD_REVERSIBLE 0x80
  96. struct ibv_path_record {
  97. __be64 service_id;
  98. union ibv_gid dgid;
  99. union ibv_gid sgid;
  100. __be16 dlid;
  101. __be16 slid;
  102. __be32 flowlabel_hoplimit; /* resv-31:28 flow label-27:8 hop limit-7:0*/
  103. uint8_t tclass;
  104. uint8_t reversible_numpath; /* reversible-7:7 num path-6:0 */
  105. __be16 pkey;
  106. __be16 qosclass_sl; /* qos class-15:4 sl-3:0 */
  107. uint8_t mtu; /* mtu selector-7:6 mtu-5:0 */
  108. uint8_t rate; /* rate selector-7:6 rate-5:0 */
  109. uint8_t packetlifetime; /* lifetime selector-7:6 lifetime-5:0 */
  110. uint8_t preference;
  111. uint8_t reserved[6];
  112. };
  113. #define IBV_PATH_FLAG_GMP (1<<0)
  114. #define IBV_PATH_FLAG_PRIMARY (1<<1)
  115. #define IBV_PATH_FLAG_ALTERNATE (1<<2)
  116. #define IBV_PATH_FLAG_OUTBOUND (1<<3)
  117. #define IBV_PATH_FLAG_INBOUND (1<<4)
  118. #define IBV_PATH_FLAG_INBOUND_REVERSE (1<<5)
  119. #define IBV_PATH_FLAG_BIDIRECTIONAL (IBV_PATH_FLAG_OUTBOUND | \
  120. IBV_PATH_FLAG_INBOUND_REVERSE)
  121. struct ibv_path_data {
  122. uint32_t flags;
  123. uint32_t reserved;
  124. struct ibv_path_record path;
  125. };
  126. #endif /* INFINIBAND_SA_H */