diff options
Diffstat (limited to 'drivers/net/xen-netback/interface.c')
-rw-r--r-- | drivers/net/xen-netback/interface.c | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/drivers/net/xen-netback/interface.c b/drivers/net/xen-netback/interface.c index 459935a6bfae..2329cccf1fa6 100644 --- a/drivers/net/xen-netback/interface.c +++ b/drivers/net/xen-netback/interface.c | |||
@@ -214,10 +214,14 @@ static netdev_features_t xenvif_fix_features(struct net_device *dev, | |||
214 | 214 | ||
215 | if (!vif->can_sg) | 215 | if (!vif->can_sg) |
216 | features &= ~NETIF_F_SG; | 216 | features &= ~NETIF_F_SG; |
217 | if (!vif->gso && !vif->gso_prefix) | 217 | if (~(vif->gso_mask | vif->gso_prefix_mask) & GSO_BIT(TCPV4)) |
218 | features &= ~NETIF_F_TSO; | 218 | features &= ~NETIF_F_TSO; |
219 | if (!vif->csum) | 219 | if (~(vif->gso_mask | vif->gso_prefix_mask) & GSO_BIT(TCPV6)) |
220 | features &= ~NETIF_F_TSO6; | ||
221 | if (!vif->ip_csum) | ||
220 | features &= ~NETIF_F_IP_CSUM; | 222 | features &= ~NETIF_F_IP_CSUM; |
223 | if (!vif->ipv6_csum) | ||
224 | features &= ~NETIF_F_IPV6_CSUM; | ||
221 | 225 | ||
222 | return features; | 226 | return features; |
223 | } | 227 | } |
@@ -306,7 +310,7 @@ struct xenvif *xenvif_alloc(struct device *parent, domid_t domid, | |||
306 | vif->domid = domid; | 310 | vif->domid = domid; |
307 | vif->handle = handle; | 311 | vif->handle = handle; |
308 | vif->can_sg = 1; | 312 | vif->can_sg = 1; |
309 | vif->csum = 1; | 313 | vif->ip_csum = 1; |
310 | vif->dev = dev; | 314 | vif->dev = dev; |
311 | 315 | ||
312 | vif->credit_bytes = vif->remaining_credit = ~0UL; | 316 | vif->credit_bytes = vif->remaining_credit = ~0UL; |
@@ -315,8 +319,10 @@ struct xenvif *xenvif_alloc(struct device *parent, domid_t domid, | |||
315 | vif->credit_window_start = get_jiffies_64(); | 319 | vif->credit_window_start = get_jiffies_64(); |
316 | 320 | ||
317 | dev->netdev_ops = &xenvif_netdev_ops; | 321 | dev->netdev_ops = &xenvif_netdev_ops; |
318 | dev->hw_features = NETIF_F_SG | NETIF_F_IP_CSUM | NETIF_F_TSO; | 322 | dev->hw_features = NETIF_F_SG | |
319 | dev->features = dev->hw_features; | 323 | NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM | |
324 | NETIF_F_TSO | NETIF_F_TSO6; | ||
325 | dev->features = dev->hw_features | NETIF_F_RXCSUM; | ||
320 | SET_ETHTOOL_OPS(dev, &xenvif_ethtool_ops); | 326 | SET_ETHTOOL_OPS(dev, &xenvif_ethtool_ops); |
321 | 327 | ||
322 | dev->tx_queue_len = XENVIF_QUEUE_LENGTH; | 328 | dev->tx_queue_len = XENVIF_QUEUE_LENGTH; |
@@ -455,6 +461,9 @@ void xenvif_disconnect(struct xenvif *vif) | |||
455 | if (netif_carrier_ok(vif->dev)) | 461 | if (netif_carrier_ok(vif->dev)) |
456 | xenvif_carrier_off(vif); | 462 | xenvif_carrier_off(vif); |
457 | 463 | ||
464 | if (vif->task) | ||
465 | kthread_stop(vif->task); | ||
466 | |||
458 | if (vif->tx_irq) { | 467 | if (vif->tx_irq) { |
459 | if (vif->tx_irq == vif->rx_irq) | 468 | if (vif->tx_irq == vif->rx_irq) |
460 | unbind_from_irqhandler(vif->tx_irq, vif); | 469 | unbind_from_irqhandler(vif->tx_irq, vif); |
@@ -465,9 +474,6 @@ void xenvif_disconnect(struct xenvif *vif) | |||
465 | vif->tx_irq = 0; | 474 | vif->tx_irq = 0; |
466 | } | 475 | } |
467 | 476 | ||
468 | if (vif->task) | ||
469 | kthread_stop(vif->task); | ||
470 | |||
471 | xenvif_unmap_frontend_rings(vif); | 477 | xenvif_unmap_frontend_rings(vif); |
472 | } | 478 | } |
473 | 479 | ||