提交 a9468587 编写于 作者: P Paul Durrant 提交者: David S. Miller

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: NPaul Durrant <paul.durrant@citrix.com>
Cc: Wei Liu <wei.liu2@citrix.com>
Cc: David Vrabel <david.vrabel@citrix.com>
Acked-by: NIan Campbell <ian.campbell@citrix.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 7365bcfa
...@@ -1098,15 +1098,20 @@ static int xenvif_set_skb_gso(struct xenvif *vif, ...@@ -1098,15 +1098,20 @@ static int xenvif_set_skb_gso(struct xenvif *vif,
return -EINVAL; return -EINVAL;
} }
/* Currently only TCPv4 S.O. is supported. */ switch (gso->u.gso.type) {
if (gso->u.gso.type != XEN_NETIF_GSO_TYPE_TCPV4) { 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); netdev_err(vif->dev, "Bad GSO type %d.\n", gso->u.gso.type);
xenvif_fatal_tx_err(vif); xenvif_fatal_tx_err(vif);
return -EINVAL; return -EINVAL;
} }
skb_shinfo(skb)->gso_size = gso->u.gso.size; 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. */ /* Header must be checked, and gso_segs computed. */
skb_shinfo(skb)->gso_type |= SKB_GSO_DODGY; skb_shinfo(skb)->gso_type |= SKB_GSO_DODGY;
......
...@@ -105,6 +105,13 @@ static int netback_probe(struct xenbus_device *dev, ...@@ -105,6 +105,13 @@ static int netback_probe(struct xenbus_device *dev,
goto abort_transaction; 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 */ /* We support partial checksum setup for IPv6 packets */
err = xenbus_printf(xbt, dev->nodename, err = xenbus_printf(xbt, dev->nodename,
"feature-ipv6-csum-offload", "feature-ipv6-csum-offload",
......
...@@ -57,6 +57,13 @@ ...@@ -57,6 +57,13 @@
* offload on or off. If it is missing then the feature is assumed to be off. * offload on or off. If it is missing then the feature is assumed to be off.
*/ */
/*
* "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: * This is the 'wire' format for packets:
* Request 1: xen_netif_tx_request -- XEN_NETTXF_* (any flags) * Request 1: xen_netif_tx_request -- XEN_NETTXF_* (any flags)
...@@ -102,8 +109,9 @@ struct xen_netif_tx_request { ...@@ -102,8 +109,9 @@ struct xen_netif_tx_request {
#define _XEN_NETIF_EXTRA_FLAG_MORE (0) #define _XEN_NETIF_EXTRA_FLAG_MORE (0)
#define XEN_NETIF_EXTRA_FLAG_MORE (1U<<_XEN_NETIF_EXTRA_FLAG_MORE) #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_TCPV4 (1)
#define XEN_NETIF_GSO_TYPE_TCPV6 (2)
/* /*
* This structure needs to fit within both netif_tx_request and * This structure needs to fit within both netif_tx_request and
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册