diff options
author | Patrick McHardy <kaber@trash.net> | 2013-04-18 22:04:31 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2013-04-19 14:46:06 -0400 |
commit | 8ad227ff89a7e6f05d07cd0acfd95ed3a24450ca (patch) | |
tree | 90cb532df2523a011e47844434cc423664441d71 /net/8021q/vlan.h | |
parent | 86a9bad3ab6b6f858fd4443b48738cabbb6d094c (diff) |
net: vlan: add 802.1ad support
Add support for 802.1ad VLAN devices. This mainly consists of checking for
ETH_P_8021AD in addition to ETH_P_8021Q in a couple of places and check
offloading capabilities based on the used protocol.
Configuration is done using "ip link":
# ip link add link eth0 eth0.1000 \
type vlan proto 802.1ad id 1000
# ip link add link eth0.1000 eth0.1000.1000 \
type vlan proto 802.1q id 1000
52:54:00:12:34:56 > 92:b1:54:28:e4:8c, ethertype 802.1Q (0x8100), length 106: vlan 1000, p 0, ethertype 802.1Q, vlan 1000, p 0, ethertype IPv4, (tos 0x0, ttl 64, id 0, offset 0, flags [DF], proto ICMP (1), length 84)
20.1.0.2 > 20.1.0.1: ICMP echo request, id 3003, seq 8, length 64
92:b1:54:28:e4:8c > 52:54:00:12:34:56, ethertype 802.1Q-QinQ (0x88a8), length 106: vlan 1000, p 0, ethertype 802.1Q, vlan 1000, p 0, ethertype IPv4, (tos 0x0, ttl 64, id 47944, offset 0, flags [none], proto ICMP (1), length 84)
20.1.0.1 > 20.1.0.2: ICMP echo reply, id 3003, seq 8, length 64
Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/8021q/vlan.h')
-rw-r--r-- | net/8021q/vlan.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/net/8021q/vlan.h b/net/8021q/vlan.h index 245de9653db0..abc9cb631c47 100644 --- a/net/8021q/vlan.h +++ b/net/8021q/vlan.h | |||
@@ -91,6 +91,7 @@ static inline struct vlan_dev_priv *vlan_dev_priv(const struct net_device *dev) | |||
91 | 91 | ||
92 | enum vlan_protos { | 92 | enum vlan_protos { |
93 | VLAN_PROTO_8021Q = 0, | 93 | VLAN_PROTO_8021Q = 0, |
94 | VLAN_PROTO_8021AD, | ||
94 | VLAN_PROTO_NUM, | 95 | VLAN_PROTO_NUM, |
95 | }; | 96 | }; |
96 | 97 | ||
@@ -116,6 +117,8 @@ static inline unsigned int vlan_proto_idx(__be16 proto) | |||
116 | switch (proto) { | 117 | switch (proto) { |
117 | case __constant_htons(ETH_P_8021Q): | 118 | case __constant_htons(ETH_P_8021Q): |
118 | return VLAN_PROTO_8021Q; | 119 | return VLAN_PROTO_8021Q; |
120 | case __constant_htons(ETH_P_8021AD): | ||
121 | return VLAN_PROTO_8021AD; | ||
119 | default: | 122 | default: |
120 | BUG(); | 123 | BUG(); |
121 | } | 124 | } |