netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch 0/1] s390: qeth patch for net-next
@ 2010-10-01 12:51 frank.blaschka
  2010-10-01 12:51 ` [patch 1/1] [PATCH] qeth: tagging with VLAN-ID 0 frank.blaschka
  0 siblings, 1 reply; 4+ messages in thread
From: frank.blaschka @ 2010-10-01 12:51 UTC (permalink / raw)
  To: davem; +Cc: netdev, linux-s390

Hi Dave,

here is one more qeth patch for net-next.

shortlog:
Ursula Braun (1)
qeth: tagging with VLAN-ID 0

Thanks,
        Frank

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [patch 1/1] [PATCH] qeth: tagging with VLAN-ID 0
  2010-10-01 12:51 [patch 0/1] s390: qeth patch for net-next frank.blaschka
@ 2010-10-01 12:51 ` frank.blaschka
  2010-10-04  5:08   ` David Miller
  0 siblings, 1 reply; 4+ messages in thread
From: frank.blaschka @ 2010-10-01 12:51 UTC (permalink / raw)
  To: davem; +Cc: netdev, linux-s390, Ursula Braun

[-- Attachment #1: vlan0.patch --]
[-- Type: text/plain, Size: 3098 bytes --]

From: Ursula Braun <ursula.braun@de.ibm.com>

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>
---
 drivers/s390/net/qeth_l2_main.c |    2 ++
 drivers/s390/net/qeth_l3_main.c |   27 +++++++++++++--------------
 2 files changed, 15 insertions(+), 14 deletions(-)

--- 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(stru
 	struct qeth_vlan_vid *id;
 
 	QETH_CARD_TEXT_(card, 4, "aid:%d", vid);
+	if (!vid)
+		return;
 	if (card->info.type == QETH_CARD_TYPE_OSM) {
 		QETH_CARD_TEXT(card, 3, "aidOSM");
 		return;
--- 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(str
 	qeth_l3_set_multicast_list(card->dev);
 }
 
-static inline __u16 qeth_l3_rebuild_skb(struct qeth_card *card,
-			struct sk_buff *skb, struct qeth_hdr *hdr)
+static inline int qeth_l3_rebuild_skb(struct qeth_card *card,
+			struct sk_buff *skb, struct qeth_hdr *hdr,
+			unsigned short *vlan_id)
 {
-	unsigned short vlan_id = 0;
 	__be16 prot;
 	struct iphdr *ip_hdr;
 	unsigned char tg_addr[MAX_ADDR_LEN];
+	int is_vlan = 0;
 
 	if (!(hdr->hdr.l3.flags & QETH_HDR_PASSTHRU)) {
 		prot = htons((hdr->hdr.l3.flags & QETH_HDR_IPV6)? ETH_P_IPV6 :
@@ -2082,8 +2083,9 @@ static inline __u16 qeth_l3_rebuild_skb(
 
 	if (hdr->hdr.l3.ext_flags &
 	    (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]);
+		is_vlan = 1;
 	}
 
 	switch (card->options.checksum_type) {
@@ -2104,7 +2106,7 @@ static inline __u16 qeth_l3_rebuild_skb(
 			skb->ip_summed = CHECKSUM_NONE;
 	}
 
-	return vlan_id;
+	return is_vlan;
 }
 
 static int qeth_l3_process_inbound_buffer(struct qeth_card *card,
@@ -2114,6 +2116,7 @@ static int qeth_l3_process_inbound_buffe
 	struct sk_buff *skb;
 	struct qeth_hdr *hdr;
 	__u16 vlan_tag = 0;
+	int is_vlan;
 	unsigned int len;
 
 	*done = 0;
@@ -2129,16 +2132,12 @@ static int qeth_l3_process_inbound_buffe
 		skb->dev = card->dev;
 		switch (hdr->hdr.l3.id) {
 		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;
-			if (vlan_tag && !card->options.sniffer)
-				if (card->vlangrp)
-					vlan_gro_receive(&card->napi,
-						card->vlangrp, vlan_tag, skb);
-				else {
-					dev_kfree_skb_any(skb);
-					continue;
-				}
+			if (is_vlan && !card->options.sniffer)
+				vlan_gro_receive(&card->napi, card->vlangrp,
+					vlan_tag, skb);
 			else
 				napi_gro_receive(&card->napi, skb);
 			break;


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [patch 1/1] [PATCH] qeth: tagging with VLAN-ID 0
  2010-10-01 12:51 ` [patch 1/1] [PATCH] qeth: tagging with VLAN-ID 0 frank.blaschka
@ 2010-10-04  5:08   ` David Miller
  0 siblings, 0 replies; 4+ messages in thread
From: David Miller @ 2010-10-04  5:08 UTC (permalink / raw)
  To: frank.blaschka; +Cc: netdev, linux-s390, ursula.braun

From: frank.blaschka@de.ibm.com
Date: Fri, 01 Oct 2010 14:51:13 +0200

> From: Ursula Braun <ursula.braun@de.ibm.com>
> 
> 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>

I'll apply this, thanks.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [patch 0/1] s390: qeth patch for net-next
@ 2011-03-14 13:20 frank.blaschka
  0 siblings, 0 replies; 4+ messages in thread
From: frank.blaschka @ 2011-03-14 13:20 UTC (permalink / raw)
  To: davem; +Cc: netdev, linux-s390

Hi Dave,

here is another qeth patch for net-next.

shortlog:
Frank Blaschka (1)
qeth: change some configurations defaults

Thanks,
        Frank


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2011-03-14 13:21 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-10-01 12:51 [patch 0/1] s390: qeth patch for net-next frank.blaschka
2010-10-01 12:51 ` [patch 1/1] [PATCH] qeth: tagging with VLAN-ID 0 frank.blaschka
2010-10-04  5:08   ` David Miller
  -- strict thread matches above, loose matches on Subject: below --
2011-03-14 13:20 [patch 0/1] s390: qeth patch for net-next frank.blaschka

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).