[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-id: <4AD3BB3C.2010805@Sun.COM>
Date: Mon, 12 Oct 2009 16:26:52 -0700
From: Joyce Yu <Joyce.Yu@....COM>
To: netdev@...r.kernel.org
Subject: [PATCH] [NIU] VLAN does not work with niu driver
From: Joyce Yu <joyce.yu@....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@....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
--
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists