diff options
author | Eli Cohen <eli@dev.mellanox.co.il> | 2010-08-26 10:17:56 -0400 |
---|---|---|
committer | Roland Dreier <rolandd@cisco.com> | 2010-10-14 15:41:29 -0400 |
commit | ff7f5aab354dee01f29c9c00933f6d4aa590eadb (patch) | |
tree | c6f4075f712808ba76927224fac2960f4c5353ec /include/rdma | |
parent | 3c86aa70bf677a31b71c8292e349242e26cbc743 (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.h | 30 |
1 files changed, 22 insertions, 8 deletions
diff --git a/include/rdma/ib_pack.h b/include/rdma/ib_pack.h index cbb50f4da3dd..6b91d8e7a1fa 100644 --- a/include/rdma/ib_pack.h +++ b/include/rdma/ib_pack.h | |||
@@ -37,6 +37,7 @@ | |||
37 | 37 | ||
38 | enum { | 38 | enum { |
39 | IB_LRH_BYTES = 8, | 39 | IB_LRH_BYTES = 8, |
40 | IB_ETH_BYTES = 14, | ||
40 | IB_GRH_BYTES = 40, | 41 | IB_GRH_BYTES = 40, |
41 | IB_BTH_BYTES = 12, | 42 | IB_BTH_BYTES = 12, |
42 | IB_DETH_BYTES = 8 | 43 | IB_DETH_BYTES = 8 |
@@ -210,14 +211,25 @@ struct ib_unpacked_deth { | |||
210 | __be32 source_qpn; | 211 | __be32 source_qpn; |
211 | }; | 212 | }; |
212 | 213 | ||
214 | struct ib_unpacked_eth { | ||
215 | u8 dmac_h[4]; | ||
216 | u8 dmac_l[2]; | ||
217 | u8 smac_h[2]; | ||
218 | u8 smac_l[4]; | ||
219 | __be16 type; | ||
220 | }; | ||
221 | |||
213 | struct ib_ud_header { | 222 | struct ib_ud_header { |
223 | int lrh_present; | ||
214 | struct ib_unpacked_lrh lrh; | 224 | struct ib_unpacked_lrh lrh; |
215 | int grh_present; | 225 | int eth_present; |
216 | struct ib_unpacked_grh grh; | 226 | struct ib_unpacked_eth eth; |
217 | struct ib_unpacked_bth bth; | 227 | int grh_present; |
228 | struct ib_unpacked_grh grh; | ||
229 | struct ib_unpacked_bth bth; | ||
218 | struct ib_unpacked_deth deth; | 230 | struct ib_unpacked_deth deth; |
219 | int immediate_present; | 231 | int immediate_present; |
220 | __be32 immediate_data; | 232 | __be32 immediate_data; |
221 | }; | 233 | }; |
222 | 234 | ||
223 | void ib_pack(const struct ib_field *desc, | 235 | void ib_pack(const struct ib_field *desc, |
@@ -230,9 +242,11 @@ void ib_unpack(const struct ib_field *desc, | |||
230 | void *buf, | 242 | void *buf, |
231 | void *structure); | 243 | void *structure); |
232 | 244 | ||
233 | void ib_ud_header_init(int payload_bytes, | 245 | void ib_ud_header_init(int payload_bytes, |
234 | int grh_present, | 246 | int lrh_present, |
235 | int immediate_present, | 247 | int eth_present, |
248 | int grh_present, | ||
249 | int immediate_present, | ||
236 | struct ib_ud_header *header); | 250 | struct ib_ud_header *header); |
237 | 251 | ||
238 | int ib_ud_header_pack(struct ib_ud_header *header, | 252 | int ib_ud_header_pack(struct ib_ud_header *header, |