aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/xen-netback/interface.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/xen-netback/interface.c')
-rw-r--r--drivers/net/xen-netback/interface.c25
1 files changed, 15 insertions, 10 deletions
diff --git a/drivers/net/xen-netback/interface.c b/drivers/net/xen-netback/interface.c
index 01bb854c7f62..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,18 +310,19 @@ 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;
313 vif->credit_usec = 0UL; 317 vif->credit_usec = 0UL;
314 init_timer(&vif->credit_timeout); 318 init_timer(&vif->credit_timeout);
315 /* Initialize 'expires' now: it's used to track the credit window. */ 319 vif->credit_window_start = get_jiffies_64();
316 vif->credit_timeout.expires = jiffies;
317 320
318 dev->netdev_ops = &xenvif_netdev_ops; 321 dev->netdev_ops = &xenvif_netdev_ops;
319 dev->hw_features = NETIF_F_SG | NETIF_F_IP_CSUM | NETIF_F_TSO; 322 dev->hw_features = NETIF_F_SG |
320 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;
321 SET_ETHTOOL_OPS(dev, &xenvif_ethtool_ops); 326 SET_ETHTOOL_OPS(dev, &xenvif_ethtool_ops);
322 327
323 dev->tx_queue_len = XENVIF_QUEUE_LENGTH; 328 dev->tx_queue_len = XENVIF_QUEUE_LENGTH;
@@ -456,6 +461,9 @@ void xenvif_disconnect(struct xenvif *vif)
456 if (netif_carrier_ok(vif->dev)) 461 if (netif_carrier_ok(vif->dev))
457 xenvif_carrier_off(vif); 462 xenvif_carrier_off(vif);
458 463
464 if (vif->task)
465 kthread_stop(vif->task);
466
459 if (vif->tx_irq) { 467 if (vif->tx_irq) {
460 if (vif->tx_irq == vif->rx_irq) 468 if (vif->tx_irq == vif->rx_irq)
461 unbind_from_irqhandler(vif->tx_irq, vif); 469 unbind_from_irqhandler(vif->tx_irq, vif);
@@ -466,9 +474,6 @@ void xenvif_disconnect(struct xenvif *vif)
466 vif->tx_irq = 0; 474 vif->tx_irq = 0;
467 } 475 }
468 476
469 if (vif->task)
470 kthread_stop(vif->task);
471
472 xenvif_unmap_frontend_rings(vif); 477 xenvif_unmap_frontend_rings(vif);
473} 478}
474 479