sfc: Implement TSO for TCP/IPv6
Subsystems (2)
PATCH 11/12 sfc: Implement TSO for TCP/IPv6
Signed-off-by Ben Hutchings <[email protected]>
--- drivers/net/sfc/efx.c | 2 + drivers/net/sfc/ethtool.c | 20 ++++++++++++++++- drivers/net/sfc/tx.c | 52 +++++++++++++++++++++++++++++++++----------- 3 files changed, 60 insertions(+), 14 deletions(-)
drivers/net/sfc/efx.c +2 -0
@@ -2208,6 +2208,8 @@ static int __devinit efx_pci_probe(struct pci_dev *pci_dev, net_dev->features |= (type->offload_features |NETIF_F_SG |NETIF_F_HIGHDMA |NETIF_F_TSO |NETIF_F_GRO ); +if (type->offload_features &NETIF_F_V6_CSUM ) + net_dev->features |=NETIF_F_TSO6 ;/* Mask for features that also apply to VLAN devices */ net_dev->vlan_features |= (NETIF_F_ALL_CSUM |NETIF_F_SG |NETIF_F_HIGHDMA |NETIF_F_TSO );
drivers/net/sfc/ethtool.c +19 -1
@@ -471,6 +471,23 @@ static void efx_ethtool_get_stats(struct net_device *net_dev, } } +static int efx_ethtool_set_tso (struct net_device *net_dev,u32 enable) +{ + struct efx_nic *efx __attribute__ ((unused)) = netdev_priv(net_dev); +unsigned long features; + + features =NETIF_F_TSO ; +if (efx->type->offload_features &NETIF_F_V6_CSUM ) + features |=NETIF_F_TSO6 ; + +if (enable) + net_dev->features |= features; +else + net_dev->features &= ~features; + +return 0 ; +} +static int efx_ethtool_set_tx_csum (struct net_device *net_dev,u32 enable) {struct efx_nic *efx =netdev_priv (net_dev);
@@ -834,7 +851,8 @@ const struct ethtool_ops efx_ethtool_ops = { .get_sg = ethtool_op_get_sg, .set_sg = ethtool_op_set_sg, .get_tso = ethtool_op_get_tso, - .set_tso = ethtool_op_set_tso, +/* Need to enable/disable TSO-IPv6 too */ + .set_tso = efx_ethtool_set_tso, .get_flags = ethtool_op_get_flags, .set_flags = ethtool_op_set_flags, .get_sset_count = efx_ethtool_get_sset_count,
drivers/net/sfc/tx.c +39 -13
125 lines not on this page · raw message
Signature · 9 lines
1.6.5.3 -- Ben Hutchings, Senior Software Engineer, Solarflare Communications Not speaking for my employer; that's the marketing department's job. They asked us to note that Solarflare product names are trademarked.
From: Ben Hutchings <[email protected]>
Date: Mon, 30 Nov 2009 01:16:05 +0000
Quoted 1 line
Signed-off-by Ben Hutchings <[email protected]>
Applied.