public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: Eric Dumazet <eric.dumazet@gmail.com>
To: David Miller <davem@davemloft.net>
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
Subject: [PATCH] ethtool: change ethtool_set_gro() to use ethtool_op_get_rx_csum
Date: Thu, 16 Sep 2010 10:11:03 +0200	[thread overview]
Message-ID: <1284624663.3352.9.camel@edumazet-laptop> (raw)
In-Reply-To: <1284619376.2462.95.camel@edumazet-laptop>

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 <shemminger@vyatta.com>
> > 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 <eric.dumazet@gmail.com>
---
 net/core/ethtool.c |    7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

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



  reply	other threads:[~2010-09-16  8:11 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-09-15  1:50 [PATCH] ixgbe: add GRO to vlan_features Brandon Philips
2010-09-15  4:35 ` David Miller
2010-09-15 16:37   ` [PATCH] vlan: enable GRO if real_dev supports it Brandon Philips
2010-09-15 17:08     ` Eric Dumazet
2010-09-15 17:14       ` David Miller
2010-09-15 17:24         ` Ben Hutchings
2010-09-15 17:29           ` David Miller
2010-09-15 19:24           ` [PATCH] net: enable GRO by default for vlan devices Brandon Philips
2010-09-15 22:03             ` Eric Dumazet
2010-09-15 22:28               ` Eric Dumazet
2010-09-16  1:16                 ` Stephen Hemminger
2010-09-16  5:51                   ` [E1000-devel] " David Miller
2010-09-16  6:21                     ` Stephen Hemminger
2010-09-16  6:38                       ` David Miller
2010-09-16  6:42                         ` Eric Dumazet
2010-09-16  8:11                           ` Eric Dumazet [this message]
2010-09-17 18:57                             ` [PATCH] ethtool: change ethtool_set_gro() to use ethtool_op_get_rx_csum David Miller
2010-09-17 19:25                               ` [PATCH] bonding: enable gro by default Eric Dumazet
2010-09-17 23:54                                 ` David Miller
2010-09-16  5:32               ` [PATCH] net: enable GRO by default for vlan devices David Miller
2010-09-15 18:59       ` [PATCH] vlan: enable GRO if real_dev supports it Brandon Philips
2010-09-15 16:38   ` [PATCH] ixgbe: add GRO to vlan_features Brandon Philips

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1284624663.3352.9.camel@edumazet-laptop \
    --to=eric.dumazet@gmail.com \
    --cc=bhutchings@solarflare.com \
    --cc=bphilips@suse.de \
    --cc=bruce.w.allan@intel.com \
    --cc=davem@davemloft.net \
    --cc=e1000-devel@lists.sourceforge.net \
    --cc=jeffrey.t.kirsher@intel.com \
    --cc=jesse.brandeburg@intel.com \
    --cc=john.ronciak@intel.com \
    --cc=netdev@vger.kernel.org \
    --cc=shemminger@vyatta.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox