netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] [NIU] VLAN does not work with niu driver
@ 2009-10-13  5:41 Joyce Yu
  2009-10-13  6:22 ` David Miller
  0 siblings, 1 reply; 22+ messages in thread
From: Joyce Yu @ 2009-10-13  5:41 UTC (permalink / raw)
  To: netdev

 From 0bb77e878758bd72051577bcc568e2b95c87c203 Mon Sep 17 00:00:00 2001
From: Joyce Yu <joyce.yu@sun.com>
Date: Mon, 12 Oct 2009 11:03:54 -0700
Subject: [PATCH] VLAN does not work with niu driver
Signed-off-by: Joyce Yu <joyce.yu@sun.com>

---
 drivers/net/niu.c |   11 ++++++++++-
 1 files changed, 10 insertions(+), 1 deletions(-)

diff --git a/drivers/net/niu.c b/drivers/net/niu.c
index f9364d0..9559e42 100644
--- a/drivers/net/niu.c
+++ b/drivers/net/niu.c
@@ -3480,6 +3480,7 @@ static int niu_process_rx_pkt(struct napi_struct 
*napi, struct niu *np,
        unsigned int index = rp->rcr_index;
        struct sk_buff *skb;
        int len, num_rcr;
+       struct vlan_ethhdr *veth;

        skb = netdev_alloc_skb(np->dev, RX_SKB_ALLOC_SIZE);
        if (unlikely(!skb))
@@ -3545,7 +3546,15 @@ static int niu_process_rx_pkt(struct napi_struct 
*napi, struct niu *np,
        rp->rcr_index = index;

        skb_reserve(skb, NET_IP_ALIGN);
-       __pskb_pull_tail(skb, min(len, NIU_RXPULL_MAX));
+       __pskb_pull_tail(skb, min(len, VLAN_ETH_HLEN));
+
+       veth = (struct vlan_ethhdr *)skb->data;
+       if (veth->h_vlan_proto != __constant_htons(ETH_P_8021Q)) {
+               skb->tail -= 4;
+               skb->data_len += 4;
+               skb_shinfo(skb)->frags[0].page_offset -= 4;
+               skb_shinfo(skb)->frags[0].size += 4;
+       }

        rp->rx_packets++;
        rp->rx_bytes += skb->len;
--
1.6.4

-- 



^ permalink raw reply related	[flat|nested] 22+ messages in thread
* [PATCH] [NIU] VLAN does not work with niu driver
@ 2009-10-21 18:02 Joyce Yu
  2009-10-21 23:09 ` David Miller
  0 siblings, 1 reply; 22+ messages in thread
From: Joyce Yu @ 2009-10-21 18:02 UTC (permalink / raw)
  To: netdev

[-- Attachment #1: Type: text/plain, Size: 6 bytes --]


-- 


[-- Attachment #2: 0001-VLAN_ETH_HLEN-should-be-used-to-make-sure-that-the-w.patch --]
[-- Type: text/x-patch, Size: 858 bytes --]

>From f301748d3156437d65305f14288c7d5711861980 Mon Sep 17 00:00:00 2001
From: Joyce Yu <joyce.yu@sun.com>
Date: Wed, 21 Oct 2009 05:35:46 -0700
Subject: [PATCH] VLAN_ETH_HLEN should be used to make sure that the whole MAC header was copied to the head buffer in the Vlan packets case
Signed-off-by: Joyce Yu <joyce.yu@sun.com>

---
 drivers/net/niu.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/net/niu.c b/drivers/net/niu.c
index f9364d0..d6c7ac6 100644
--- a/drivers/net/niu.c
+++ b/drivers/net/niu.c
@@ -3545,7 +3545,7 @@ static int niu_process_rx_pkt(struct napi_struct *napi, struct niu *np,
 	rp->rcr_index = index;
 
 	skb_reserve(skb, NET_IP_ALIGN);
-	__pskb_pull_tail(skb, min(len, NIU_RXPULL_MAX));
+	__pskb_pull_tail(skb, min(len, VLAN_ETH_HLEN));
 
 	rp->rx_packets++;
 	rp->rx_bytes += skb->len;
-- 
1.6.4


^ permalink raw reply related	[flat|nested] 22+ messages in thread
* [PATCH] [NIU] VLAN does not work with niu driver
@ 2009-10-15 19:16 Joyce Yu
  0 siblings, 0 replies; 22+ messages in thread
From: Joyce Yu @ 2009-10-15 19:16 UTC (permalink / raw)
  To: netdev

[-- Attachment #1: Type: text/plain, Size: 6 bytes --]


-- 


[-- Attachment #2: 0001-VLAN-does-not-work-with-niu-driver.patch --]
[-- Type: text/x-patch, Size: 727 bytes --]

>From eb878a6887fed77e6b4c69a014a2c98ea2b52736 Mon Sep 17 00:00:00 2001
From: Joyce Yu <joyce.yu@sun.com>
Date: Thu, 15 Oct 2009 06:49:29 -0700
Subject: [PATCH] VLAN does not work with niu driver

---
 drivers/net/niu.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/net/niu.c b/drivers/net/niu.c
index f9364d0..d6c7ac6 100644
--- a/drivers/net/niu.c
+++ b/drivers/net/niu.c
@@ -3545,7 +3545,7 @@ static int niu_process_rx_pkt(struct napi_struct *napi, struct niu *np,
 	rp->rcr_index = index;
 
 	skb_reserve(skb, NET_IP_ALIGN);
-	__pskb_pull_tail(skb, min(len, NIU_RXPULL_MAX));
+	__pskb_pull_tail(skb, min(len, VLAN_ETH_HLEN));
 
 	rp->rx_packets++;
 	rp->rx_bytes += skb->len;
-- 
1.6.4


^ permalink raw reply related	[flat|nested] 22+ messages in thread
* [PATCH] [NIU] VLAN does not work with niu driver
@ 2009-10-13 21:27 Joyce Yu
  2009-10-13 22:12 ` David Miller
  2009-10-20  0:28 ` David Miller
  0 siblings, 2 replies; 22+ messages in thread
From: Joyce Yu @ 2009-10-13 21:27 UTC (permalink / raw)
  To: netdev

[-- Attachment #1: Type: text/plain, Size: 6 bytes --]


-- 


[-- Attachment #2: 0001-VLAN-does-not-work-with-niu-driver.patch --]
[-- Type: text/x-patch, Size: 1257 bytes --]

>From 0bb77e878758bd72051577bcc568e2b95c87c203 Mon Sep 17 00:00:00 2001
From: Joyce Yu <joyce.yu@sun.com>
Date: Mon, 12 Oct 2009 11:03:54 -0700
Subject: [PATCH] VLAN does not work with niu driver

---
 drivers/net/niu.c |   11 ++++++++++-
 1 files changed, 10 insertions(+), 1 deletions(-)

diff --git a/drivers/net/niu.c b/drivers/net/niu.c
index f9364d0..9559e42 100644
--- a/drivers/net/niu.c
+++ b/drivers/net/niu.c
@@ -3480,6 +3480,7 @@ static int niu_process_rx_pkt(struct napi_struct *napi, struct niu *np,
 	unsigned int index = rp->rcr_index;
 	struct sk_buff *skb;
 	int len, num_rcr;
+	struct vlan_ethhdr *veth;
 
 	skb = netdev_alloc_skb(np->dev, RX_SKB_ALLOC_SIZE);
 	if (unlikely(!skb))
@@ -3545,7 +3546,15 @@ static int niu_process_rx_pkt(struct napi_struct *napi, struct niu *np,
 	rp->rcr_index = index;
 
 	skb_reserve(skb, NET_IP_ALIGN);
-	__pskb_pull_tail(skb, min(len, NIU_RXPULL_MAX));
+	__pskb_pull_tail(skb, min(len, VLAN_ETH_HLEN));
+
+	veth = (struct vlan_ethhdr *)skb->data;
+	if (veth->h_vlan_proto != __constant_htons(ETH_P_8021Q)) {
+		skb->tail -= 4;
+		skb->data_len += 4;
+		skb_shinfo(skb)->frags[0].page_offset -= 4;
+		skb_shinfo(skb)->frags[0].size += 4;
+	}
 
 	rp->rx_packets++;
 	rp->rx_bytes += skb->len;
-- 
1.6.4


^ permalink raw reply related	[flat|nested] 22+ messages in thread
* [PATCH] [NIU] VLAN does not work with niu driver
@ 2009-10-12 23:26 Joyce Yu
  2009-10-12 23:52 ` David Miller
  0 siblings, 1 reply; 22+ messages in thread
From: Joyce Yu @ 2009-10-12 23:26 UTC (permalink / raw)
  To: netdev

From: Joyce Yu <joyce.yu@sun.com>
Date: Mon, 12 Oct 2009 11:03:54 -0700
Subject: [PATCH] VLAN does not work with niu driver
Signed-off-by: Joyce Yu <joyce.yu@sun.com>

---
 drivers/net/niu.c |   11 ++++++++++-
 1 files changed, 10 insertions(+), 1 deletions(-)

diff --git a/drivers/net/niu.c b/drivers/net/niu.c
index f9364d0..9559e42 100644
--- a/drivers/net/niu.c
+++ b/drivers/net/niu.c
@@ -3480,6 +3480,7 @@ static int niu_process_rx_pkt(struct napi_struct 
*napi, struct niu *np,
        unsigned int index = rp->rcr_index;
        struct sk_buff *skb;
        int len, num_rcr;
+       struct vlan_ethhdr *veth;

        skb = netdev_alloc_skb(np->dev, RX_SKB_ALLOC_SIZE);
        if (unlikely(!skb))
@@ -3545,7 +3546,15 @@ static int niu_process_rx_pkt(struct napi_struct 
*napi, struct niu *np,
        rp->rcr_index = index;

        skb_reserve(skb, NET_IP_ALIGN);
-       __pskb_pull_tail(skb, min(len, NIU_RXPULL_MAX));
+       __pskb_pull_tail(skb, min(len, VLAN_ETH_HLEN));
+
+       veth = (struct vlan_ethhdr *)skb->data;
+       if (veth->h_vlan_proto != __constant_htons(ETH_P_8021Q)) {
+               skb->tail -= 4;
+               skb->data_len += 4;
+               skb_shinfo(skb)->frags[0].page_offset -= 4;
+               skb_shinfo(skb)->frags[0].size += 4;
+       }

        rp->rx_packets++;
        rp->rx_bytes += skb->len;
--
1.6.4

-- 



^ permalink raw reply related	[flat|nested] 22+ messages in thread
* [PATCH] [NIU] VLAN does not work with niu driver
@ 2009-09-09 21:10 Joyce Yu
  2009-09-09 21:35 ` Stephen Hemminger
  2009-09-10  0:15 ` David Miller
  0 siblings, 2 replies; 22+ messages in thread
From: Joyce Yu @ 2009-09-09 21:10 UTC (permalink / raw)
  To: netdev

From: Joyce Yu <joyce.yu@sun.com>
Date: Wed, 9 Sep 2009 08:43:00 -0700
Subject: [PATCH] VLAN does not work with niu driver
 Signed-off-by: Joyce Yu <joyce.yu@sun.com>

---
 drivers/net/niu.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/net/niu.h b/drivers/net/niu.h
index 3bd0b59..35678db 100644
--- a/drivers/net/niu.h
+++ b/drivers/net/niu.h
@@ -2700,7 +2700,7 @@ struct fcram_hash_ipv6 {
 #define RCR_PKT_TYPE_UDP               0x2
 #define RCR_PKT_TYPE_SCTP              0x3

-#define NIU_RXPULL_MAX                 ETH_HLEN
+#define NIU_RXPULL_MAX                 64

 struct rx_pkt_hdr0 {
 #if defined(__LITTLE_ENDIAN_BITFIELD)
--
1.6.4

-- 



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

end of thread, other threads:[~2009-10-22  0:19 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-10-13  5:41 [PATCH] [NIU] VLAN does not work with niu driver Joyce Yu
2009-10-13  6:22 ` David Miller
  -- strict thread matches above, loose matches on Subject: below --
2009-10-21 18:02 Joyce Yu
2009-10-21 23:09 ` David Miller
2009-10-21 23:28   ` Joyce Yu
2009-10-22  0:19     ` David Miller
2009-10-15 19:16 Joyce Yu
2009-10-13 21:27 Joyce Yu
2009-10-13 22:12 ` David Miller
2009-10-20  0:28 ` David Miller
2009-10-12 23:26 Joyce Yu
2009-10-12 23:52 ` David Miller
2009-09-09 21:10 Joyce Yu
2009-09-09 21:35 ` Stephen Hemminger
2009-09-10  0:16   ` David Miller
2009-09-10  0:15 ` David Miller
2009-09-10  1:01   ` Matheos Worku
2009-09-10  1:10     ` David Miller
2009-09-10  1:19       ` Matheos Worku
2009-09-10  1:44         ` David Miller
2009-09-10  1:48           ` Matheos Worku
2009-09-10 16:35         ` Rick Jones

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).