diff options
author | Michael Brown <mcb30@ipxe.org> | 2012-08-29 23:34:14 +0100 |
---|---|---|
committer | Michael Brown <mcb30@ipxe.org> | 2012-08-31 21:22:59 +0100 |
commit | 03f0c23f8b1a60575f788dd1b9d4ea47debf2345 (patch) | |
tree | 60b2312a0d56d6707a25aef4ce5bb4f6874359d6 /src/include/ipxe/ipoib.h | |
parent | f54a61e43450fae7d045bebabc4c368d325e71d3 (diff) | |
download | ipxe-03f0c23f8b1a60575f788dd1b9d4ea47debf2345.tar.gz |
[ipoib] Expose Ethernet-compatible eIPoIB link-layer addresses and headers
Almost all clients of the raw-packet interfaces (UNDI and SNP) can
handle only Ethernet link layers. Expose an Ethernet-compatible link
layer to local clients, while remaining compatible with IPoIB on the
wire. This requires manipulation of ARP (but not DHCP) packets within
the IPoIB driver.
This is ugly, but it's the only viable way to allow IPoIB devices to
be driven via the raw-packet interfaces.
Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/include/ipxe/ipoib.h')
-rw-r--r-- | src/include/ipxe/ipoib.h | 42 |
1 files changed, 25 insertions, 17 deletions
diff --git a/src/include/ipxe/ipoib.h b/src/include/ipxe/ipoib.h index e8f12dc5d..68ff8df49 100644 --- a/src/include/ipxe/ipoib.h +++ b/src/include/ipxe/ipoib.h @@ -8,6 +8,7 @@ FILE_LICENCE ( GPL2_OR_LATER ); +#include <ipxe/if_arp.h> #include <ipxe/infiniband.h> /** IPoIB MAC address length */ @@ -33,25 +34,32 @@ struct ipoib_hdr { /** Network-layer protocol */ uint16_t proto; /** Reserved, must be zero */ - union { - /** Reserved, must be zero */ - uint16_t reserved; - /** Peer addresses - * - * We use these fields internally to represent the - * peer addresses using a lookup key. There simply - * isn't enough room in the IPoIB header to store - * literal source or destination MAC addresses. - */ - struct { - /** Destination address key */ - uint8_t dest; - /** Source address key */ - uint8_t src; - } __attribute__ (( packed )) peer; - } __attribute__ (( packed )) u; + uint16_t reserved; } __attribute__ (( packed )); +/** GUID mask used for constructing eIPoIB Local Ethernet MAC address (LEMAC) */ +#define IPOIB_GUID_MASK 0xe7 + +/** eIPoIB Remote Ethernet MAC address + * + * An eIPoIB REMAC address is an Ethernet-like (6 byte) link-layer + * pseudo-address used to look up a full IPoIB link-layer address. + */ +struct ipoib_remac { + /** Remote QPN + * + * Must be ORed with EIPOIB_QPN_LA so that eIPoIB REMAC + * addresses are considered as locally-assigned Ethernet MAC + * addreses. + */ + uint32_t qpn; + /** Remote LID */ + uint16_t lid; +} __attribute__ (( packed )); + +/** eIPoIB REMAC locally-assigned address indicator */ +#define EIPOIB_QPN_LA 0x02000000UL + extern const char * ipoib_ntoa ( const void *ll_addr ); extern struct net_device * alloc_ipoibdev ( size_t priv_size ); |