aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/xen-netback/xenbus.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/xen-netback/xenbus.c')
-rw-r--r--drivers/net/xen-netback/xenbus.c52
1 files changed, 49 insertions, 3 deletions
diff --git a/drivers/net/xen-netback/xenbus.c b/drivers/net/xen-netback/xenbus.c
index 1b08d8798372..f0358992b04f 100644
--- a/drivers/net/xen-netback/xenbus.c
+++ b/drivers/net/xen-netback/xenbus.c
@@ -105,6 +105,22 @@ 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
115 /* We support partial checksum setup for IPv6 packets */
116 err = xenbus_printf(xbt, dev->nodename,
117 "feature-ipv6-csum-offload",
118 "%d", 1);
119 if (err) {
120 message = "writing feature-ipv6-csum-offload";
121 goto abort_transaction;
122 }
123
108 /* We support rx-copy path. */ 124 /* We support rx-copy path. */
109 err = xenbus_printf(xbt, dev->nodename, 125 err = xenbus_printf(xbt, dev->nodename,
110 "feature-rx-copy", "%d", 1); 126 "feature-rx-copy", "%d", 1);
@@ -561,20 +577,50 @@ static int connect_rings(struct backend_info *be)
561 val = 0; 577 val = 0;
562 vif->can_sg = !!val; 578 vif->can_sg = !!val;
563 579
580 vif->gso_mask = 0;
581 vif->gso_prefix_mask = 0;
582
564 if (xenbus_scanf(XBT_NIL, dev->otherend, "feature-gso-tcpv4", 583 if (xenbus_scanf(XBT_NIL, dev->otherend, "feature-gso-tcpv4",
565 "%d", &val) < 0) 584 "%d", &val) < 0)
566 val = 0; 585 val = 0;
567 vif->gso = !!val; 586 if (val)
587 vif->gso_mask |= GSO_BIT(TCPV4);
568 588
569 if (xenbus_scanf(XBT_NIL, dev->otherend, "feature-gso-tcpv4-prefix", 589 if (xenbus_scanf(XBT_NIL, dev->otherend, "feature-gso-tcpv4-prefix",
570 "%d", &val) < 0) 590 "%d", &val) < 0)
571 val = 0; 591 val = 0;
572 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 }
573 614
574 if (xenbus_scanf(XBT_NIL, dev->otherend, "feature-no-csum-offload", 615 if (xenbus_scanf(XBT_NIL, dev->otherend, "feature-no-csum-offload",
575 "%d", &val) < 0) 616 "%d", &val) < 0)
576 val = 0; 617 val = 0;
577 vif->csum = !val; 618 vif->ip_csum = !val;
619
620 if (xenbus_scanf(XBT_NIL, dev->otherend, "feature-ipv6-csum-offload",
621 "%d", &val) < 0)
622 val = 0;
623 vif->ipv6_csum = !!val;
578 624
579 /* Map the shared frame, irq etc. */ 625 /* Map the shared frame, irq etc. */
580 err = xenvif_connect(vif, tx_ring_ref, rx_ring_ref, 626 err = xenvif_connect(vif, tx_ring_ref, rx_ring_ref,