From patchwork Wed Jun 17 17:30:39 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: stephen hemminger X-Patchwork-Id: 28803 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@bilbo.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from ozlabs.org (ozlabs.org [203.10.76.45]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "mx.ozlabs.org", Issuer "CA Cert Signing Authority" (verified OK)) by bilbo.ozlabs.org (Postfix) with ESMTPS id BE16EB720F for ; Thu, 18 Jun 2009 03:35:46 +1000 (EST) Received: by ozlabs.org (Postfix) id ADA72DDDE1; Thu, 18 Jun 2009 03:35:46 +1000 (EST) Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by ozlabs.org (Postfix) with ESMTP id 4AF5ADDDD4 for ; Thu, 18 Jun 2009 03:35:46 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759427AbZFQReM (ORCPT ); Wed, 17 Jun 2009 13:34:12 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1759503AbZFQReJ (ORCPT ); Wed, 17 Jun 2009 13:34:09 -0400 Received: from suva.vyatta.com ([76.74.103.44]:45312 "EHLO suva.vyatta.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757637AbZFQReD (ORCPT ); Wed, 17 Jun 2009 13:34:03 -0400 Received: from suva.vyatta.com (suva [127.0.0.1]) by suva.vyatta.com (8.13.7/8.13.7) with ESMTP id n5HHY4eW029185; Wed, 17 Jun 2009 10:34:04 -0700 Received: (from shemminger@localhost) by suva.vyatta.com (8.13.7/8.13.7/Submit) id n5HHY4Hq029184; Wed, 17 Jun 2009 10:34:04 -0700 Message-Id: <20090617173140.297221387@vyatta.com> References: <20090617173031.703636683@vyatta.com> User-Agent: quilt/0.46-1 Date: Wed, 17 Jun 2009 10:30:39 -0700 From: Stephen Hemminger To: davem@davemloft.net Cc: netdev@vger.kernel.org Subject: [PATCH 8/9] sky2: add GRO support Content-Disposition: inline; filename=sky2-gro.patch Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Add support for generic receive offload. Signed-off-by: Stephen Hemminger --- 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)