diff options
author | Ben Hutchings <bhutchings@solarflare.com> | 2008-05-07 07:51:12 -0400 |
---|---|---|
committer | Jeff Garzik <jgarzik@redhat.com> | 2008-05-13 01:31:40 -0400 |
commit | b9b39b625cf57cd0ea998717598b68963cbec3cb (patch) | |
tree | 19f358d15b6c75d660cf1ea369559f58ad9f0c1e /drivers/net/sfc/ethtool.c | |
parent | 48cfb14f8b89d4d5b3df6c16f08b258686fb12ad (diff) |
[netdrvr] sfc: Add TSO support
The SFC4000 controller does not have hardware support for TSO, and the
core GSO code incurs a high cost in allocating and freeing skbs. This
TSO implementation uses lightweight packet header structures and is
substantially faster.
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
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, |