aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ixgbe/ixgbe_ethtool.c
diff options
context:
space:
mode:
authorAlexander Duyck <alexander.h.duyck@intel.com>2009-04-27 18:42:37 -0400
committerDavid S. Miller <davem@davemloft.net>2009-04-28 04:53:16 -0400
commitf8212f979f777af2a8e3a9deb0c11a9fcf35e305 (patch)
tree4b92bdc66e3ed82208a8dcc28b3b9a0511621669 /drivers/net/ixgbe/ixgbe_ethtool.c
parent45a5ead0220cc7cc70f6961879decffbd0a54cc0 (diff)
ixgbe: enable HW RSC for 82599
This patch enables hardware receive side coalescing for 82599 hardware. 82599 can merge multiple frames from the same TCP/IP flow into a single structure that can span one ore more descriptors. The accumulated data is arranged similar to how jumbo frames are arranged with the exception that other packets can be interlaced inbetween. To overcome this issue a next pointer is included in the written back descriptor which indicates the next descriptor in the writeback sequence. This feature sets the NETIF_F_LRO flag and clearing it via the ethtool set flags operation will also disable hardware RSC. Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ixgbe/ixgbe_ethtool.c')
-rw-r--r--drivers/net/ixgbe/ixgbe_ethtool.c24
1 files changed, 23 insertions, 1 deletions
diff --git a/drivers/net/ixgbe/ixgbe_ethtool.c b/drivers/net/ixgbe/ixgbe_ethtool.c
index a499b6b31ca..d822c92058c 100644
--- a/drivers/net/ixgbe/ixgbe_ethtool.c
+++ b/drivers/net/ixgbe/ixgbe_ethtool.c
@@ -67,6 +67,7 @@ static struct ixgbe_stats ixgbe_gstrings_stats[] = {
67 {"rx_over_errors", IXGBE_STAT(net_stats.rx_over_errors)}, 67 {"rx_over_errors", IXGBE_STAT(net_stats.rx_over_errors)},
68 {"rx_crc_errors", IXGBE_STAT(net_stats.rx_crc_errors)}, 68 {"rx_crc_errors", IXGBE_STAT(net_stats.rx_crc_errors)},
69 {"rx_frame_errors", IXGBE_STAT(net_stats.rx_frame_errors)}, 69 {"rx_frame_errors", IXGBE_STAT(net_stats.rx_frame_errors)},
70 {"hw_rsc_count", IXGBE_STAT(rsc_count)},
70 {"rx_fifo_errors", IXGBE_STAT(net_stats.rx_fifo_errors)}, 71 {"rx_fifo_errors", IXGBE_STAT(net_stats.rx_fifo_errors)},
71 {"rx_missed_errors", IXGBE_STAT(net_stats.rx_missed_errors)}, 72 {"rx_missed_errors", IXGBE_STAT(net_stats.rx_missed_errors)},
72 {"tx_aborted_errors", IXGBE_STAT(net_stats.tx_aborted_errors)}, 73 {"tx_aborted_errors", IXGBE_STAT(net_stats.tx_aborted_errors)},
@@ -1127,6 +1128,27 @@ static int ixgbe_set_coalesce(struct net_device *netdev,
1127 return 0; 1128 return 0;
1128} 1129}
1129 1130
1131static int ixgbe_set_flags(struct net_device *netdev, u32 data)
1132{
1133 struct ixgbe_adapter *adapter = netdev_priv(netdev);
1134
1135 ethtool_op_set_flags(netdev, data);
1136
1137 if (!(adapter->flags & IXGBE_FLAG_RSC_CAPABLE))
1138 return 0;
1139
1140 /* if state changes we need to update adapter->flags and reset */
1141 if ((!!(data & ETH_FLAG_LRO)) !=
1142 (!!(adapter->flags & IXGBE_FLAG_RSC_ENABLED))) {
1143 adapter->flags ^= IXGBE_FLAG_RSC_ENABLED;
1144 if (netif_running(netdev))
1145 ixgbe_reinit_locked(adapter);
1146 else
1147 ixgbe_reset(adapter);
1148 }
1149 return 0;
1150
1151}
1130 1152
1131static const struct ethtool_ops ixgbe_ethtool_ops = { 1153static const struct ethtool_ops ixgbe_ethtool_ops = {
1132 .get_settings = ixgbe_get_settings, 1154 .get_settings = ixgbe_get_settings,
@@ -1161,7 +1183,7 @@ static const struct ethtool_ops ixgbe_ethtool_ops = {
1161 .get_coalesce = ixgbe_get_coalesce, 1183 .get_coalesce = ixgbe_get_coalesce,
1162 .set_coalesce = ixgbe_set_coalesce, 1184 .set_coalesce = ixgbe_set_coalesce,
1163 .get_flags = ethtool_op_get_flags, 1185 .get_flags = ethtool_op_get_flags,
1164 .set_flags = ethtool_op_set_flags, 1186 .set_flags = ixgbe_set_flags,
1165}; 1187};
1166 1188
1167void ixgbe_set_ethtool_ops(struct net_device *netdev) 1189void ixgbe_set_ethtool_ops(struct net_device *netdev)