diff options
author | Paul Durrant <Paul.Durrant@citrix.com> | 2013-10-16 12:50:28 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2013-10-17 15:35:14 -0400 |
commit | 146c8a77d27bcbd7722120f70f51e3b287205d0a (patch) | |
tree | b7ce7bf02f0967015366284281e31468a45508cf /drivers/net/xen-netback/interface.c | |
parent | c0f4ace79e7e5bec0ff065c4afa3eb3329c9384c (diff) |
xen-netback: add support for IPv6 checksum offload to guest
Check xenstore flag feature-ipv6-csum-offload to determine if a
guest is happy to accept IPv6 packets with only partial checksum.
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/interface.c')
-rw-r--r-- | drivers/net/xen-netback/interface.c | 10 |
1 files changed, 7 insertions, 3 deletions
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 | ||