6
* Xsigo virtual Ethernet devices
10
FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
13
#include <ipxe/infiniband.h>
14
#include <ipxe/eoib.h>
16
/** Xsigo directory service record name */
17
#define XDS_SERVICE_NAME "XSIGOXDS"
19
/** Xsigo configuration manager service ID */
20
#define XCM_SERVICE_ID { 0x00, 0x00, 0x00, 0x00, 0x02, 0x13, 0x97, 0x01 }
22
/** Xsigo management class */
23
#define XSIGO_MGMT_CLASS 0x0b
25
/** Xsigo management class version */
26
#define XSIGO_MGMT_CLASS_VERSION 2
28
/** Xsigo configuration manager request MAD */
29
#define XSIGO_ATTR_XCM_REQUEST 0xb002
31
/** Generic operating system type */
32
#define XSIGO_OS_TYPE_GENERIC 0x40
34
/** Xsigo virtual Ethernet broadcast GID prefix */
35
#define XVE_PREFIX 0xff15101cUL
37
/** Xsigo resource types */
38
enum xsigo_resource_type {
39
/** Virtual Ethernet resource type */
40
XSIGO_RESOURCE_XVE = ( 1 << 6 ),
41
/** Absence-of-high-availability "resource" type */
42
XSIGO_RESOURCE_NO_HA = ( 1 << 4 ),
45
/** A Xsigo server identifier */
46
struct xsigo_server_id {
47
/** Virtual machine ID */
51
} __attribute__ (( packed ));
53
/** A Xsigo configuration manager identifier */
54
struct xsigo_manager_id {
61
} __attribute__ (( packed ));
63
/** A Xsigo configuration manager request MAD */
64
struct xsigo_managers_request {
66
struct ib_mad_hdr mad_hdr;
68
uint8_t reserved0[32];
70
struct xsigo_server_id server;
72
char hostname[ 65 /* Seriously, guys? */ ];
75
/** CPU architecture */
81
/** Firmware version */
82
uint64_t firmware_version;
83
/** Hardware version */
84
uint32_t hardware_version;
86
uint32_t driver_version;
88
union ib_gid system_id;
96
uint8_t reserved3[19];
97
} __attribute__ (( packed ));
99
/** Resource types are present */
100
#define XSIGO_RESOURCES_PRESENT 0x8000
102
/** A Xsigo configuration manager reply MAD */
103
struct xsigo_managers_reply {
105
struct ib_mad_hdr mad_hdr;
107
uint8_t reserved0[32];
109
struct xsigo_server_id server;
110
/** Number of XCM records */
115
uint8_t reserved1[2];
117
struct xsigo_manager_id manager[8];
119
uint8_t reserved2[24];
120
} __attribute__ (( packed ));
126
/** Configuration manager request */
127
struct xsigo_managers_request request;
128
/** Configuration manager reply */
129
struct xsigo_managers_reply reply;
130
} __attribute__ (( packed ));
132
/** An XSMP node identifier */
133
struct xsmp_node_id {
134
/** Auxiliary ID (never used) */
138
} __attribute__ (( packed ));
140
/** An XSMP message header */
141
struct xsmp_message_header {
148
/** Sequence number */
150
/** Source node ID */
151
struct xsmp_node_id src;
152
/** Destination node ID */
153
struct xsmp_node_id dst;
154
} __attribute__ (( packed ));
156
/** XSMP message types */
157
enum xsmp_message_type {
158
/** Session message type */
159
XSMP_TYPE_SESSION = 1,
160
/** Virtual Ethernet message type */
164
/** An XSMP session message */
165
struct xsmp_session_message {
166
/** Message header */
167
struct xsmp_message_header hdr;
172
/** Length (excluding message header) */
174
/** Operating system type */
178
/** Resource types */
180
/** Driver version */
181
uint32_t driver_version;
182
/** Required chassis version */
183
uint32_t chassis_version;
186
/** Firmware version */
187
uint64_t firmware_version;
188
/** Hardware version */
189
uint32_t hardware_version;
190
/** Vendor part ID */
192
/** Protocol version */
193
uint32_t xsmp_version;
199
uint8_t reserved1[120];
200
} __attribute__ (( packed ));
202
/** XSMP session message types */
203
enum xsmp_session_type {
204
/** Keepalive message */
205
XSMP_SESSION_TYPE_HELLO = 1,
206
/** Initial registration message */
207
XSMP_SESSION_TYPE_REGISTER = 2,
208
/** Registration confirmation message */
209
XSMP_SESSION_TYPE_CONFIRM = 3,
210
/** Registration rejection message */
211
XSMP_SESSION_TYPE_REJECT = 4,
212
/** Shutdown message */
213
XSMP_SESSION_TYPE_SHUTDOWN = 5,
216
/** XSMP boot flags */
217
enum xsmp_session_boot {
219
XSMP_BOOT_PXE = ( 1 << 0 ),
222
/** XSMP virtual Ethernet channel adapter parameters */
224
/** Subnet prefix (little-endian) */
225
union ib_guid prefix_le;
226
/** Control queue pair number */
228
/** Data queue pair number */
234
} __attribute__ (( packed ));
236
/** XSMP virtual Ethernet MAC address */
237
struct xsmp_xve_mac {
242
} __attribute__ (( packed ));
244
/** An XSMP virtual Ethernet message */
245
struct xsmp_xve_message {
246
/** Message header */
247
struct xsmp_message_header hdr;
252
/** Length (excluding message header) */
254
/** Update bitmask */
256
/** Resource identifier */
257
union ib_guid resource;
258
/** TCA GUID (little-endian) */
259
union ib_guid guid_le;
262
/** MAC address (little-endian) */
263
struct xsmp_xve_mac mac_le;
266
/** Administrative state (non-zero = "up") */
268
/** Encapsulation (apparently obsolete and unused) */
272
/** Installation flags (apparently obsolete and unused) */
274
/** Interface name */
278
/** Flow control enabled (apparently obsolete and unused) */
280
/** Committed rate (in Mbps) */
281
uint16_t committed_mbps;
282
/** Peak rate (in Mbps) */
284
/** Committed burst size (in bytes) */
285
uint32_t committed_burst;
286
/** Peak burst size (in bytes) */
292
/** Multipath flags */
294
/** Multipath group name */
296
/** Link aggregation flag */
298
/** Link aggregation policy */
306
/** Target channel adapter parameters */
307
struct xsmp_xve_ca tca;
308
/** Host channel adapter parameters */
309
struct xsmp_xve_ca hca;
311
uint8_t reserved1[336];
312
} __attribute__ (( packed ));
314
/** XSMP virtual Ethernet message types */
316
/** Install virtual NIC */
317
XSMP_XVE_TYPE_INSTALL = 1,
318
/** Delete virtual NIC */
319
XSMP_XVE_TYPE_DELETE = 2,
320
/** Update virtual NIC */
321
XSMP_XVE_TYPE_UPDATE = 3,
322
/** Set operational state up */
323
XSMP_XVE_TYPE_OPER_UP = 6,
324
/** Set operational state down */
325
XSMP_XVE_TYPE_OPER_DOWN = 7,
326
/** Get operational state */
327
XSMP_XVE_TYPE_OPER_REQ = 15,
328
/** Virtual NIC is ready */
329
XSMP_XVE_TYPE_READY = 20,
332
/** XSMP virtual Ethernet message codes */
334
/* Something went wrong */
335
XSMP_XVE_CODE_ERROR = 0x84,
338
/** XSMP virtual Ethernet update bitmask */
339
enum xsmp_xve_update {
341
XSMP_XVE_UPDATE_MTU = ( 1 << 2 ),
342
/** Update administrative state */
343
XSMP_XVE_UPDATE_STATE = ( 1 << 6 ),
344
/** Update gateway to mark as down */
345
XSMP_XVE_UPDATE_GW_DOWN = ( 1 << 30 ),
346
/** Update gateway information */
347
XSMP_XVE_UPDATE_GW_CHANGE = ( 1 << 31 ),
350
/** XSMP virtual Ethernet modes */
352
/** Reliable Connected */
353
XSMP_XVE_MODE_RC = 1,
354
/** Unreliable Datagram */
355
XSMP_XVE_MODE_UD = 2,
358
/** XSMP virtual Ethernet uplink types */
359
enum xsmp_xve_uplink {
361
XSMP_XVE_NO_UPLINK = 1,
366
/** An XSMP message */
368
/** Message header */
369
struct xsmp_message_header hdr;
370
/** Session message */
371
struct xsmp_session_message sess;
372
/** Virtual Ethernet message */
373
struct xsmp_xve_message xve;
376
/** Delay between attempts to open the Infiniband device
378
* This is a policy decision.
380
#define XSIGO_OPEN_RETRY_DELAY ( 2 * TICKS_PER_SEC )
382
/** Delay between unsuccessful discovery attempts
384
* This is a policy decision.
386
#define XSIGO_DISCOVERY_FAILURE_DELAY ( 10 * TICKS_PER_SEC )
388
/** Delay between successful discovery attempts
390
* This is a policy decision.
392
#define XSIGO_DISCOVERY_SUCCESS_DELAY ( 20 * TICKS_PER_SEC )
394
/** Delay between keepalive requests
396
* This is a policy decision.
398
#define XSIGO_KEEPALIVE_INTERVAL ( 10 * TICKS_PER_SEC )
400
/** Maximum time to wait for a keepalive response
402
* This is a policy decision.
404
#define XSIGO_KEEPALIVE_MAX_WAIT ( 2 * TICKS_PER_SEC )
406
#endif /* _IPXE_XSIGO_H */