From patchwork Thu Sep 16 08:11:03 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Eric Dumazet X-Patchwork-Id: 64952 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.180.67]) by ozlabs.org (Postfix) with ESMTP id 10C6D1007DD for ; Thu, 16 Sep 2010 18:11:17 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752329Ab0IPILK (ORCPT ); Thu, 16 Sep 2010 04:11:10 -0400 Received: from mail-wy0-f174.google.com ([74.125.82.174]:53884 "EHLO mail-wy0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752085Ab0IPILI (ORCPT ); Thu, 16 Sep 2010 04:11:08 -0400 Received: by wyf22 with SMTP id 22so1093903wyf.19 for ; Thu, 16 Sep 2010 01:11:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:subject:from:to:cc :in-reply-to:references:content-type:date:message-id:mime-version :x-mailer:content-transfer-encoding; bh=zXMm//fS0zusUlRTSA2GQqzOflu3Fmn8tivGxGTI5zI=; b=TUAr9BKwci2DdlaB87UhpdsXrvpqKlT/X/I+JrCYZaKnh203eJC5Ao3gF13NomNQpz G7SmgmLZRSUTVswjbpnVFLcKMaWWloK/fWkjFQSgTcfRtMcbDEVznpmttrVeuFblTZQE GjXetpdeYolRJCwT+BjVlUPksZNNC9gmovT8o= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=subject:from:to:cc:in-reply-to:references:content-type:date :message-id:mime-version:x-mailer:content-transfer-encoding; b=f+kEkT/wQ0DZCivB57WuXkHEZZLuzr9USaHY2xB0netRqf3SrBvj7ZKz6Ci11Dkkzi PkfCxHDBO9SmEfNQVtqyxXTsJbPSrwNcdxpcfly8nzl2YTwjyUBuiuWl2jat4VENiK5H VPV+T7Wl9ddxor+loDQJazU735yll7jwWhS10= Received: by 10.216.159.213 with SMTP id s63mr6291027wek.78.1284624667353; Thu, 16 Sep 2010 01:11:07 -0700 (PDT) Received: from [10.150.51.217] (gw0.net.jmsp.net [212.23.165.14]) by mx.google.com with ESMTPS id n40sm1616652weq.5.2010.09.16.01.11.04 (version=SSLv3 cipher=RC4-MD5); Thu, 16 Sep 2010 01:11:06 -0700 (PDT) Subject: [PATCH] ethtool: change ethtool_set_gro() to use ethtool_op_get_rx_csum From: Eric Dumazet To: David Miller Cc: shemminger@vyatta.com, bphilips@suse.de, e1000-devel@lists.sourceforge.net, bruce.w.allan@intel.com, jesse.brandeburg@intel.com, john.ronciak@intel.com, jeffrey.t.kirsher@intel.com, netdev@vger.kernel.org, bhutchings@solarflare.com In-Reply-To: <1284619376.2462.95.camel@edumazet-laptop> References: <20100915181616.578fcd37@nehalam> <20100915.225146.35823170.davem@davemloft.net> <20100915232125.4430a421@nehalam> <20100915.233851.85414928.davem@davemloft.net> <1284619376.2462.95.camel@edumazet-laptop> Date: Thu, 16 Sep 2010 10:11:03 +0200 Message-ID: <1284624663.3352.9.camel@edumazet-laptop> Mime-Version: 1.0 X-Mailer: Evolution 2.28.3 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Le jeudi 16 septembre 2010 à 08:43 +0200, Eric Dumazet a écrit : > Le mercredi 15 septembre 2010 à 23:38 -0700, David Miller a écrit : > > From: Stephen Hemminger > > Date: Wed, 15 Sep 2010 23:21:25 -0700 > > > > > I think it is more complex than that. GRO is tied to NAPI, > > > and bridge/bond don't use NAPI directly. They use netif_rx() for receiving > > > because layered drivers can't directly up call because of possible > > > issues with stack depth. > > > > > > To get GRO working for netif_rx case, > > > the logic in process_backlog would have to change. > > > But this queue is processing packets from multiple devices so > > > it is not clear if GRO could be used. > > > > Bonding's un-layering on RX is done in the normal netif_receive_skb() > > control flow. > > > > And bridging only uses netif_rx for multicast replication. > > Yes, bonding case should be easy, I'll take a look today. > [PATCH] ethtool: change ethtool_set_gro() to use ethtool_op_get_rx_csum To be able to switch on GRO on a device, ethtool_set_gro() checks this device provides a get_rx_csum() method. Some devices dont provide this method, while they do support RX checksumming. This patch allows bonding to support GRO : ethtool -K bond0 gro on Signed-off-by: Eric Dumazet --- net/core/ethtool.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) -- 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 --git a/net/core/ethtool.c b/net/core/ethtool.c index 7a85367..8c8c6d4 100644 --- a/net/core/ethtool.c +++ b/net/core/ethtool.c @@ -1175,8 +1175,11 @@ static int ethtool_set_gro(struct net_device *dev, char __user *useraddr) return -EFAULT; if (edata.data) { - if (!dev->ethtool_ops->get_rx_csum || - !dev->ethtool_ops->get_rx_csum(dev)) + u32 rxcsum = dev->ethtool_ops->get_rx_csum ? + dev->ethtool_ops->get_rx_csum(dev) : + ethtool_op_get_rx_csum(dev); + + if (!rxcsum) return -EINVAL; dev->features |= NETIF_F_GRO; } else