From patchwork Wed Apr 1 21:20:20 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: stephen hemminger X-Patchwork-Id: 25499 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org 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 E5707DDDF9 for ; Thu, 2 Apr 2009 08:41:12 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934700AbZDAVkK (ORCPT ); Wed, 1 Apr 2009 17:40:10 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S934679AbZDAVkI (ORCPT ); Wed, 1 Apr 2009 17:40:08 -0400 Received: from mail.vyatta.com ([76.74.103.46]:41605 "EHLO mail.vyatta.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934683AbZDAVkH (ORCPT ); Wed, 1 Apr 2009 17:40:07 -0400 Received: from localhost (localhost.localdomain [127.0.0.1]) by mail.vyatta.com (Postfix) with ESMTP id BF5DC4F403D; Wed, 1 Apr 2009 14:40:07 -0700 (PDT) X-Virus-Scanned: amavisd-new at tahiti.vyatta.com Received: from mail.vyatta.com ([127.0.0.1]) by localhost (mail.vyatta.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id bFYvy7kNrKBe; Wed, 1 Apr 2009 14:40:03 -0700 (PDT) Received: from nehalam (pool-71-117-208-104.ptldor.fios.verizon.net [71.117.208.104]) by mail.vyatta.com (Postfix) with ESMTP id DE94D4F4226; Wed, 1 Apr 2009 14:40:02 -0700 (PDT) Date: Wed, 1 Apr 2009 14:20:20 -0700 From: Stephen Hemminger To: Herbert Xu , David Miller Cc: netdev@vger.kernel.org Subject: [PATCH 1/2] net: allow multiple dev per napi with GRO Message-ID: <20090401142020.395f51bb@nehalam> Organization: Vyatta X-Mailer: Claws Mail 3.6.1 (GTK+ 2.16.0; x86_64-pc-linux-gnu) Mime-Version: 1.0 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org GRO assumes that there is a one-to-one relationship between NAPI structure and network device. Some devices like sky2 share multiple devices on a single interrupt so only have one NAPI handler. Rather than split GRO from NAPI, just have GRO assume if device changes that it is a different flow. Signed-off-by: Stephen Hemminger --- 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 --- a/net/core/dev.c 2009-04-01 12:02:12.381316147 -0700 +++ b/net/core/dev.c 2009-04-01 12:07:29.718192280 -0700 @@ -2472,8 +2472,9 @@ static int __napi_gro_receive(struct nap return GRO_NORMAL; for (p = napi->gro_list; p; p = p->next) { - NAPI_GRO_CB(p)->same_flow = !compare_ether_header( - skb_mac_header(p), skb_gro_mac_header(skb)); + NAPI_GRO_CB(p)->same_flow = (p->dev == skb->dev) + && !compare_ether_header(skb_mac_header(p), + skb_gro_mac_header(skb)); NAPI_GRO_CB(p)->flush = 0; }