diff options
author | Stephen Hemminger <shemminger@vyatta.com> | 2009-06-17 03:30:39 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-06-17 21:49:47 -0400 |
commit | 37e5a2439b43bb90655e17f00c9db5759909a712 (patch) | |
tree | 386ec6f2f8ed5475362166cfcd565eb03cc0ef11 /drivers/net/sky2.c | |
parent | bd1c6869f14f88aa82587ff51303e72dc7eec30e (diff) |
sky2: add GRO support
Add support for generic receive offload.
Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/sky2.c')
-rw-r--r-- | drivers/net/sky2.c | 29 |
1 files changed, 21 insertions, 8 deletions
diff --git a/drivers/net/sky2.c b/drivers/net/sky2.c index 4f2afc770f8f..d2112e6258e6 100644 --- a/drivers/net/sky2.c +++ b/drivers/net/sky2.c | |||
@@ -2373,6 +2373,26 @@ static inline void sky2_tx_done(struct net_device *dev, u16 last) | |||
2373 | } | 2373 | } |
2374 | } | 2374 | } |
2375 | 2375 | ||
2376 | static inline void sky2_skb_rx(const struct sky2_port *sky2, | ||
2377 | u32 status, struct sk_buff *skb) | ||
2378 | { | ||
2379 | #ifdef SKY2_VLAN_TAG_USED | ||
2380 | u16 vlan_tag = be16_to_cpu(sky2->rx_tag); | ||
2381 | if (sky2->vlgrp && (status & GMR_FS_VLAN)) { | ||
2382 | if (skb->ip_summed == CHECKSUM_NONE) | ||
2383 | vlan_hwaccel_receive_skb(skb, sky2->vlgrp, vlan_tag); | ||
2384 | else | ||
2385 | vlan_gro_receive(&sky2->hw->napi, sky2->vlgrp, | ||
2386 | vlan_tag, skb); | ||
2387 | return; | ||
2388 | } | ||
2389 | #endif | ||
2390 | if (skb->ip_summed == CHECKSUM_NONE) | ||
2391 | netif_receive_skb(skb); | ||
2392 | else | ||
2393 | napi_gro_receive(&sky2->hw->napi, skb); | ||
2394 | } | ||
2395 | |||
2376 | static inline void sky2_rx_done(struct sky2_hw *hw, unsigned port, | 2396 | static inline void sky2_rx_done(struct sky2_hw *hw, unsigned port, |
2377 | unsigned packets, unsigned bytes) | 2397 | unsigned packets, unsigned bytes) |
2378 | { | 2398 | { |
@@ -2438,14 +2458,7 @@ static int sky2_status_intr(struct sky2_hw *hw, int to_do, u16 idx) | |||
2438 | 2458 | ||
2439 | skb->protocol = eth_type_trans(skb, dev); | 2459 | skb->protocol = eth_type_trans(skb, dev); |
2440 | 2460 | ||
2441 | #ifdef SKY2_VLAN_TAG_USED | 2461 | sky2_skb_rx(sky2, status, skb); |
2442 | if (sky2->vlgrp && (status & GMR_FS_VLAN)) { | ||
2443 | vlan_hwaccel_receive_skb(skb, | ||
2444 | sky2->vlgrp, | ||
2445 | be16_to_cpu(sky2->rx_tag)); | ||
2446 | } else | ||
2447 | #endif | ||
2448 | netif_receive_skb(skb); | ||
2449 | 2462 | ||
2450 | /* Stop after net poll weight */ | 2463 | /* Stop after net poll weight */ |
2451 | if (++work_done >= to_do) | 2464 | if (++work_done >= to_do) |