iPXE
eoib.h
Go to the documentation of this file.
1#ifndef _IPXE_EOIB_H
2#define _IPXE_EOIB_H
3
4/** @file
5 *
6 * Ethernet over Infiniband
7 *
8 */
9
10FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
11
12#include <stdint.h>
13#include <byteswap.h>
14#include <ipxe/netdevice.h>
15#include <ipxe/infiniband.h>
16#include <ipxe/ib_mcast.h>
17
18/** An EoIB header */
20 /** Signature */
22 /** Reserved */
24} __attribute__ (( packed ));
25
26/** EoIB magic signature */
27#define EOIB_MAGIC 0x8919
28
29/** An EoIB device */
31 /** Name */
32 const char *name;
33 /** Network device */
35 /** Underlying Infiniband device */
37 /** List of EoIB devices */
39 /** Broadcast address */
41
42 /** Completion queue */
44 /** Queue pair */
46 /** Broadcast group membership */
48
49 /** Peer cache */
51
52 /** Send duplicate packet to gateway (or NULL)
53 *
54 * @v eoib EoIB device
55 * @v original Original I/O buffer
56 */
57 void ( * duplicate ) ( struct eoib_device *eoib,
58 struct io_buffer *original );
59 /** Gateway (if any) */
61 /** Multicast group additional component mask */
62 unsigned int mask;
63};
64
65/**
66 * Check if EoIB device uses a gateway
67 *
68 * @v eoib EoIB device
69 * @v has_gw EoIB device uses a gateway
70 */
71static inline int eoib_has_gateway ( struct eoib_device *eoib ) {
72
73 return ( eoib->duplicate != NULL );
74}
75
76/**
77 * Force creation of multicast group
78 *
79 * @v eoib EoIB device
80 */
81static inline void eoib_force_group_creation ( struct eoib_device *eoib ) {
82
83 /* Some dubious EoIB implementations require each endpoint to
84 * force the creation of the multicast group. Yes, this makes
85 * it impossible for the group parameters (e.g. SL) to ever be
86 * modified without breaking backwards compatiblity with every
87 * existing driver.
88 */
92}
93
94extern int eoib_create ( struct ib_device *ibdev, const uint8_t *hw_addr,
95 struct ib_address_vector *broadcast,
96 const char *name );
97extern struct eoib_device * eoib_find ( struct ib_device *ibdev,
98 const uint8_t *hw_addr );
99extern void eoib_destroy ( struct eoib_device *eoib );
100extern void eoib_set_gateway ( struct eoib_device *eoib,
101 struct ib_address_vector *av );
102
103#endif /* _IPXE_EOIB_H */
#define NULL
NULL pointer (VOID *)
Definition Base.h:322
unsigned short uint16_t
Definition stdint.h:11
unsigned char uint8_t
Definition stdint.h:10
const char * name
Definition ath9k_hw.c:1986
int eoib_create(struct ib_device *ibdev, const uint8_t *hw_addr, struct ib_address_vector *broadcast, const char *name)
Create EoIB device.
Definition eoib.c:619
static int eoib_has_gateway(struct eoib_device *eoib)
Check if EoIB device uses a gateway.
Definition eoib.h:71
static void eoib_force_group_creation(struct eoib_device *eoib)
Force creation of multicast group.
Definition eoib.h:81
struct eoib_device * eoib_find(struct ib_device *ibdev, const uint8_t *hw_addr)
Find EoIB device.
Definition eoib.c:677
void eoib_set_gateway(struct eoib_device *eoib, struct ib_address_vector *av)
Set EoIB gateway.
Definition eoib.c:881
void eoib_destroy(struct eoib_device *eoib)
Remove EoIB device.
Definition eoib.c:695
#define FILE_LICENCE(_licence)
Declare a particular licence as applying to a file.
Definition compiler.h:896
#define IB_SA_MCMEMBER_REC_QKEY
Definition ib_mad.h:281
#define IB_SA_MCMEMBER_REC_FLOW_LABEL
Definition ib_mad.h:292
#define IB_SA_MCMEMBER_REC_SL
Definition ib_mad.h:291
#define IB_SA_MCMEMBER_REC_PKEY
Definition ib_mad.h:286
#define IB_SA_MCMEMBER_REC_TRAFFIC_CLASS
Definition ib_mad.h:285
Infiniband multicast groups.
#define __attribute__(x)
Definition compiler.h:10
Infiniband protocol.
Network device management.
An EoIB device.
Definition eoib.h:30
struct list_head peers
Peer cache.
Definition eoib.h:50
unsigned int mask
Multicast group additional component mask.
Definition eoib.h:62
void(* duplicate)(struct eoib_device *eoib, struct io_buffer *original)
Send duplicate packet to gateway (or NULL)
Definition eoib.h:57
struct ib_address_vector broadcast
Broadcast address.
Definition eoib.h:40
struct ib_queue_pair * qp
Queue pair.
Definition eoib.h:45
struct ib_device * ibdev
Underlying Infiniband device.
Definition eoib.h:36
struct ib_address_vector gateway
Gateway (if any)
Definition eoib.h:60
const char * name
Name.
Definition eoib.h:32
struct list_head list
List of EoIB devices.
Definition eoib.h:38
struct ib_mc_membership membership
Broadcast group membership.
Definition eoib.h:47
struct ib_completion_queue * cq
Completion queue.
Definition eoib.h:43
struct net_device * netdev
Network device.
Definition eoib.h:34
An EoIB header.
Definition eoib.h:19
uint16_t reserved
Reserved.
Definition eoib.h:23
uint16_t magic
Signature.
Definition eoib.h:21
An Infiniband Address Vector.
Definition infiniband.h:73
An Infiniband Completion Queue.
Definition infiniband.h:225
An Infiniband device.
Definition infiniband.h:399
An Infiniband multicast group membership.
Definition ib_mcast.h:17
An Infiniband Queue Pair.
Definition infiniband.h:158
A persistent I/O buffer.
Definition iobuf.h:38
A doubly-linked list entry (or list head)
Definition list.h:19
A network device.
Definition netdevice.h:353