Paul Durrant
2013-Oct-08 10:58 UTC
[PATCH net-next v2 4/5] xen-netback: handle IPv6 TCP GSO packets from the guest
This patch a xenstore flag, festure-gso-tcpv6, to adevrtise netback can
handle IPv6 TCP GSO packets and 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 | 3 ++-
3 files changed, 17 insertions(+), 4 deletions(-)
diff --git a/drivers/net/xen-netback/netback.c
b/drivers/net/xen-netback/netback.c
index 35b1fa6..ac42f73 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 dff423b..389fa72 100644
--- a/drivers/net/xen-netback/xenbus.c
+++ b/drivers/net/xen-netback/xenbus.c
@@ -101,6 +101,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 eb262e3..c19cc06 100644
--- a/include/xen/interface/io/netif.h
+++ b/include/xen/interface/io/netif.h
@@ -95,8 +95,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
Wei Liu
2013-Oct-08 13:31 UTC
Re: [PATCH net-next v2 4/5] xen-netback: handle IPv6 TCP GSO packets from the guest
On Tue, Oct 08, 2013 at 11:58:15AM +0100, Paul Durrant wrote:> This patch a xenstore flag, festure-gso-tcpv6, to adevrtise netback can^ adds feature advertise> handle IPv6 TCP GSO packets and 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.Note the new type should be synced to Xen''s netif.h tree with separate patch for Xen. Wei.
Paul Durrant
2013-Oct-08 13:42 UTC
Re: [PATCH net-next v2 4/5] xen-netback: handle IPv6 TCP GSO packets from the guest
> -----Original Message----- > From: Wei Liu [mailto:wei.liu2@citrix.com] > Sent: 08 October 2013 14:32 > To: Paul Durrant > Cc: xen-devel@lists.xen.org; netdev@vger.kernel.org; Wei Liu; David Vrabel; > Ian Campbell > Subject: Re: [PATCH net-next v2 4/5] xen-netback: handle IPv6 TCP GSO > packets from the guest > > On Tue, Oct 08, 2013 at 11:58:15AM +0100, Paul Durrant wrote: > > This patch a xenstore flag, festure-gso-tcpv6, to adevrtise netback can > ^ adds feature advertise > > > handle IPv6 TCP GSO packets and 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. > > Note the new type should be synced to Xen''s netif.h tree with separate > patch for Xen. >Ok. Do you think it is reasonable to make incremental changes to netif.h in this series and then submit a patch to xen-devel with the complete set once this series is accepted? Paul
Jan Beulich
2013-Oct-08 13:50 UTC
Re: [PATCH net-next v2 4/5] xen-netback: handle IPv6 TCP GSO packets from the guest
>>> On 08.10.13 at 15:42, Paul Durrant <Paul.Durrant@citrix.com> wrote: >> -----Original Message----- >> From: Wei Liu [mailto:wei.liu2@citrix.com] >> Sent: 08 October 2013 14:32 >> To: Paul Durrant >> Cc: xen-devel@lists.xen.org; netdev@vger.kernel.org; Wei Liu; David Vrabel; >> Ian Campbell >> Subject: Re: [PATCH net-next v2 4/5] xen-netback: handle IPv6 TCP GSO >> packets from the guest >> >> On Tue, Oct 08, 2013 at 11:58:15AM +0100, Paul Durrant wrote: >> > This patch a xenstore flag, festure-gso-tcpv6, to adevrtise netback can >> ^ adds feature advertise >> >> > handle IPv6 TCP GSO packets and 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. >> >> Note the new type should be synced to Xen''s netif.h tree with separate >> patch for Xen. >> > > Ok. Do you think it is reasonable to make incremental changes to netif.h in > this series and then submit a patch to xen-devel with the complete set once > this series is accepted?I would think so. Jan