diff options
Diffstat (limited to 'drivers/net/xen-netback/interface.c')
-rw-r--r-- | drivers/net/xen-netback/interface.c | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/drivers/net/xen-netback/interface.c b/drivers/net/xen-netback/interface.c index 459935a6bfae..b78ee10a956a 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; |