aboutsummaryrefslogtreecommitdiff
path: root/include/rdma
diff options
context:
space:
mode:
authorEli Cohen <eli@dev.mellanox.co.il>2010-08-26 14:17:56 +0000
committerRoland Dreier <rolandd@cisco.com>2010-10-14 12:41:29 -0700
commitff7f5aab354dee01f29c9c00933f6d4aa590eadb (patch)
treec6f4075f712808ba76927224fac2960f4c5353ec /include/rdma
parent3c86aa70bf677a31b71c8292e349242e26cbc743 (diff)
IB/pack: IBoE UD packet packing support
Add support for packing IBoE packet headers. Signed-off-by: Eli Cohen <eli@mellanox.co.il> [ Clean up and fix ib_ud_header_init() a bit. - Roland ] Signed-off-by: Roland Dreier <rolandd@cisco.com>
Diffstat (limited to 'include/rdma')
-rw-r--r--include/rdma/ib_pack.h30
1 files changed, 22 insertions, 8 deletions
diff --git a/include/rdma/ib_pack.h b/include/rdma/ib_pack.h
index cbb50f4da3d..6b91d8e7a1f 100644
--- a/include/rdma/ib_pack.h
+++ b/include/rdma/ib_pack.h
@@ -37,6 +37,7 @@
enum {
IB_LRH_BYTES = 8,
+ IB_ETH_BYTES = 14,
IB_GRH_BYTES = 40,
IB_BTH_BYTES = 12,
IB_DETH_BYTES = 8
@@ -210,14 +211,25 @@ struct ib_unpacked_deth {
__be32 source_qpn;
};
+struct ib_unpacked_eth {
+ u8 dmac_h[4];
+ u8 dmac_l[2];
+ u8 smac_h[2];
+ u8 smac_l[4];
+ __be16 type;
+};
+
struct ib_ud_header {
+ int lrh_present;
struct ib_unpacked_lrh lrh;
- int grh_present;
- struct ib_unpacked_grh grh;
- struct ib_unpacked_bth bth;
+ int eth_present;
+ struct ib_unpacked_eth eth;
+ int grh_present;
+ struct ib_unpacked_grh grh;
+ struct ib_unpacked_bth bth;
struct ib_unpacked_deth deth;
- int immediate_present;
- __be32 immediate_data;
+ int immediate_present;
+ __be32 immediate_data;
};
void ib_pack(const struct ib_field *desc,
@@ -230,9 +242,11 @@ void ib_unpack(const struct ib_field *desc,
void *buf,
void *structure);
-void ib_ud_header_init(int payload_bytes,
- int grh_present,
- int immediate_present,
+void ib_ud_header_init(int payload_bytes,
+ int lrh_present,
+ int eth_present,
+ int grh_present,
+ int immediate_present,
struct ib_ud_header *header);
int ib_ud_header_pack(struct ib_ud_header *header,