aboutsummaryrefslogtreecommitdiffstats
path: root/include/rdma/ib_pack.h
diff options
context:
space:
mode:
authorEli Cohen <eli@dev.mellanox.co.il>2010-08-26 10:18:59 -0400
committerRoland Dreier <rolandd@cisco.com>2010-10-25 13:20:39 -0400
commitaf7bd463761c6abd8ca8d831f9cc0ac19f3b7d4b (patch)
tree65d997130a892b0da260e308919ed67255a16f77 /include/rdma/ib_pack.h
parentfa417f7b520ee60b39f7e23528d2030af30a07d1 (diff)
IB/core: Add VLAN support for IBoE
Add 802.1q VLAN support to IBoE. The VLAN tag is encoded within the GID derived from a link local address in the following way: GID[11] GID[12] contain the VLAN ID when the GID contains a VLAN. The 3 bits user priority field of the packets are identical to the 3 bits of the SL. In case of rdma_cm apps, the TOS field is used to generate the SL field by doing a shift right of 5 bits effectively taking to 3 MS bits of the TOS field. Signed-off-by: Eli Cohen <eli@mellanox.co.il> Signed-off-by: Roland Dreier <rolandd@cisco.com>
Diffstat (limited to 'include/rdma/ib_pack.h')
-rw-r--r--include/rdma/ib_pack.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/include/rdma/ib_pack.h b/include/rdma/ib_pack.h
index 6b91d8e7a1fa..b37fe3b10a9d 100644
--- a/include/rdma/ib_pack.h
+++ b/include/rdma/ib_pack.h
@@ -38,6 +38,7 @@
38enum { 38enum {
39 IB_LRH_BYTES = 8, 39 IB_LRH_BYTES = 8,
40 IB_ETH_BYTES = 14, 40 IB_ETH_BYTES = 14,
41 IB_VLAN_BYTES = 4,
41 IB_GRH_BYTES = 40, 42 IB_GRH_BYTES = 40,
42 IB_BTH_BYTES = 12, 43 IB_BTH_BYTES = 12,
43 IB_DETH_BYTES = 8 44 IB_DETH_BYTES = 8
@@ -219,11 +220,18 @@ struct ib_unpacked_eth {
219 __be16 type; 220 __be16 type;
220}; 221};
221 222
223struct ib_unpacked_vlan {
224 __be16 tag;
225 __be16 type;
226};
227
222struct ib_ud_header { 228struct ib_ud_header {
223 int lrh_present; 229 int lrh_present;
224 struct ib_unpacked_lrh lrh; 230 struct ib_unpacked_lrh lrh;
225 int eth_present; 231 int eth_present;
226 struct ib_unpacked_eth eth; 232 struct ib_unpacked_eth eth;
233 int vlan_present;
234 struct ib_unpacked_vlan vlan;
227 int grh_present; 235 int grh_present;
228 struct ib_unpacked_grh grh; 236 struct ib_unpacked_grh grh;
229 struct ib_unpacked_bth bth; 237 struct ib_unpacked_bth bth;
@@ -245,6 +253,7 @@ void ib_unpack(const struct ib_field *desc,
245void ib_ud_header_init(int payload_bytes, 253void ib_ud_header_init(int payload_bytes,
246 int lrh_present, 254 int lrh_present,
247 int eth_present, 255 int eth_present,
256 int vlan_present,
248 int grh_present, 257 int grh_present,
249 int immediate_present, 258 int immediate_present,
250 struct ib_ud_header *header); 259 struct ib_ud_header *header);