diff options
-rw-r--r-- | drivers/net/xen-netback/common.h | 3 | ||||
-rw-r--r-- | drivers/net/xen-netback/interface.c | 10 | ||||
-rw-r--r-- | drivers/net/xen-netback/xenbus.c | 7 | ||||
-rw-r--r-- | include/xen/interface/io/netif.h | 7 |
4 files changed, 22 insertions, 5 deletions
diff --git a/drivers/net/xen-netback/common.h b/drivers/net/xen-netback/common.h index 5715318d6bab..b4a9a3c844b2 100644 --- a/drivers/net/xen-netback/common.h +++ b/drivers/net/xen-netback/common.h | |||
@@ -153,7 +153,8 @@ struct xenvif { | |||
153 | u8 can_sg:1; | 153 | u8 can_sg:1; |
154 | u8 gso:1; | 154 | u8 gso:1; |
155 | u8 gso_prefix:1; | 155 | u8 gso_prefix:1; |
156 | u8 csum:1; | 156 | u8 ip_csum:1; |
157 | u8 ipv6_csum:1; | ||
157 | 158 | ||
158 | /* Internal feature information. */ | 159 | /* Internal feature information. */ |
159 | u8 can_queue:1; /* can queue packets for receiver? */ | 160 | u8 can_queue:1; /* can queue packets for receiver? */ |
diff --git a/drivers/net/xen-netback/interface.c b/drivers/net/xen-netback/interface.c index 01bb854c7f62..8e927838652c 100644 --- a/drivers/net/xen-netback/interface.c +++ b/drivers/net/xen-netback/interface.c | |||
@@ -216,8 +216,10 @@ static netdev_features_t xenvif_fix_features(struct net_device *dev, | |||
216 | features &= ~NETIF_F_SG; | 216 | features &= ~NETIF_F_SG; |
217 | if (!vif->gso && !vif->gso_prefix) | 217 | if (!vif->gso && !vif->gso_prefix) |
218 | features &= ~NETIF_F_TSO; | 218 | features &= ~NETIF_F_TSO; |
219 | if (!vif->csum) | 219 | if (!vif->ip_csum) |
220 | features &= ~NETIF_F_IP_CSUM; | 220 | features &= ~NETIF_F_IP_CSUM; |
221 | if (!vif->ipv6_csum) | ||
222 | features &= ~NETIF_F_IPV6_CSUM; | ||
221 | 223 | ||
222 | return features; | 224 | return features; |
223 | } | 225 | } |
@@ -306,7 +308,7 @@ struct xenvif *xenvif_alloc(struct device *parent, domid_t domid, | |||
306 | vif->domid = domid; | 308 | vif->domid = domid; |
307 | vif->handle = handle; | 309 | vif->handle = handle; |
308 | vif->can_sg = 1; | 310 | vif->can_sg = 1; |
309 | vif->csum = 1; | 311 | vif->ip_csum = 1; |
310 | vif->dev = dev; | 312 | vif->dev = dev; |
311 | 313 | ||
312 | vif->credit_bytes = vif->remaining_credit = ~0UL; | 314 | vif->credit_bytes = vif->remaining_credit = ~0UL; |
@@ -316,7 +318,9 @@ struct xenvif *xenvif_alloc(struct device *parent, domid_t domid, | |||
316 | vif->credit_timeout.expires = jiffies; | 318 | vif->credit_timeout.expires = jiffies; |
317 | 319 | ||
318 | dev->netdev_ops = &xenvif_netdev_ops; | 320 | dev->netdev_ops = &xenvif_netdev_ops; |
319 | dev->hw_features = NETIF_F_SG | NETIF_F_IP_CSUM | NETIF_F_TSO; | 321 | dev->hw_features = NETIF_F_SG | |
322 | NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM | | ||
323 | NETIF_F_TSO; | ||
320 | dev->features = dev->hw_features; | 324 | dev->features = dev->hw_features; |
321 | SET_ETHTOOL_OPS(dev, &xenvif_ethtool_ops); | 325 | SET_ETHTOOL_OPS(dev, &xenvif_ethtool_ops); |
322 | 326 | ||
diff --git a/drivers/net/xen-netback/xenbus.c b/drivers/net/xen-netback/xenbus.c index 1b08d8798372..ad27b15242cd 100644 --- a/drivers/net/xen-netback/xenbus.c +++ b/drivers/net/xen-netback/xenbus.c | |||
@@ -574,7 +574,12 @@ static int connect_rings(struct backend_info *be) | |||
574 | if (xenbus_scanf(XBT_NIL, dev->otherend, "feature-no-csum-offload", | 574 | if (xenbus_scanf(XBT_NIL, dev->otherend, "feature-no-csum-offload", |
575 | "%d", &val) < 0) | 575 | "%d", &val) < 0) |
576 | val = 0; | 576 | val = 0; |
577 | vif->csum = !val; | 577 | vif->ip_csum = !val; |
578 | |||
579 | if (xenbus_scanf(XBT_NIL, dev->otherend, "feature-ipv6-csum-offload", | ||
580 | "%d", &val) < 0) | ||
581 | val = 0; | ||
582 | vif->ipv6_csum = !!val; | ||
578 | 583 | ||
579 | /* Map the shared frame, irq etc. */ | 584 | /* Map the shared frame, irq etc. */ |
580 | err = xenvif_connect(vif, tx_ring_ref, rx_ring_ref, | 585 | err = xenvif_connect(vif, tx_ring_ref, rx_ring_ref, |
diff --git a/include/xen/interface/io/netif.h b/include/xen/interface/io/netif.h index eb262e3324d2..c9e81849fcd7 100644 --- a/include/xen/interface/io/netif.h +++ b/include/xen/interface/io/netif.h | |||
@@ -51,6 +51,13 @@ | |||
51 | */ | 51 | */ |
52 | 52 | ||
53 | /* | 53 | /* |
54 | * "feature-no-csum-offload" should be used to turn IPv4 TCP/UDP checksum | ||
55 | * offload off or on. If it is missing then the feature is assumed to be on. | ||
56 | * "feature-ipv6-csum-offload" should be used to turn IPv6 TCP/UDP checksum | ||
57 | * offload on or off. If it is missing then the feature is assumed to be off. | ||
58 | */ | ||
59 | |||
60 | /* | ||
54 | * This is the 'wire' format for packets: | 61 | * This is the 'wire' format for packets: |
55 | * Request 1: xen_netif_tx_request -- XEN_NETTXF_* (any flags) | 62 | * Request 1: xen_netif_tx_request -- XEN_NETTXF_* (any flags) |
56 | * [Request 2: xen_netif_extra_info] (only if request 1 has XEN_NETTXF_extra_info) | 63 | * [Request 2: xen_netif_extra_info] (only if request 1 has XEN_NETTXF_extra_info) |