From: Tom Herbert <therbert@google.com>
To: stephen@networkplumber.org, netdev@vger.kernel.org
Subject: [PATCH iproute2 2/4] vxlan: Add support for remote checksum offload
Date: Thu, 29 Jan 2015 08:51:59 -0800 [thread overview]
Message-ID: <1422550321-30901-3-git-send-email-therbert@google.com> (raw)
In-Reply-To: <1422550321-30901-1-git-send-email-therbert@google.com>
This patch adds support to remote checksum checksum offload
to VXLAN. This patch adds remcsumtx and remcsumrx to ip vxlan
configuration to enable remote checksum offload for transmit
and receive on the VXLAN tunnel.
https://tools.ietf.org/html/draft-herbert-vxlan-rco-00
Example:
ip link add name vxlan0 type vxlan id 42 group 239.1.1.1 dev eth0 \
udpcsum remcsumtx remcsumrx
Signed-off-by: Tom Herbert <therbert@google.com>
---
include/linux/if_link.h | 2 ++
ip/iplink_vxlan.c | 21 +++++++++++++++++++++
2 files changed, 23 insertions(+)
diff --git a/include/linux/if_link.h b/include/linux/if_link.h
index 167ec34..11df025 100644
--- a/include/linux/if_link.h
+++ b/include/linux/if_link.h
@@ -368,6 +368,8 @@ enum {
IFLA_VXLAN_UDP_CSUM,
IFLA_VXLAN_UDP_ZERO_CSUM6_TX,
IFLA_VXLAN_UDP_ZERO_CSUM6_RX,
+ IFLA_VXLAN_REMCSUM_TX,
+ IFLA_VXLAN_REMCSUM_RX,
__IFLA_VXLAN_MAX
};
#define IFLA_VXLAN_MAX (__IFLA_VXLAN_MAX - 1)
diff --git a/ip/iplink_vxlan.c b/ip/iplink_vxlan.c
index 9cc3ec3..8fb11df 100644
--- a/ip/iplink_vxlan.c
+++ b/ip/iplink_vxlan.c
@@ -30,6 +30,7 @@ static void print_explain(FILE *f)
fprintf(f, " [ [no]l2miss ] [ [no]l3miss ]\n");
fprintf(f, " [ ageing SECONDS ] [ maxaddress NUMBER ]\n");
fprintf(f, " [ [no]udpcsum ] [ [no]udp6zerocsumtx ] [ [no]udp6zerocsumrx ]\n");
+ fprintf(f, " [ [no]remcsumtx ] [ [no]remcsumrx ]\n");
fprintf(f, "\n");
fprintf(f, "Where: VNI := 0-16777215\n");
fprintf(f, " ADDR := { IP_ADDRESS | any }\n");
@@ -68,6 +69,8 @@ static int vxlan_parse_opt(struct link_util *lu, int argc, char **argv,
__u8 udpcsum = 0;
__u8 udp6zerocsumtx = 0;
__u8 udp6zerocsumrx = 0;
+ __u8 remcsumtx = 0;
+ __u8 remcsumrx = 0;
int dst_port_set = 0;
struct ifla_vxlan_port_range range = { 0, 0 };
@@ -197,6 +200,14 @@ static int vxlan_parse_opt(struct link_util *lu, int argc, char **argv,
udp6zerocsumrx = 1;
} else if (!matches(*argv, "noudp6zerocsumrx")) {
udp6zerocsumrx = 0;
+ } else if (!matches(*argv, "remcsumtx")) {
+ remcsumtx = 1;
+ } else if (!matches(*argv, "noremcsumtx")) {
+ remcsumtx = 0;
+ } else if (!matches(*argv, "remcsumrx")) {
+ remcsumrx = 1;
+ } else if (!matches(*argv, "noremcsumrx")) {
+ remcsumrx = 0;
} else if (matches(*argv, "help") == 0) {
explain();
return -1;
@@ -255,6 +266,8 @@ static int vxlan_parse_opt(struct link_util *lu, int argc, char **argv,
addattr8(n, 1024, IFLA_VXLAN_UDP_CSUM, udpcsum);
addattr8(n, 1024, IFLA_VXLAN_UDP_ZERO_CSUM6_TX, udp6zerocsumtx);
addattr8(n, 1024, IFLA_VXLAN_UDP_ZERO_CSUM6_RX, udp6zerocsumrx);
+ addattr8(n, 1024, IFLA_VXLAN_REMCSUM_TX, remcsumtx);
+ addattr8(n, 1024, IFLA_VXLAN_REMCSUM_RX, remcsumrx);
if (noage)
addattr32(n, 1024, IFLA_VXLAN_AGEING, 0);
@@ -398,6 +411,14 @@ static void vxlan_print_opt(struct link_util *lu, FILE *f, struct rtattr *tb[])
if (tb[IFLA_VXLAN_UDP_ZERO_CSUM6_RX] &&
rta_getattr_u8(tb[IFLA_VXLAN_UDP_ZERO_CSUM6_RX]))
fputs("udp6zerocsumrx ", f);
+
+ if (tb[IFLA_VXLAN_REMCSUM_TX] &&
+ rta_getattr_u8(tb[IFLA_VXLAN_REMCSUM_TX]))
+ fputs("remcsumtx ", f);
+
+ if (tb[IFLA_VXLAN_REMCSUM_RX] &&
+ rta_getattr_u8(tb[IFLA_VXLAN_REMCSUM_RX]))
+ fputs("remcsumrx ", f);
}
static void vxlan_print_help(struct link_util *lu, int argc, char **argv,
--
2.2.0.rc0.207.ga3a616c
next prev parent reply other threads:[~2015-01-29 16:53 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-01-29 16:51 [PATCH iproute2 0/4] iproute: Support for remote checksum offload Tom Herbert
2015-01-29 16:51 ` [PATCH iproute2 1/4] ip link: Add support for remote checksum offload to IP tunnels Tom Herbert
2015-02-05 18:51 ` Stephen Hemminger
2015-01-29 16:51 ` Tom Herbert [this message]
2015-02-05 18:54 ` [PATCH iproute2 2/4] vxlan: Add support for remote checksum offload Stephen Hemminger
2015-01-29 16:52 ` [PATCH iproute2 3/4] iproute: Description of new options for VXLAN in ip-link man pages Tom Herbert
2015-01-29 17:20 ` Nikolay Aleksandrov
2015-02-05 18:55 ` Stephen Hemminger
2015-01-29 16:52 ` [PATCH iproute2 4/4] iproute: Descriptions of fou and gue options " Tom Herbert
2015-02-05 18:56 ` Stephen Hemminger
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=1422550321-30901-3-git-send-email-therbert@google.com \
--to=therbert@google.com \
--cc=netdev@vger.kernel.org \
--cc=stephen@networkplumber.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).