From: Eric Dumazet <eric.dumazet@gmail.com>
To: "David Miller" <davem@davemloft.net>,
"Michał Mirosław" <mirqus@gmail.com>
Cc: netdev <netdev@vger.kernel.org>,
"Jay Vosburgh" <fubar@us.ibm.com>,
"Maciej Żenczykowski" <maze@google.com>,
"Andy Gospodarek" <andy@greyhouse.net>,
"Tom Herbert" <therbert@google.com>,
"Neal Cardwell" <ncardwell@google.com>,
"Yuchung Cheng" <ycheng@google.com>
Subject: [PATCH v2] bonding: allow TSO being set on bonding master
Date: Thu, 16 May 2013 10:34:53 -0700 [thread overview]
Message-ID: <1368725693.3301.59.camel@edumazet-glaptop> (raw)
In-Reply-To: <1368654065.4519.53.camel@edumazet-glaptop>
From: Eric Dumazet <edumazet@google.com>
In some situations, we need to disable TSO on bonding slaves.
bonding device automatically unset TSO in bond_fix_features(), and
performance is not good because :
1) We consume more cpu cycles.
2) GSO segmentation has some bugs leading to out of order TCP packets
if this segmentation is done before virtual device. This particular
problem will be addressed in a separate patch.
This patch allows TSO being set/unset on the bonding master,
so that GSO segmentation is done after bonding layer.
Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: Michał Mirosław <mirqus@gmail.com>
Cc: Jay Vosburgh <fubar@us.ibm.com>
Cc: Andy Gospodarek <andy@greyhouse.net>
Cc: Maciej Żenczykowski <maze@google.com>
Cc: Tom Herbert <therbert@google.com>
Cc: Neal Cardwell <ncardwell@google.com>
Cc: Yuchung Cheng <ycheng@google.com>
---
v2: add a documented helper so that team/bridge can use it
drivers/net/bonding/bond_main.c | 1 +
include/linux/netdevice.h | 11 +++++++++++
2 files changed, 12 insertions(+)
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index d0aade0..449ad9b 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -1362,6 +1362,7 @@ static netdev_features_t bond_fix_features(struct net_device *dev,
slave->dev->features,
mask);
}
+ features = netdev_add_tso_features(features, mask);
out:
read_unlock(&bond->lock);
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index a94a5a0..095945c 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -2733,6 +2733,17 @@ static inline netdev_features_t netdev_get_wanted_features(
}
netdev_features_t netdev_increment_features(netdev_features_t all,
netdev_features_t one, netdev_features_t mask);
+
+/* Allow TSO being used on stacked device :
+ * Performing the GSO segmentation before last device
+ * is a performance improvement.
+ */
+static inline netdev_features_t netdev_add_tso_features(netdev_features_t features,
+ netdev_features_t mask)
+{
+ return netdev_increment_features(features, NETIF_F_ALL_TSO, mask);
+}
+
int __netdev_update_features(struct net_device *dev);
void netdev_update_features(struct net_device *dev);
void netdev_change_features(struct net_device *dev);
next prev parent reply other threads:[~2013-05-16 17:34 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-05-15 21:41 [PATCH] bonding: allow TSO being set on bonding master Eric Dumazet
2013-05-15 22:55 ` Michał Mirosław
2013-05-15 23:18 ` Eric Dumazet
2013-05-15 23:30 ` Eric Dumazet
2013-05-16 4:31 ` Maciej Żenczykowski
2013-05-16 4:44 ` Eric Dumazet
2013-05-16 5:45 ` Michał Mirosław
2013-05-16 6:09 ` Eric Dumazet
2013-05-16 8:59 ` Michał Mirosław
2013-05-16 17:34 ` Eric Dumazet [this message]
2013-05-16 22:02 ` [PATCH v2] " David Miller
2013-05-16 22:16 ` Eric Dumazet
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=1368725693.3301.59.camel@edumazet-glaptop \
--to=eric.dumazet@gmail.com \
--cc=andy@greyhouse.net \
--cc=davem@davemloft.net \
--cc=fubar@us.ibm.com \
--cc=maze@google.com \
--cc=mirqus@gmail.com \
--cc=ncardwell@google.com \
--cc=netdev@vger.kernel.org \
--cc=therbert@google.com \
--cc=ycheng@google.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