Commit 10651db7 authored by Ursula Braun's avatar Ursula Braun Committed by David S. Miller

qeth: tagging with VLAN-ID 0

This patch adapts qeth to handle tagged frames with VLAN-ID 0 and
with or without priority information in the tag. It enables qeth to
receive priority-tagged frames on a base interface, for example from
z/OS, without configuring an additional VLAN interface.
Signed-off-by: default avatarUrsula Braun <ursula.braun@de.ibm.com>
Signed-off-by: default avatarFrank Blaschka <frank.blaschka@de.ibm.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent a069ec91
...@@ -310,6 +310,8 @@ static void qeth_l2_vlan_rx_add_vid(struct net_device *dev, unsigned short vid) ...@@ -310,6 +310,8 @@ static void qeth_l2_vlan_rx_add_vid(struct net_device *dev, unsigned short vid)
struct qeth_vlan_vid *id; struct qeth_vlan_vid *id;
QETH_CARD_TEXT_(card, 4, "aid:%d", vid); QETH_CARD_TEXT_(card, 4, "aid:%d", vid);
if (!vid)
return;
if (card->info.type == QETH_CARD_TYPE_OSM) { if (card->info.type == QETH_CARD_TYPE_OSM) {
QETH_CARD_TEXT(card, 3, "aidOSM"); QETH_CARD_TEXT(card, 3, "aidOSM");
return; return;
......
...@@ -2013,13 +2013,14 @@ static void qeth_l3_vlan_rx_kill_vid(struct net_device *dev, unsigned short vid) ...@@ -2013,13 +2013,14 @@ static void qeth_l3_vlan_rx_kill_vid(struct net_device *dev, unsigned short vid)
qeth_l3_set_multicast_list(card->dev); qeth_l3_set_multicast_list(card->dev);
} }
static inline __u16 qeth_l3_rebuild_skb(struct qeth_card *card, static inline int qeth_l3_rebuild_skb(struct qeth_card *card,
struct sk_buff *skb, struct qeth_hdr *hdr) struct sk_buff *skb, struct qeth_hdr *hdr,
unsigned short *vlan_id)
{ {
unsigned short vlan_id = 0;
__be16 prot; __be16 prot;
struct iphdr *ip_hdr; struct iphdr *ip_hdr;
unsigned char tg_addr[MAX_ADDR_LEN]; unsigned char tg_addr[MAX_ADDR_LEN];
int is_vlan = 0;
if (!(hdr->hdr.l3.flags & QETH_HDR_PASSTHRU)) { if (!(hdr->hdr.l3.flags & QETH_HDR_PASSTHRU)) {
prot = htons((hdr->hdr.l3.flags & QETH_HDR_IPV6)? ETH_P_IPV6 : prot = htons((hdr->hdr.l3.flags & QETH_HDR_IPV6)? ETH_P_IPV6 :
...@@ -2082,8 +2083,9 @@ static inline __u16 qeth_l3_rebuild_skb(struct qeth_card *card, ...@@ -2082,8 +2083,9 @@ static inline __u16 qeth_l3_rebuild_skb(struct qeth_card *card,
if (hdr->hdr.l3.ext_flags & if (hdr->hdr.l3.ext_flags &
(QETH_HDR_EXT_VLAN_FRAME | QETH_HDR_EXT_INCLUDE_VLAN_TAG)) { (QETH_HDR_EXT_VLAN_FRAME | QETH_HDR_EXT_INCLUDE_VLAN_TAG)) {
vlan_id = (hdr->hdr.l3.ext_flags & QETH_HDR_EXT_VLAN_FRAME)? *vlan_id = (hdr->hdr.l3.ext_flags & QETH_HDR_EXT_VLAN_FRAME) ?
hdr->hdr.l3.vlan_id : *((u16 *)&hdr->hdr.l3.dest_addr[12]); hdr->hdr.l3.vlan_id : *((u16 *)&hdr->hdr.l3.dest_addr[12]);
is_vlan = 1;
} }
switch (card->options.checksum_type) { switch (card->options.checksum_type) {
...@@ -2104,7 +2106,7 @@ static inline __u16 qeth_l3_rebuild_skb(struct qeth_card *card, ...@@ -2104,7 +2106,7 @@ static inline __u16 qeth_l3_rebuild_skb(struct qeth_card *card,
skb->ip_summed = CHECKSUM_NONE; skb->ip_summed = CHECKSUM_NONE;
} }
return vlan_id; return is_vlan;
} }
static int qeth_l3_process_inbound_buffer(struct qeth_card *card, static int qeth_l3_process_inbound_buffer(struct qeth_card *card,
...@@ -2114,6 +2116,7 @@ static int qeth_l3_process_inbound_buffer(struct qeth_card *card, ...@@ -2114,6 +2116,7 @@ static int qeth_l3_process_inbound_buffer(struct qeth_card *card,
struct sk_buff *skb; struct sk_buff *skb;
struct qeth_hdr *hdr; struct qeth_hdr *hdr;
__u16 vlan_tag = 0; __u16 vlan_tag = 0;
int is_vlan;
unsigned int len; unsigned int len;
*done = 0; *done = 0;
...@@ -2129,16 +2132,12 @@ static int qeth_l3_process_inbound_buffer(struct qeth_card *card, ...@@ -2129,16 +2132,12 @@ static int qeth_l3_process_inbound_buffer(struct qeth_card *card,
skb->dev = card->dev; skb->dev = card->dev;
switch (hdr->hdr.l3.id) { switch (hdr->hdr.l3.id) {
case QETH_HEADER_TYPE_LAYER3: case QETH_HEADER_TYPE_LAYER3:
vlan_tag = qeth_l3_rebuild_skb(card, skb, hdr); is_vlan = qeth_l3_rebuild_skb(card, skb, hdr,
&vlan_tag);
len = skb->len; len = skb->len;
if (vlan_tag && !card->options.sniffer) if (is_vlan && !card->options.sniffer)
if (card->vlangrp) vlan_gro_receive(&card->napi, card->vlangrp,
vlan_gro_receive(&card->napi, vlan_tag, skb);
card->vlangrp, vlan_tag, skb);
else {
dev_kfree_skb_any(skb);
continue;
}
else else
napi_gro_receive(&card->napi, skb); napi_gro_receive(&card->napi, skb);
break; break;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment