aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/s390/net
diff options
context:
space:
mode:
authorUrsula Braun <ursula.braun@de.ibm.com>2010-09-30 22:51:13 -0400
committerDavid S. Miller <davem@davemloft.net>2010-10-04 01:08:42 -0400
commit10651db75a94c54a34bbf85fbee334d1114da3fb (patch)
tree79a641d41ffd541635997fd1bdda9715930b8841 /drivers/s390/net
parenta069ec917457e44e214fc34e50acd185110fa81b (diff)
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: Ursula Braun <ursula.braun@de.ibm.com> Signed-off-by: Frank Blaschka <frank.blaschka@de.ibm.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/s390/net')
-rw-r--r--drivers/s390/net/qeth_l2_main.c2
-rw-r--r--drivers/s390/net/qeth_l3_main.c27
2 files changed, 15 insertions, 14 deletions
diff --git a/drivers/s390/net/qeth_l2_main.c b/drivers/s390/net/qeth_l2_main.c
index 01c3c1f77879..847e8797073c 100644
--- a/drivers/s390/net/qeth_l2_main.c
+++ b/drivers/s390/net/qeth_l2_main.c
@@ -310,6 +310,8 @@ static void qeth_l2_vlan_rx_add_vid(struct net_device *dev, unsigned short vid)
310 struct qeth_vlan_vid *id; 310 struct qeth_vlan_vid *id;
311 311
312 QETH_CARD_TEXT_(card, 4, "aid:%d", vid); 312 QETH_CARD_TEXT_(card, 4, "aid:%d", vid);
313 if (!vid)
314 return;
313 if (card->info.type == QETH_CARD_TYPE_OSM) { 315 if (card->info.type == QETH_CARD_TYPE_OSM) {
314 QETH_CARD_TEXT(card, 3, "aidOSM"); 316 QETH_CARD_TEXT(card, 3, "aidOSM");
315 return; 317 return;
diff --git a/drivers/s390/net/qeth_l3_main.c b/drivers/s390/net/qeth_l3_main.c
index 5b79f573bd93..c094707fcbff 100644
--- a/drivers/s390/net/qeth_l3_main.c
+++ b/drivers/s390/net/qeth_l3_main.c
@@ -2013,13 +2013,14 @@ static void qeth_l3_vlan_rx_kill_vid(struct net_device *dev, unsigned short vid)
2013 qeth_l3_set_multicast_list(card->dev); 2013 qeth_l3_set_multicast_list(card->dev);
2014} 2014}
2015 2015
2016static inline __u16 qeth_l3_rebuild_skb(struct qeth_card *card, 2016static inline int qeth_l3_rebuild_skb(struct qeth_card *card,
2017 struct sk_buff *skb, struct qeth_hdr *hdr) 2017 struct sk_buff *skb, struct qeth_hdr *hdr,
2018 unsigned short *vlan_id)
2018{ 2019{
2019 unsigned short vlan_id = 0;
2020 __be16 prot; 2020 __be16 prot;
2021 struct iphdr *ip_hdr; 2021 struct iphdr *ip_hdr;
2022 unsigned char tg_addr[MAX_ADDR_LEN]; 2022 unsigned char tg_addr[MAX_ADDR_LEN];
2023 int is_vlan = 0;
2023 2024
2024 if (!(hdr->hdr.l3.flags & QETH_HDR_PASSTHRU)) { 2025 if (!(hdr->hdr.l3.flags & QETH_HDR_PASSTHRU)) {
2025 prot = htons((hdr->hdr.l3.flags & QETH_HDR_IPV6)? ETH_P_IPV6 : 2026 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 2083
2083 if (hdr->hdr.l3.ext_flags & 2084 if (hdr->hdr.l3.ext_flags &
2084 (QETH_HDR_EXT_VLAN_FRAME | QETH_HDR_EXT_INCLUDE_VLAN_TAG)) { 2085 (QETH_HDR_EXT_VLAN_FRAME | QETH_HDR_EXT_INCLUDE_VLAN_TAG)) {
2085 vlan_id = (hdr->hdr.l3.ext_flags & QETH_HDR_EXT_VLAN_FRAME)? 2086 *vlan_id = (hdr->hdr.l3.ext_flags & QETH_HDR_EXT_VLAN_FRAME) ?
2086 hdr->hdr.l3.vlan_id : *((u16 *)&hdr->hdr.l3.dest_addr[12]); 2087 hdr->hdr.l3.vlan_id : *((u16 *)&hdr->hdr.l3.dest_addr[12]);
2088 is_vlan = 1;
2087 } 2089 }
2088 2090
2089 switch (card->options.checksum_type) { 2091 switch (card->options.checksum_type) {
@@ -2104,7 +2106,7 @@ static inline __u16 qeth_l3_rebuild_skb(struct qeth_card *card,
2104 skb->ip_summed = CHECKSUM_NONE; 2106 skb->ip_summed = CHECKSUM_NONE;
2105 } 2107 }
2106 2108
2107 return vlan_id; 2109 return is_vlan;
2108} 2110}
2109 2111
2110static int qeth_l3_process_inbound_buffer(struct qeth_card *card, 2112static 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 struct sk_buff *skb; 2116 struct sk_buff *skb;
2115 struct qeth_hdr *hdr; 2117 struct qeth_hdr *hdr;
2116 __u16 vlan_tag = 0; 2118 __u16 vlan_tag = 0;
2119 int is_vlan;
2117 unsigned int len; 2120 unsigned int len;
2118 2121
2119 *done = 0; 2122 *done = 0;
@@ -2129,16 +2132,12 @@ static int qeth_l3_process_inbound_buffer(struct qeth_card *card,
2129 skb->dev = card->dev; 2132 skb->dev = card->dev;
2130 switch (hdr->hdr.l3.id) { 2133 switch (hdr->hdr.l3.id) {
2131 case QETH_HEADER_TYPE_LAYER3: 2134 case QETH_HEADER_TYPE_LAYER3:
2132 vlan_tag = qeth_l3_rebuild_skb(card, skb, hdr); 2135 is_vlan = qeth_l3_rebuild_skb(card, skb, hdr,
2136 &vlan_tag);
2133 len = skb->len; 2137 len = skb->len;
2134 if (vlan_tag && !card->options.sniffer) 2138 if (is_vlan && !card->options.sniffer)
2135 if (card->vlangrp) 2139 vlan_gro_receive(&card->napi, card->vlangrp,
2136 vlan_gro_receive(&card->napi, 2140 vlan_tag, skb);
2137 card->vlangrp, vlan_tag, skb);
2138 else {
2139 dev_kfree_skb_any(skb);
2140 continue;
2141 }
2142 else 2141 else
2143 napi_gro_receive(&card->napi, skb); 2142 napi_gro_receive(&card->napi, skb);
2144 break; 2143 break;