2
0
mirror of https://github.com/xcat2/xNBA.git synced 2026-09-11 20:06:20 +00:00
Files
xNBA/src/include/ipxe/ipoib.h
T
Michael Brown 03f0c23f8b [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>
2012-08-31 21:22:59 +01:00

67 lines
1.5 KiB
C

#ifndef _IPXE_IPOIB_H
#define _IPXE_IPOIB_H
/** @file
*
* IP over Infiniband
*/
FILE_LICENCE ( GPL2_OR_LATER );
#include <ipxe/if_arp.h>
#include <ipxe/infiniband.h>
/** IPoIB MAC address length */
#define IPOIB_ALEN 20
/** An IPoIB MAC address */
struct ipoib_mac {
/** Queue pair number
*
* MSB indicates support for IPoIB "connected mode". Lower 24
* bits are the QPN.
*/
uint32_t flags__qpn;
/** Port GID */
union ib_gid gid;
} __attribute__ (( packed ));
/** IPoIB link-layer header length */
#define IPOIB_HLEN 4
/** IPoIB link-layer header */
struct ipoib_hdr {
/** Network-layer protocol */
uint16_t proto;
/** Reserved, must be zero */
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 );
#endif /* _IPXE_IPOIB_H */