diff options
author | Paul Durrant <Paul.Durrant@citrix.com> | 2013-10-16 12:50:32 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2013-10-17 15:35:17 -0400 |
commit | 82cada22a0bbec6a7afb573ef5fb6c512aaa2739 (patch) | |
tree | 509d5a4bea1dc636885572a4c5d85e9e7bbce32b /drivers/net/xen-netback/xenbus.c | |
parent | a94685876859be30446357db6d6c4a9c951305b4 (diff) |
xen-netback: enable IPv6 TCP GSO to the guest
This patch adds code to handle SKB_GSO_TCPV6 skbs and construct appropriate
extra or prefix segments to pass the large packet to the frontend. New
xenstore flags, feature-gso-tcpv6 and feature-gso-tcpv6-prefix, are sampled
to determine if the frontend is capable of handling such packets.
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>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/xen-netback/xenbus.c')
-rw-r--r-- | drivers/net/xen-netback/xenbus.c | 29 |
1 files changed, 27 insertions, 2 deletions
diff --git a/drivers/net/xen-netback/xenbus.c b/drivers/net/xen-netback/xenbus.c index 02cb00bebdc9..f0358992b04f 100644 --- a/drivers/net/xen-netback/xenbus.c +++ b/drivers/net/xen-netback/xenbus.c | |||
@@ -577,15 +577,40 @@ static int connect_rings(struct backend_info *be) | |||
577 | val = 0; | 577 | val = 0; |
578 | vif->can_sg = !!val; | 578 | vif->can_sg = !!val; |
579 | 579 | ||
580 | vif->gso_mask = 0; | ||
581 | vif->gso_prefix_mask = 0; | ||
582 | |||
580 | if (xenbus_scanf(XBT_NIL, dev->otherend, "feature-gso-tcpv4", | 583 | if (xenbus_scanf(XBT_NIL, dev->otherend, "feature-gso-tcpv4", |
581 | "%d", &val) < 0) | 584 | "%d", &val) < 0) |
582 | val = 0; | 585 | val = 0; |
583 | vif->gso = !!val; | 586 | if (val) |
587 | vif->gso_mask |= GSO_BIT(TCPV4); | ||
584 | 588 | ||
585 | if (xenbus_scanf(XBT_NIL, dev->otherend, "feature-gso-tcpv4-prefix", | 589 | if (xenbus_scanf(XBT_NIL, dev->otherend, "feature-gso-tcpv4-prefix", |
586 | "%d", &val) < 0) | 590 | "%d", &val) < 0) |
587 | val = 0; | 591 | val = 0; |
588 | vif->gso_prefix = !!val; | 592 | if (val) |
593 | vif->gso_prefix_mask |= GSO_BIT(TCPV4); | ||
594 | |||
595 | if (xenbus_scanf(XBT_NIL, dev->otherend, "feature-gso-tcpv6", | ||
596 | "%d", &val) < 0) | ||
597 | val = 0; | ||
598 | if (val) | ||
599 | vif->gso_mask |= GSO_BIT(TCPV6); | ||
600 | |||
601 | if (xenbus_scanf(XBT_NIL, dev->otherend, "feature-gso-tcpv6-prefix", | ||
602 | "%d", &val) < 0) | ||
603 | val = 0; | ||
604 | if (val) | ||
605 | vif->gso_prefix_mask |= GSO_BIT(TCPV6); | ||
606 | |||
607 | if (vif->gso_mask & vif->gso_prefix_mask) { | ||
608 | xenbus_dev_fatal(dev, err, | ||
609 | "%s: gso and gso prefix flags are not " | ||
610 | "mutually exclusive", | ||
611 | dev->otherend); | ||
612 | return -EOPNOTSUPP; | ||
613 | } | ||
589 | 614 | ||
590 | if (xenbus_scanf(XBT_NIL, dev->otherend, "feature-no-csum-offload", | 615 | if (xenbus_scanf(XBT_NIL, dev->otherend, "feature-no-csum-offload", |
591 | "%d", &val) < 0) | 616 | "%d", &val) < 0) |