diff mbox

[8/9] sky2: add GRO support

Message ID 20090617173140.297221387@vyatta.com
State Accepted, archived
Delegated to: David Miller
Headers show

Commit Message

stephen hemminger June 17, 2009, 5:30 p.m. UTC
Add support for generic receive offload.

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>

Comments

David Miller June 18, 2009, 1:52 a.m. UTC | #1
From: Stephen Hemminger <shemminger@vyatta.com>
Date: Wed, 17 Jun 2009 10:30:39 -0700

> Add support for generic receive offload.
> 
> Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>

This patch was hand edited in some way, as if you took hunks from a
*.rej file and directly copied them into the source yet did not remove
the leading spaces that are added to *.rej files by patch.

So there were a ton of "space before tab" errors emmited by GIT.  I
fixed these up for you.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

--- a/drivers/net/sky2.c	2009-06-17 10:29:58.250810500 -0700
+++ b/drivers/net/sky2.c	2009-06-17 10:29:59.249757381 -0700
@@ -2373,6 +2373,26 @@  static inline void sky2_tx_done(struct n
 	}
 }
 
+static inline void sky2_skb_rx(const struct sky2_port *sky2,
+ 			       u32 status, struct sk_buff *skb)
+{
+#ifdef SKY2_VLAN_TAG_USED
+	u16 vlan_tag = be16_to_cpu(sky2->rx_tag);
+	if (sky2->vlgrp && (status & GMR_FS_VLAN)) {
+		if (skb->ip_summed == CHECKSUM_NONE)
+			vlan_hwaccel_receive_skb(skb, sky2->vlgrp, vlan_tag);
+		else
+			vlan_gro_receive(&sky2->hw->napi, sky2->vlgrp,
+					 vlan_tag, skb);
+ 		return;
+ 	}
+#endif
+ 	if (skb->ip_summed == CHECKSUM_NONE)
+ 		netif_receive_skb(skb);
+ 	else
+ 		napi_gro_receive(&sky2->hw->napi, skb);
+}
+
 static inline void sky2_rx_done(struct sky2_hw *hw, unsigned port,
 				unsigned packets, unsigned bytes)
 {
@@ -2438,14 +2458,7 @@  static int sky2_status_intr(struct sky2_
 
 			skb->protocol = eth_type_trans(skb, dev);
 
-#ifdef SKY2_VLAN_TAG_USED
-			if (sky2->vlgrp && (status & GMR_FS_VLAN)) {
-				vlan_hwaccel_receive_skb(skb,
-							 sky2->vlgrp,
-							 be16_to_cpu(sky2->rx_tag));
-			} else
-#endif
-				netif_receive_skb(skb);
+			sky2_skb_rx(sky2, status, skb);
 
 			/* Stop after net poll weight */
 			if (++work_done >= to_do)