[ipoib] Kill off the IPoIB pseudo-header

Some Infiniband cards will not be as accommodating as the Arbel and
Hermon cards in providing enough space for us to push a fake extra
header at the start of the received packet.  We must therefore make do
with squeezing enough information to identify source and destination
addresses into the two bytes of padding within a genuine IPoIB
link-layer header.
This commit is contained in:
Michael Brown
2008-11-07 03:26:35 +00:00
parent 663904a7bc
commit 9a35830d1f
3 changed files with 223 additions and 138 deletions

View File

@@ -26,33 +26,30 @@ struct ipoib_mac {
} __attribute__ (( packed ));
/** IPoIB link-layer header length */
#define IPOIB_HLEN 24
#define IPOIB_HLEN 4
/**
* IPoIB link-layer header pseudo portion
*
* This part doesn't actually exist on the wire, but it provides a
* convenient way to fit into the typical network device model.
*/
struct ipoib_pseudo_hdr {
/** Peer address */
struct ipoib_mac peer;
} __attribute__ (( packed ));
/** IPoIB link-layer header real portion */
struct ipoib_real_hdr {
/** IPoIB link-layer header */
struct ipoib_hdr {
/** Network-layer protocol */
uint16_t proto;
/** Reserved, must be zero */
uint16_t reserved;
} __attribute__ (( packed ));
/** An IPoIB link-layer header */
struct ipoib_hdr {
/** Pseudo portion */
struct ipoib_pseudo_hdr pseudo;
/** Real portion */
struct ipoib_real_hdr real;
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;
} __attribute__ (( packed ));
extern struct ll_protocol ipoib_protocol;

View File

@@ -23,7 +23,7 @@ struct device;
#define MAX_LL_ADDR_LEN 20
/** Maximum length of a link-layer header */
#define MAX_LL_HEADER_LEN 32
#define MAX_LL_HEADER_LEN 6
/** Maximum length of a network-layer address */
#define MAX_NET_ADDR_LEN 4