6
* Ethernet over Infiniband
10
FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
14
#include <ipxe/netdevice.h>
15
#include <ipxe/infiniband.h>
16
#include <ipxe/ib_mcast.h>
24
} __attribute__ (( packed ));
26
/** EoIB magic signature */
27
#define EOIB_MAGIC 0x8919
34
struct net_device *netdev;
35
/** Underlying Infiniband device */
36
struct ib_device *ibdev;
37
/** List of EoIB devices */
38
struct list_head list;
39
/** Broadcast address */
40
struct ib_address_vector broadcast;
42
/** Completion queue */
43
struct ib_completion_queue *cq;
45
struct ib_queue_pair *qp;
46
/** Broadcast group membership */
47
struct ib_mc_membership membership;
50
struct list_head peers;
52
/** Send duplicate packet to gateway (or NULL)
55
* @v original Original I/O buffer
57
void ( * duplicate ) ( struct eoib_device *eoib,
58
struct io_buffer *original );
59
/** Gateway (if any) */
60
struct ib_address_vector gateway;
61
/** Multicast group additional component mask */
66
* Check if EoIB device uses a gateway
69
* @v has_gw EoIB device uses a gateway
71
static inline int eoib_has_gateway ( struct eoib_device *eoib ) {
73
return ( eoib->duplicate != NULL );
77
* Force creation of multicast group
81
static inline void eoib_force_group_creation ( struct eoib_device *eoib ) {
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
89
eoib->mask = ( IB_SA_MCMEMBER_REC_PKEY | IB_SA_MCMEMBER_REC_QKEY |
90
IB_SA_MCMEMBER_REC_SL | IB_SA_MCMEMBER_REC_FLOW_LABEL |
91
IB_SA_MCMEMBER_REC_TRAFFIC_CLASS );
94
extern int eoib_create ( struct ib_device *ibdev, const uint8_t *hw_addr,
95
struct ib_address_vector *broadcast,
97
extern struct eoib_device * eoib_find ( struct ib_device *ibdev,
98
const uint8_t *hw_addr );
99
extern void eoib_destroy ( struct eoib_device *eoib );
100
extern void eoib_set_gateway ( struct eoib_device *eoib,
101
struct ib_address_vector *av );
103
#endif /* _IPXE_EOIB_H */