diff options
Diffstat (limited to 'drivers/net/sfc/ethtool.c')
-rw-r--r-- | drivers/net/sfc/ethtool.c | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/drivers/net/sfc/ethtool.c b/drivers/net/sfc/ethtool.c index ad541badbd98..b756840e2a16 100644 --- a/drivers/net/sfc/ethtool.c +++ b/drivers/net/sfc/ethtool.c | |||
@@ -272,6 +272,22 @@ static void efx_ethtool_get_stats(struct net_device *net_dev, | |||
272 | } | 272 | } |
273 | } | 273 | } |
274 | 274 | ||
275 | static int efx_ethtool_set_tso(struct net_device *net_dev, u32 enable) | ||
276 | { | ||
277 | int rc; | ||
278 | |||
279 | /* Our TSO requires TX checksumming, so force TX checksumming | ||
280 | * on when TSO is enabled. | ||
281 | */ | ||
282 | if (enable) { | ||
283 | rc = efx_ethtool_set_tx_csum(net_dev, 1); | ||
284 | if (rc) | ||
285 | return rc; | ||
286 | } | ||
287 | |||
288 | return ethtool_op_set_tso(net_dev, enable); | ||
289 | } | ||
290 | |||
275 | static int efx_ethtool_set_tx_csum(struct net_device *net_dev, u32 enable) | 291 | static int efx_ethtool_set_tx_csum(struct net_device *net_dev, u32 enable) |
276 | { | 292 | { |
277 | struct efx_nic *efx = net_dev->priv; | 293 | struct efx_nic *efx = net_dev->priv; |
@@ -283,6 +299,15 @@ static int efx_ethtool_set_tx_csum(struct net_device *net_dev, u32 enable) | |||
283 | 299 | ||
284 | efx_flush_queues(efx); | 300 | efx_flush_queues(efx); |
285 | 301 | ||
302 | /* Our TSO requires TX checksumming, so disable TSO when | ||
303 | * checksumming is disabled | ||
304 | */ | ||
305 | if (!enable) { | ||
306 | rc = efx_ethtool_set_tso(net_dev, 0); | ||
307 | if (rc) | ||
308 | return rc; | ||
309 | } | ||
310 | |||
286 | return 0; | 311 | return 0; |
287 | } | 312 | } |
288 | 313 | ||
@@ -451,6 +476,8 @@ struct ethtool_ops efx_ethtool_ops = { | |||
451 | .set_tx_csum = efx_ethtool_set_tx_csum, | 476 | .set_tx_csum = efx_ethtool_set_tx_csum, |
452 | .get_sg = ethtool_op_get_sg, | 477 | .get_sg = ethtool_op_get_sg, |
453 | .set_sg = ethtool_op_set_sg, | 478 | .set_sg = ethtool_op_set_sg, |
479 | .get_tso = ethtool_op_get_tso, | ||
480 | .set_tso = efx_ethtool_set_tso, | ||
454 | .get_flags = ethtool_op_get_flags, | 481 | .get_flags = ethtool_op_get_flags, |
455 | .set_flags = ethtool_op_set_flags, | 482 | .set_flags = ethtool_op_set_flags, |
456 | .get_strings = efx_ethtool_get_strings, | 483 | .get_strings = efx_ethtool_get_strings, |