Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

ib_packet.h 2.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. #ifndef _GPXE_IB_PACKET_H
  2. #define _GPXE_IB_PACKET_H
  3. /** @file
  4. *
  5. * Infiniband packet format
  6. *
  7. */
  8. /** Half of an Infiniband Global Identifier */
  9. struct ib_gid_half {
  10. uint8_t bytes[8];
  11. };
  12. /** An Infiniband Global Identifier */
  13. struct ib_gid {
  14. union {
  15. uint8_t bytes[16];
  16. uint16_t words[8];
  17. uint32_t dwords[4];
  18. struct ib_gid_half half[2];
  19. } u;
  20. };
  21. /** An Infiniband Local Route Header */
  22. struct ib_local_route_header {
  23. /** Virtual lane and link version */
  24. uint8_t vl__lver;
  25. /** Service level and next link header */
  26. uint8_t sl__lnh;
  27. /** Destination LID */
  28. uint16_t dlid;
  29. /** Packet length */
  30. uint16_t length;
  31. /** Source LID */
  32. uint16_t slid;
  33. } __attribute__ (( packed ));
  34. /** Infiniband virtual lanes */
  35. enum ib_vl {
  36. IB_VL_DEFAULT = 0,
  37. IB_VL_SMP = 15,
  38. };
  39. /** An Infiniband Link Next Header value */
  40. enum ib_lnh {
  41. IB_LNH_RAW = 0,
  42. IB_LNH_IPv6 = 1,
  43. IB_LNH_BTH = 2,
  44. IB_LNH_GRH = 3
  45. };
  46. /** Default Infiniband LID */
  47. #define IB_LID_NONE 0xffff
  48. /** An Infiniband Global Route Header */
  49. struct ib_global_route_header {
  50. /** IP version, traffic class, and flow label
  51. *
  52. * 4 bits : Version of the GRH
  53. * 8 bits : Traffic class
  54. * 20 bits : Flow label
  55. */
  56. uint32_t ipver__tclass__flowlabel;
  57. /** Payload length */
  58. uint16_t paylen;
  59. /** Next header */
  60. uint8_t nxthdr;
  61. /** Hop limit */
  62. uint8_t hoplmt;
  63. /** Source GID */
  64. struct ib_gid sgid;
  65. /** Destiniation GID */
  66. struct ib_gid dgid;
  67. } __attribute__ (( packed ));
  68. #define IB_GRH_IPVER_IPv6 0x06
  69. #define IB_GRH_NXTHDR_IBA 0x1b
  70. #define IB_GRH_HOPLMT_MAX 0xff
  71. /** An Infiniband Base Transport Header */
  72. struct ib_base_transport_header {
  73. /** Opcode */
  74. uint8_t opcode;
  75. /** Transport header version, pad count, migration and solicitation */
  76. uint8_t se__m__padcnt__tver;
  77. /** Partition key */
  78. uint16_t pkey;
  79. /** Destination queue pair */
  80. uint32_t dest_qp;
  81. /** Packet sequence number and acknowledge request */
  82. uint32_t ack__psn;
  83. } __attribute__ (( packed ));
  84. /** An Infiniband BTH opcode */
  85. enum ib_bth_opcode {
  86. BTH_OPCODE_UD_SEND = 0x64,
  87. };
  88. /** Default Infiniband partition key */
  89. #define IB_PKEY_NONE 0xffff
  90. /** Subnet management queue pair number */
  91. #define IB_QPN_SMP 0
  92. /** An Infiniband Datagram Extended Transport Header */
  93. struct ib_datagram_extended_transport_header {
  94. /** Queue key */
  95. uint32_t qkey;
  96. /** Source queue pair */
  97. uint32_t src_qp;
  98. } __attribute__ (( packed ));
  99. #endif /* _GPXE_IB_PACKET_H */