summaryrefslogtreecommitdiffstats
path: root/src/include
diff options
context:
space:
mode:
authorMichael Brown2008-11-07 04:26:35 +0100
committerMichael Brown2008-11-11 06:31:08 +0100
commit9a35830d1f13c85be738325ac900b88b9b60139d (patch)
tree5194aa1aebaa7451948bfec3bed3257ebcf85abe /src/include
parent[infiniband] Split subnet management agent client out into ib_smc.c (diff)
downloadipxe-9a35830d1f13c85be738325ac900b88b9b60139d.tar.gz
ipxe-9a35830d1f13c85be738325ac900b88b9b60139d.tar.xz
ipxe-9a35830d1f13c85be738325ac900b88b9b60139d.zip
[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.
Diffstat (limited to 'src/include')
-rw-r--r--src/include/gpxe/ipoib.h43
-rw-r--r--src/include/gpxe/netdevice.h2
2 files changed, 21 insertions, 24 deletions
diff --git a/src/include/gpxe/ipoib.h b/src/include/gpxe/ipoib.h
index 3ec464e3..80adee5b 100644
--- a/src/include/gpxe/ipoib.h
+++ b/src/include/gpxe/ipoib.h
@@ -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;
diff --git a/src/include/gpxe/netdevice.h b/src/include/gpxe/netdevice.h
index 7be5b813..01b853f3 100644
--- a/src/include/gpxe/netdevice.h
+++ b/src/include/gpxe/netdevice.h
@@ -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