Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.

mlx_port.h 5.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229
  1. #ifndef NODNIC_PORT_H_
  2. #define NODNIC_PORT_H_
  3. /*
  4. * Copyright (C) 2015 Mellanox Technologies Ltd.
  5. *
  6. * This program is free software; you can redistribute it and/or
  7. * modify it under the terms of the GNU General Public License as
  8. * published by the Free Software Foundation; either version 2 of the
  9. * License, or any later version.
  10. *
  11. * This program is distributed in the hope that it will be useful, but
  12. * WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  14. * General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU General Public License
  17. * along with this program; if not, write to the Free Software
  18. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
  19. * 02110-1301, USA.
  20. */
  21. FILE_LICENCE ( GPL2_OR_LATER );
  22. #include "mlx_nodnic_data_structures.h"
  23. #define NODNIC_PORT_MAC_FILTERS_OFFSET 0x10
  24. typedef enum {
  25. nodnic_port_option_link_type = 0,
  26. nodnic_port_option_mac_low,
  27. nodnic_port_option_mac_high,
  28. nodnic_port_option_log_cq_size,
  29. nodnic_port_option_reset_needed,
  30. nodnic_port_option_mac_filters_en,
  31. nodnic_port_option_port_state,
  32. nodnic_port_option_network_en,
  33. nodnic_port_option_dma_en,
  34. nodnic_port_option_eq_addr_low,
  35. nodnic_port_option_eq_addr_high,
  36. nodnic_port_option_cq_addr_low,
  37. nodnic_port_option_cq_addr_high,
  38. nodnic_port_option_port_management_change_event,
  39. nodnic_port_option_port_promisc_en,
  40. nodnic_port_option_arm_cq,
  41. nodnic_port_option_port_promisc_multicast_en,
  42. #ifdef DEVICE_CX3
  43. nodnic_port_option_crspace_en,
  44. #endif
  45. }nodnic_port_option;
  46. struct nodnic_port_data_entry{
  47. nodnic_port_option option;
  48. mlx_uint32 offset;
  49. mlx_uint8 align;
  50. mlx_uint32 mask;
  51. };
  52. struct nodnic_qp_data_entry{
  53. nodnic_queue_pair_type type;
  54. mlx_uint32 send_offset;
  55. mlx_uint32 recv_offset;
  56. };
  57. typedef enum {
  58. nodnic_port_state_down = 0,
  59. nodnic_port_state_initialize,
  60. nodnic_port_state_armed,
  61. nodnic_port_state_active,
  62. }nodnic_port_state;
  63. mlx_status
  64. nodnic_port_get_state(
  65. IN nodnic_port_priv *port_priv,
  66. OUT nodnic_port_state *state
  67. );
  68. mlx_status
  69. nodnic_port_get_type(
  70. IN nodnic_port_priv *port_priv,
  71. OUT nodnic_port_type *type
  72. );
  73. mlx_status
  74. nodnic_port_query(
  75. IN nodnic_port_priv *port_priv,
  76. IN nodnic_port_option option,
  77. OUT mlx_uint32 *out
  78. );
  79. mlx_status
  80. nodnic_port_set(
  81. IN nodnic_port_priv *port_priv,
  82. IN nodnic_port_option option,
  83. IN mlx_uint32 in
  84. );
  85. mlx_status
  86. nodnic_port_create_cq(
  87. IN nodnic_port_priv *port_priv,
  88. IN mlx_size cq_size,
  89. OUT nodnic_cq **cq
  90. );
  91. mlx_status
  92. nodnic_port_destroy_cq(
  93. IN nodnic_port_priv *port_priv,
  94. IN nodnic_cq *cq
  95. );
  96. mlx_status
  97. nodnic_port_create_qp(
  98. IN nodnic_port_priv *port_priv,
  99. IN nodnic_queue_pair_type type,
  100. IN mlx_size send_wq_size,
  101. IN mlx_uint32 send_wqe_num,
  102. IN mlx_size receive_wq_size,
  103. IN mlx_uint32 recv_wqe_num,
  104. OUT nodnic_qp **qp
  105. );
  106. mlx_status
  107. nodnic_port_destroy_qp(
  108. IN nodnic_port_priv *port_priv,
  109. IN nodnic_queue_pair_type type,
  110. IN nodnic_qp *qp
  111. );
  112. mlx_status
  113. nodnic_port_get_qpn(
  114. IN nodnic_port_priv *port_priv,
  115. IN struct nodnic_ring *ring,
  116. OUT mlx_uint32 *qpn
  117. );
  118. mlx_status
  119. nodnic_port_update_ring_doorbell(
  120. IN nodnic_port_priv *port_priv,
  121. IN struct nodnic_ring *ring,
  122. IN mlx_uint16 index
  123. );
  124. mlx_status
  125. nodnic_port_get_cq_size(
  126. IN nodnic_port_priv *port_priv,
  127. OUT mlx_uint64 *cq_size
  128. );
  129. mlx_status
  130. nodnic_port_allocate_eq(
  131. IN nodnic_port_priv *port_priv,
  132. IN mlx_uint8 log_eq_size
  133. );
  134. mlx_status
  135. nodnic_port_free_eq(
  136. IN nodnic_port_priv *port_priv
  137. );
  138. mlx_status
  139. nodnic_port_add_mac_filter(
  140. IN nodnic_port_priv *port_priv,
  141. IN mlx_mac_address mac
  142. );
  143. mlx_status
  144. nodnic_port_remove_mac_filter(
  145. IN nodnic_port_priv *port_priv,
  146. IN mlx_mac_address mac
  147. );
  148. mlx_status
  149. nodnic_port_add_mgid_filter(
  150. IN nodnic_port_priv *port_priv,
  151. IN mlx_mac_address mac
  152. );
  153. mlx_status
  154. nodnic_port_remove_mgid_filter(
  155. IN nodnic_port_priv *port_priv,
  156. IN mlx_mac_address mac
  157. );
  158. mlx_status
  159. nodnic_port_thin_init(
  160. IN nodnic_device_priv *device_priv,
  161. IN nodnic_port_priv *port_priv,
  162. IN mlx_uint8 port_index
  163. );
  164. mlx_status
  165. nodnic_port_set_promisc(
  166. IN nodnic_port_priv *port_priv,
  167. IN mlx_boolean value
  168. );
  169. mlx_status
  170. nodnic_port_set_promisc_multicast(
  171. IN nodnic_port_priv *port_priv,
  172. IN mlx_boolean value
  173. );
  174. mlx_status
  175. nodnic_port_init(
  176. IN nodnic_port_priv *port_priv
  177. );
  178. mlx_status
  179. nodnic_port_close(
  180. IN nodnic_port_priv *port_priv
  181. );
  182. mlx_status
  183. nodnic_port_enable_dma(
  184. IN nodnic_port_priv *port_priv
  185. );
  186. mlx_status
  187. nodnic_port_disable_dma(
  188. IN nodnic_port_priv *port_priv
  189. );
  190. mlx_status
  191. nodnic_port_read_reset_needed(
  192. IN nodnic_port_priv *port_priv,
  193. OUT mlx_boolean *reset_needed
  194. );
  195. mlx_status
  196. nodnic_port_read_port_management_change_event(
  197. IN nodnic_port_priv *port_priv,
  198. OUT mlx_boolean *change_event
  199. );
  200. #endif /* STUB_NODNIC_PORT_H_ */