iPXE
ib_packet.h
Go to the documentation of this file.
1#ifndef _IPXE_IB_PACKET_H
2#define _IPXE_IB_PACKET_H
4/** @file
5 *
6 * Infiniband packet format
7 *
8 */
10FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
11FILE_SECBOOT ( PERMITTED );
13struct ib_device;
16struct io_buffer;
17
18/** An Infiniband Globally Unique Identifier */
25
26/** Infiniband Globally Unique Identifier debug message format */
27#define IB_GUID_FMT "%08x:%08x"
28
29/** Infiniband Globally Unique Identifier debug message arguments */
30#define IB_GUID_ARGS( guid ) \
31 ntohl ( (guid)->dwords[0] ), ntohl ( (guid)->dwords[1] )
32
33/** An Infiniband Global Identifier */
34union ib_gid {
39 struct {
42 } s;
43};
44
45/** Infiniband Global Identifier debug message format */
46#define IB_GID_FMT IB_GUID_FMT ":" IB_GUID_FMT
47
48/** Infiniband Global Identifier debug message arguments */
49#define IB_GID_ARGS( gid ) \
50 IB_GUID_ARGS ( &(gid)->s.prefix ), IB_GUID_ARGS ( &(gid)->s.guid )
51
52/** Test for multicast GID */
53#define IB_GID_MULTICAST( gid ) ( (gid)->bytes[0] == 0xff )
54
55/** An Infiniband Local Route Header */
57 /** Virtual lane and link version */
59 /** Service level and next link header */
61 /** Destination LID */
63 /** Packet length */
65 /** Source LID */
67} __attribute__ (( packed ));
68
69/** Infiniband virtual lanes */
74
75/** An Infiniband Link Next Header value */
82
83/** Default Infiniband LID */
84#define IB_LID_NONE 0xffff
85
86/** Test for multicast LID */
87#define IB_LID_MULTICAST( lid ) ( ( (lid) >= 0xc000 ) && ( (lid) <= 0xfffe ) )
88
89/** An Infiniband Global Route Header */
91 /** IP version, traffic class, and flow label
92 *
93 * 4 bits : Version of the GRH
94 * 8 bits : Traffic class
95 * 20 bits : Flow label
96 */
98 /** Payload length */
100 /** Next header */
102 /** Hop limit */
104 /** Source GID */
106 /** Destiniation GID */
108} __attribute__ (( packed ));
109
110#define IB_GRH_IPVER_IPv6 0x06
111#define IB_GRH_NXTHDR_IBA 0x1b
112
113/** An Infiniband Base Transport Header */
115 /** Opcode */
117 /** Transport header version, pad count, migration and solicitation */
119 /** Partition key */
121 /** Destination queue pair */
123 /** Packet sequence number and acknowledge request */
125} __attribute__ (( packed ));
126
127/** An Infiniband BTH opcode */
131
132/** An Infiniband Datagram Extended Transport Header */
134 /** Queue key */
136 /** Source queue pair */
138} __attribute__ (( packed ));
139
140/** All known IB header formats */
149 struct {
153 } __attribute__ (( packed )) lrh__bth__deth;
154} __attribute__ (( packed ));
155
156/** Maximum size required for IB headers */
157#define IB_MAX_HEADER_SIZE sizeof ( union ib_headers )
158
159extern int ib_push ( struct ib_device *ibdev, struct io_buffer *iobuf,
160 struct ib_queue_pair *qp, size_t payload_len,
161 const struct ib_address_vector *dest );
162extern int ib_pull ( struct ib_device *ibdev, struct io_buffer *iobuf,
163 struct ib_queue_pair **qp, size_t *payload_len,
164 struct ib_address_vector *dest,
165 struct ib_address_vector *source );
166
167#endif /* _IPXE_IB_PACKET_H */
struct arbelprm_qp_db_record qp
Definition arbel.h:2
unsigned short uint16_t
Definition stdint.h:11
unsigned int uint32_t
Definition stdint.h:12
unsigned long long uint64_t
Definition stdint.h:13
unsigned char uint8_t
Definition stdint.h:10
if(len >=6 *4) __asm__ __volatile__("movsl" if(len >=5 *4) __asm__ __volatile__("movsl" if(len >=4 *4) __asm__ __volatile__("movsl" if(len >=3 *4) __asm__ __volatile__("movsl" if(len >=2 *4) __asm__ __volatile__("movsl" if(len >=1 *4) __asm__ __volatile__("movsl" if((len % 4) >=2) __asm__ __volatile__("movsw" if((len % 2) >=1) __asm__ __volatile__("movsb" retur dest)
Definition string.h:151
#define FILE_LICENCE(_licence)
Declare a particular licence as applying to a file.
Definition compiler.h:896
enum ib_vl __attribute__
#define FILE_SECBOOT(_status)
Declare a file's UEFI Secure Boot permission status.
Definition compiler.h:926
int ib_pull(struct ib_device *ibdev, struct io_buffer *iobuf, struct ib_queue_pair **qp, size_t *payload_len, struct ib_address_vector *dest, struct ib_address_vector *source)
Remove IB headers.
Definition ib_packet.c:133
struct ib_datagram_extended_transport_header deth
Definition ib_packet.h:3
int ib_push(struct ib_device *ibdev, struct io_buffer *iobuf, struct ib_queue_pair *qp, size_t payload_len, const struct ib_address_vector *dest)
Add IB headers.
Definition ib_packet.c:52
ib_lnh
An Infiniband Link Next Header value.
Definition ib_packet.h:76
@ IB_LNH_BTH
Definition ib_packet.h:79
@ IB_LNH_RAW
Definition ib_packet.h:77
@ IB_LNH_IPv6
Definition ib_packet.h:78
@ IB_LNH_GRH
Definition ib_packet.h:80
ib_vl
Infiniband virtual lanes.
Definition ib_packet.h:70
@ IB_VL_DEFAULT
Definition ib_packet.h:71
@ IB_VL_SMP
Definition ib_packet.h:72
ib_bth_opcode
An Infiniband BTH opcode.
Definition ib_packet.h:128
@ BTH_OPCODE_UD_SEND
Definition ib_packet.h:129
struct ib_base_transport_header bth
Definition ib_packet.h:2
struct ib_local_route_header lrh
Definition ib_packet.h:0
An Infiniband Address Vector.
Definition infiniband.h:73
An Infiniband Base Transport Header.
Definition ib_packet.h:114
uint8_t se__m__padcnt__tver
Transport header version, pad count, migration and solicitation.
Definition ib_packet.h:118
uint32_t dest_qp
Destination queue pair.
Definition ib_packet.h:122
uint16_t pkey
Partition key.
Definition ib_packet.h:120
uint8_t opcode
Opcode.
Definition ib_packet.h:116
uint32_t ack__psn
Packet sequence number and acknowledge request.
Definition ib_packet.h:124
An Infiniband Datagram Extended Transport Header.
Definition ib_packet.h:133
uint32_t src_qp
Source queue pair.
Definition ib_packet.h:137
An Infiniband device.
Definition infiniband.h:399
An Infiniband Global Route Header.
Definition ib_packet.h:90
uint8_t hoplmt
Hop limit.
Definition ib_packet.h:103
uint16_t paylen
Payload length.
Definition ib_packet.h:99
union ib_gid sgid
Source GID.
Definition ib_packet.h:105
uint8_t nxthdr
Next header.
Definition ib_packet.h:101
uint32_t ipver__tclass__flowlabel
IP version, traffic class, and flow label.
Definition ib_packet.h:97
union ib_gid dgid
Destiniation GID.
Definition ib_packet.h:107
An Infiniband Local Route Header.
Definition ib_packet.h:56
uint8_t sl__lnh
Service level and next link header.
Definition ib_packet.h:60
uint16_t length
Packet length.
Definition ib_packet.h:64
uint16_t slid
Source LID.
Definition ib_packet.h:66
uint8_t vl__lver
Virtual lane and link version.
Definition ib_packet.h:58
uint16_t dlid
Destination LID.
Definition ib_packet.h:62
An Infiniband Queue Pair.
Definition infiniband.h:158
A persistent I/O buffer.
Definition iobuf.h:38
An Infiniband Global Identifier.
Definition ib_packet.h:34
uint16_t words[8]
Definition ib_packet.h:36
uint8_t bytes[16]
Definition ib_packet.h:35
struct ib_gid::@251011351113275240012301235177256303262052134237 s
union ib_guid prefix
Definition ib_packet.h:40
uint64_t qwords[2]
Definition ib_packet.h:38
uint32_t dwords[4]
Definition ib_packet.h:37
union ib_guid guid
Definition ib_packet.h:41
An Infiniband Globally Unique Identifier.
Definition ib_packet.h:19
uint32_t dwords[2]
Definition ib_packet.h:22
uint8_t bytes[8]
Definition ib_packet.h:20
uint16_t words[4]
Definition ib_packet.h:21
uint64_t qword
Definition ib_packet.h:23
All known IB header formats.
Definition ib_packet.h:141
struct ib_base_transport_header bth
Definition ib_packet.h:146
struct ib_datagram_extended_transport_header deth
Definition ib_packet.h:147
struct ib_global_route_header grh
Definition ib_packet.h:145
struct ib_local_route_header lrh
Definition ib_packet.h:142