diff options
author | Paul Durrant <Paul.Durrant@citrix.com> | 2013-10-16 12:50:31 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2013-10-17 15:35:17 -0400 |
commit | a94685876859be30446357db6d6c4a9c951305b4 (patch) | |
tree | 99fe7fd8031b7e137c1474cafdf40e36e0c6c2d8 /drivers/net/xen-netback | |
parent | 7365bcfa32d2c9d212c41d52ff3509d70b6a3466 (diff) |
xen-netback: handle IPv6 TCP GSO packets from the guest
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>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/xen-netback')
-rw-r--r-- | drivers/net/xen-netback/netback.c | 11 | ||||
-rw-r--r-- | drivers/net/xen-netback/xenbus.c | 7 |
2 files changed, 15 insertions, 3 deletions
diff --git a/drivers/net/xen-netback/netback.c b/drivers/net/xen-netback/netback.c index 4271f8d1da7a..0e327d46a139 100644 --- a/drivers/net/xen-netback/netback.c +++ b/drivers/net/xen-netback/netback.c | |||
@@ -1098,15 +1098,20 @@ static int xenvif_set_skb_gso(struct xenvif *vif, | |||
1098 | return -EINVAL; | 1098 | return -EINVAL; |
1099 | } | 1099 | } |
1100 | 1100 | ||
1101 | /* Currently only TCPv4 S.O. is supported. */ | 1101 | switch (gso->u.gso.type) { |
1102 | if (gso->u.gso.type != XEN_NETIF_GSO_TYPE_TCPV4) { | 1102 | case XEN_NETIF_GSO_TYPE_TCPV4: |
1103 | skb_shinfo(skb)->gso_type = SKB_GSO_TCPV4; | ||
1104 | break; | ||
1105 | case XEN_NETIF_GSO_TYPE_TCPV6: | ||
1106 | skb_shinfo(skb)->gso_type = SKB_GSO_TCPV6; | ||
1107 | break; | ||
1108 | default: | ||
1103 | netdev_err(vif->dev, "Bad GSO type %d.\n", gso->u.gso.type); | 1109 | netdev_err(vif->dev, "Bad GSO type %d.\n", gso->u.gso.type); |
1104 | xenvif_fatal_tx_err(vif); | 1110 | xenvif_fatal_tx_err(vif); |
1105 | return -EINVAL; | 1111 | return -EINVAL; |
1106 | } | 1112 | } |
1107 | 1113 | ||
1108 | skb_shinfo(skb)->gso_size = gso->u.gso.size; | 1114 | skb_shinfo(skb)->gso_size = gso->u.gso.size; |
1109 | skb_shinfo(skb)->gso_type = SKB_GSO_TCPV4; | ||
1110 | 1115 | ||
1111 | /* Header must be checked, and gso_segs computed. */ | 1116 | /* Header must be checked, and gso_segs computed. */ |
1112 | skb_shinfo(skb)->gso_type |= SKB_GSO_DODGY; | 1117 | 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 108e7523017a..02cb00bebdc9 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, | |||
105 | goto abort_transaction; | 105 | goto abort_transaction; |
106 | } | 106 | } |
107 | 107 | ||
108 | err = xenbus_printf(xbt, dev->nodename, "feature-gso-tcpv6", | ||
109 | "%d", sg); | ||
110 | if (err) { | ||
111 | message = "writing feature-gso-tcpv6"; | ||
112 | goto abort_transaction; | ||
113 | } | ||
114 | |||
108 | /* We support partial checksum setup for IPv6 packets */ | 115 | /* We support partial checksum setup for IPv6 packets */ |
109 | err = xenbus_printf(xbt, dev->nodename, | 116 | err = xenbus_printf(xbt, dev->nodename, |
110 | "feature-ipv6-csum-offload", | 117 | "feature-ipv6-csum-offload", |