From: Alexander Duyck <aduyck@mirantis.com>
To: netdev@vger.kernel.org, davem@davemloft.net, alexander.duyck@gmail.com
Subject: [net-next PATCH 1/2] GENEVE: Support outer IPv4 Tx checksums by default
Date: Fri, 19 Feb 2016 11:26:24 -0800 [thread overview]
Message-ID: <20160219192624.15687.55933.stgit@localhost.localdomain> (raw)
In-Reply-To: <20160219191806.15687.37621.stgit@localhost.localdomain>
This change makes it so that if UDP CSUM is not specified we will default
to enabling it. The main motivation behind this is the fact that with the
use of outer checksum we can greatly improve the performance for GENEVE
tunnels on hardware that doesn't know how to parse them.
Signed-off-by: Alexander Duyck <aduyck@mirantis.com>
---
drivers/net/geneve.c | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/drivers/net/geneve.c b/drivers/net/geneve.c
index 1b5deaf7e3c8..2acaf2b209cd 100644
--- a/drivers/net/geneve.c
+++ b/drivers/net/geneve.c
@@ -76,7 +76,7 @@ struct geneve_dev {
};
/* Geneve device flags */
-#define GENEVE_F_UDP_CSUM BIT(0)
+#define GENEVE_F_UDP_ZERO_CSUM_TX BIT(0)
#define GENEVE_F_UDP_ZERO_CSUM6_TX BIT(1)
#define GENEVE_F_UDP_ZERO_CSUM6_RX BIT(2)
@@ -703,7 +703,7 @@ static int geneve_build_skb(struct rtable *rt, struct sk_buff *skb,
struct genevehdr *gnvh;
int min_headroom;
int err;
- bool udp_sum = !!(flags & GENEVE_F_UDP_CSUM);
+ bool udp_sum = !(flags & GENEVE_F_UDP_ZERO_CSUM_TX);
skb_scrub_packet(skb, xnet);
@@ -944,9 +944,9 @@ static netdev_tx_t geneve_xmit_skb(struct sk_buff *skb, struct net_device *dev,
opts = ip_tunnel_info_opts(info);
if (key->tun_flags & TUNNEL_CSUM)
- flags |= GENEVE_F_UDP_CSUM;
+ flags &= ~GENEVE_F_UDP_ZERO_CSUM_TX;
else
- flags &= ~GENEVE_F_UDP_CSUM;
+ flags |= GENEVE_F_UDP_ZERO_CSUM_TX;
err = geneve_build_skb(rt, skb, key->tun_flags, vni,
info->options_len, opts, flags, xnet);
@@ -972,7 +972,7 @@ static netdev_tx_t geneve_xmit_skb(struct sk_buff *skb, struct net_device *dev,
udp_tunnel_xmit_skb(rt, gs4->sock->sk, skb, fl4.saddr, fl4.daddr,
tos, ttl, df, sport, geneve->dst_port,
!net_eq(geneve->net, dev_net(geneve->dev)),
- !(flags & GENEVE_F_UDP_CSUM));
+ !!(flags & GENEVE_F_UDP_ZERO_CSUM_TX));
return NETDEV_TX_OK;
@@ -1412,8 +1412,8 @@ static int geneve_newlink(struct net *net, struct net_device *dev,
metadata = true;
if (data[IFLA_GENEVE_UDP_CSUM] &&
- nla_get_u8(data[IFLA_GENEVE_UDP_CSUM]))
- flags |= GENEVE_F_UDP_CSUM;
+ !nla_get_u8(data[IFLA_GENEVE_UDP_CSUM]))
+ flags |= GENEVE_F_UDP_ZERO_CSUM_TX;
if (data[IFLA_GENEVE_UDP_ZERO_CSUM6_TX] &&
nla_get_u8(data[IFLA_GENEVE_UDP_ZERO_CSUM6_TX]))
@@ -1483,7 +1483,7 @@ static int geneve_fill_info(struct sk_buff *skb, const struct net_device *dev)
}
if (nla_put_u8(skb, IFLA_GENEVE_UDP_CSUM,
- !!(geneve->flags & GENEVE_F_UDP_CSUM)) ||
+ !(geneve->flags & GENEVE_F_UDP_ZERO_CSUM_TX)) ||
nla_put_u8(skb, IFLA_GENEVE_UDP_ZERO_CSUM6_TX,
!!(geneve->flags & GENEVE_F_UDP_ZERO_CSUM6_TX)) ||
nla_put_u8(skb, IFLA_GENEVE_UDP_ZERO_CSUM6_RX,
next prev parent reply other threads:[~2016-02-19 19:26 UTC|newest]
Thread overview: 47+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-02-19 19:26 [net-next PATCH 0/2] GENEVE/VXLAN: Enable outer Tx checksum by default Alexander Duyck
2016-02-19 19:26 ` Alexander Duyck [this message]
2016-02-19 20:28 ` [net-next PATCH 1/2] GENEVE: Support outer IPv4 Tx checksums " Tom Herbert
2016-02-19 19:26 ` [net-next PATCH 2/2] VXLAN: " Alexander Duyck
2016-02-19 20:27 ` Tom Herbert
2016-02-19 21:36 ` Jesse Gross
2016-02-19 21:53 ` [net-next PATCH 0/2] GENEVE/VXLAN: Enable outer Tx checksum " Jesse Gross
2016-02-19 23:10 ` Alex Duyck
2016-02-20 0:08 ` Jesse Gross
2016-02-20 0:14 ` Tom Herbert
2016-02-20 2:18 ` Jesse Gross
2016-02-20 19:51 ` Tom Herbert
2016-02-23 3:31 ` Jesse Gross
2016-02-23 15:18 ` Edward Cree
2016-02-23 16:47 ` Tom Herbert
2016-02-23 17:20 ` Rick Jones
2016-02-23 17:38 ` Edward Cree
2016-02-23 18:08 ` David Miller
2016-02-23 20:20 ` Edward Cree
2016-02-23 23:11 ` David Miller
2016-02-24 0:53 ` Tom Herbert
2016-02-24 17:30 ` Edward Cree
2016-02-23 18:11 ` Tom Herbert
2016-02-23 17:31 ` Jesse Gross
2016-02-23 17:42 ` Tom Herbert
2016-02-23 18:18 ` Alexander Duyck
2016-02-23 18:26 ` David Miller
2016-02-23 18:32 ` Tom Herbert
2016-02-23 18:24 ` David Miller
2016-02-24 9:58 ` David Laight
2016-02-24 15:41 ` David Miller
2016-02-25 20:14 ` David Miller
2016-03-11 19:20 ` Generic TSO (was Re: [net-next PATCH 0/2] GENEVE/VXLAN: Enable outer Tx checksum by default) Edward Cree
2016-03-11 19:57 ` Tom Herbert
2016-03-11 19:59 ` Edward Cree
2016-03-11 20:16 ` Tom Herbert
2016-03-11 20:24 ` Edward Cree
2016-03-11 21:09 ` Alexander Duyck
2016-03-11 21:29 ` Edward Cree
2016-03-11 22:31 ` Alexander Duyck
2016-03-11 22:55 ` Tom Herbert
2016-03-12 5:40 ` Alexander Duyck
2016-03-14 10:26 ` Generic TSO Edward Cree
2016-03-14 10:32 ` Edward Cree
2016-03-14 15:59 ` Alexander Duyck
2016-03-11 20:22 ` David Miller
2016-02-22 3:06 ` [net-next PATCH 0/2] GENEVE/VXLAN: Enable outer Tx checksum by default David Miller
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=20160219192624.15687.55933.stgit@localhost.localdomain \
--to=aduyck@mirantis.com \
--cc=alexander.duyck@gmail.com \
--cc=davem@davemloft.net \
--cc=netdev@vger.kernel.org \
/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;
as well as URLs for NNTP newsgroup(s).