From: Paul Durrant <paul.durrant@citrix.com>
To: <xen-devel@lists.xen.org>, <netdev@vger.kernel.org>
Cc: Paul Durrant <paul.durrant@citrix.com>,
Wei Liu <wei.liu2@citrix.com>,
David Vrabel <david.vrabel@citrix.com>,
Ian Campbell <ian.campbell@citrix.com>
Subject: [PATCH net-next v4 4/5] xen-netback: handle IPv6 TCP GSO packets from the guest
Date: Fri, 11 Oct 2013 16:06:21 +0100 [thread overview]
Message-ID: <1381503982-1418-5-git-send-email-paul.durrant@citrix.com> (raw)
In-Reply-To: <1381503982-1418-1-git-send-email-paul.durrant@citrix.com>
This patch adds a xenstore feature flag, festure-gso-tcpv6, to advertise
that netback can handle IPv6 TCP GSO packets. It creates SKB_GSO_TCPV6 skbs
if the frontend passes an extra segment with the new type
XEN_NETIF_GSO_TYPE_TCPV6 added to netif.h.
Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
Cc: Wei Liu <wei.liu2@citrix.com>
Cc: David Vrabel <david.vrabel@citrix.com>
Cc: Ian Campbell <ian.campbell@citrix.com>
---
drivers/net/xen-netback/netback.c | 11 ++++++++---
drivers/net/xen-netback/xenbus.c | 7 +++++++
include/xen/interface/io/netif.h | 10 +++++++++-
3 files changed, 24 insertions(+), 4 deletions(-)
diff --git a/drivers/net/xen-netback/netback.c b/drivers/net/xen-netback/netback.c
index 74c13b9..65f04e7 100644
--- a/drivers/net/xen-netback/netback.c
+++ b/drivers/net/xen-netback/netback.c
@@ -1096,15 +1096,20 @@ static int xenvif_set_skb_gso(struct xenvif *vif,
return -EINVAL;
}
- /* Currently only TCPv4 S.O. is supported. */
- if (gso->u.gso.type != XEN_NETIF_GSO_TYPE_TCPV4) {
+ switch (gso->u.gso.type) {
+ case XEN_NETIF_GSO_TYPE_TCPV4:
+ skb_shinfo(skb)->gso_type = SKB_GSO_TCPV4;
+ break;
+ case XEN_NETIF_GSO_TYPE_TCPV6:
+ skb_shinfo(skb)->gso_type = SKB_GSO_TCPV6;
+ break;
+ default:
netdev_err(vif->dev, "Bad GSO type %d.\n", gso->u.gso.type);
xenvif_fatal_tx_err(vif);
return -EINVAL;
}
skb_shinfo(skb)->gso_size = gso->u.gso.size;
- skb_shinfo(skb)->gso_type = SKB_GSO_TCPV4;
/* Header must be checked, and gso_segs computed. */
skb_shinfo(skb)->gso_type |= SKB_GSO_DODGY;
diff --git a/drivers/net/xen-netback/xenbus.c b/drivers/net/xen-netback/xenbus.c
index 9c9b37d..7e4dcc9 100644
--- a/drivers/net/xen-netback/xenbus.c
+++ b/drivers/net/xen-netback/xenbus.c
@@ -105,6 +105,13 @@ static int netback_probe(struct xenbus_device *dev,
goto abort_transaction;
}
+ err = xenbus_printf(xbt, dev->nodename, "feature-gso-tcpv6",
+ "%d", sg);
+ if (err) {
+ message = "writing feature-gso-tcpv6";
+ goto abort_transaction;
+ }
+
/* We support partial checksum setup for IPv6 packets */
err = xenbus_printf(xbt, dev->nodename,
"feature-ipv6-csum-offload",
diff --git a/include/xen/interface/io/netif.h b/include/xen/interface/io/netif.h
index d9fb44739..d7dd8d7 100644
--- a/include/xen/interface/io/netif.h
+++ b/include/xen/interface/io/netif.h
@@ -61,6 +61,13 @@
*/
/*
+ * "feature-gso-tcpv4" and "feature-gso-tcpv6" advertise the capability to
+ * handle large TCP packets (in IPv4 or IPv6 form respectively). Neither
+ * frontends nor backends are assumed to be capable unless the flags are
+ * present.
+ */
+
+/*
* This is the 'wire' format for packets:
* Request 1: xen_netif_tx_request -- XEN_NETTXF_* (any flags)
* [Request 2: xen_netif_extra_info] (only if request 1 has XEN_NETTXF_extra_info)
@@ -105,8 +112,9 @@ struct xen_netif_tx_request {
#define _XEN_NETIF_EXTRA_FLAG_MORE (0)
#define XEN_NETIF_EXTRA_FLAG_MORE (1U<<_XEN_NETIF_EXTRA_FLAG_MORE)
-/* GSO types - only TCPv4 currently supported. */
+/* GSO types */
#define XEN_NETIF_GSO_TYPE_TCPV4 (1)
+#define XEN_NETIF_GSO_TYPE_TCPV6 (2)
/*
* This structure needs to fit within both netif_tx_request and
--
1.7.10.4
next prev parent reply other threads:[~2013-10-11 15:06 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-10-11 15:06 [PATCH net-next v4 0/5] xen-netback: IPv6 offload support Paul Durrant
2013-10-11 15:06 ` [PATCH net-next v4 1/5] xen-netback: add support for IPv6 checksum offload to guest Paul Durrant
2013-10-14 10:53 ` Ian Campbell
2013-10-14 11:10 ` Paul Durrant
2013-10-16 16:10 ` Ian Campbell
2013-10-11 15:06 ` [PATCH net-next v4 2/5] xen-netback: add support for IPv6 checksum offload from guest Paul Durrant
2013-10-14 10:42 ` Wei Liu
2013-10-14 10:49 ` Paul Durrant
2013-10-14 10:55 ` Wei Liu
2013-10-14 10:57 ` Paul Durrant
2013-10-14 12:19 ` [Xen-devel] " David Vrabel
2013-10-14 12:34 ` Paul Durrant
2013-10-16 16:11 ` Ian Campbell
2013-10-16 16:57 ` Paul Durrant
2013-10-11 15:06 ` [PATCH net-next v4 3/5] xen-netback: Unconditionally set NETIF_F_RXCSUM Paul Durrant
2013-10-14 10:56 ` Ian Campbell
2013-10-14 11:03 ` Paul Durrant
2013-10-11 15:06 ` Paul Durrant [this message]
2013-10-16 16:15 ` [PATCH net-next v4 4/5] xen-netback: handle IPv6 TCP GSO packets from the guest Ian Campbell
2013-10-16 16:16 ` Ian Campbell
2013-10-11 15:06 ` [PATCH net-next v4 5/5] xen-netback: enable IPv6 TCP GSO to " Paul Durrant
2013-10-16 16:49 ` Ian Campbell
2013-10-16 16:52 ` Paul Durrant
2013-10-16 17:01 ` Ian Campbell
2013-10-16 16:20 ` [Xen-devel] [PATCH net-next v4 0/5] xen-netback: IPv6 offload support Ian Campbell
2013-10-16 16:53 ` Paul Durrant
2013-10-16 17:00 ` Ian Campbell
2013-10-17 8:42 ` Paul Durrant
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=1381503982-1418-5-git-send-email-paul.durrant@citrix.com \
--to=paul.durrant@citrix.com \
--cc=david.vrabel@citrix.com \
--cc=ian.campbell@citrix.com \
--cc=netdev@vger.kernel.org \
--cc=wei.liu2@citrix.com \
--cc=xen-devel@lists.xen.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).