[eoib] Add Ethernet over Infiniband (EoIB) driver

EoIB is a fairly simple protocol in which raw Ethernet frames
(excluding the CRC) are encapsulated within Infiniband Unreliable
Datagrams, with a four-byte fixed EoIB header (which conveys no actual
information).  The Ethernet broadcast domain is provided by a
multicast group, similar to the IPoIB IPv4 multicast group.

The mapping from Ethernet MAC addresses to Infiniband address vectors
is achieved by snooping incoming traffic and building a peer cache
which can then be used to map a MAC address into a port GID.  The
address vector is completed using a path record lookup, as for IPoIB.
Note that this requires every packet to include a GRH.

Add basic support for EoIB devices.  This driver is substantially
derived from the IPoIB driver.  There is currently no mechanism for
automatically creating EoIB devices.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
Michael Brown
2016-03-09 00:26:56 +00:00
parent 5bcaa1e4d4
commit 9154d7a65c
3 changed files with 815 additions and 0 deletions

60
src/include/ipxe/eoib.h Normal file
View File

@@ -0,0 +1,60 @@
#ifndef _IPXE_EOIB_H
#define _IPXE_EOIB_H
/** @file
*
* Ethernet over Infiniband
*
*/
FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
#include <stdint.h>
#include <byteswap.h>
#include <ipxe/netdevice.h>
#include <ipxe/infiniband.h>
#include <ipxe/ib_mcast.h>
/** An EoIB header */
struct eoib_header {
/** Signature */
uint16_t magic;
/** Reserved */
uint16_t reserved;
} __attribute__ (( packed ));
/** EoIB magic signature */
#define EOIB_MAGIC 0x8919
/** An EoIB device */
struct eoib_device {
/** Name */
const char *name;
/** Network device */
struct net_device *netdev;
/** Underlying Infiniband device */
struct ib_device *ibdev;
/** List of EoIB devices */
struct list_head list;
/** Broadcast address */
struct ib_address_vector broadcast;
/** Completion queue */
struct ib_completion_queue *cq;
/** Queue pair */
struct ib_queue_pair *qp;
/** Broadcast group membership */
struct ib_mc_membership membership;
/** Peer cache */
struct list_head peers;
};
extern int eoib_create ( struct ib_device *ibdev, const uint8_t *hw_addr,
struct ib_address_vector *broadcast,
const char *name );
extern struct eoib_device * eoib_find ( struct ib_device *ibdev,
const uint8_t *hw_addr );
extern void eoib_destroy ( struct eoib_device *eoib );
#endif /* _IPXE_EOIB_H */

View File

@@ -185,6 +185,7 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
#define ERRFILE_intelxvf ( ERRFILE_DRIVER | 0x00790000 )
#define ERRFILE_smsc95xx ( ERRFILE_DRIVER | 0x007a0000 )
#define ERRFILE_acm ( ERRFILE_DRIVER | 0x007b0000 )
#define ERRFILE_eoib ( ERRFILE_DRIVER | 0x007c0000 )
#define ERRFILE_aoe ( ERRFILE_NET | 0x00000000 )
#define ERRFILE_arp ( ERRFILE_NET | 0x00010000 )