aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ixgbe/ixgbe_ethtool.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/ixgbe/ixgbe_ethtool.c')
-rw-r--r--drivers/net/ixgbe/ixgbe_ethtool.c39
1 files changed, 28 insertions, 11 deletions
diff --git a/drivers/net/ixgbe/ixgbe_ethtool.c b/drivers/net/ixgbe/ixgbe_ethtool.c
index a119cbd8dbb8..4e463778bcfd 100644
--- a/drivers/net/ixgbe/ixgbe_ethtool.c
+++ b/drivers/net/ixgbe/ixgbe_ethtool.c
@@ -246,13 +246,26 @@ static int ixgbe_set_tx_csum(struct net_device *netdev, u32 data)
246 246
247static int ixgbe_set_tso(struct net_device *netdev, u32 data) 247static int ixgbe_set_tso(struct net_device *netdev, u32 data)
248{ 248{
249
250 if (data) { 249 if (data) {
251 netdev->features |= NETIF_F_TSO; 250 netdev->features |= NETIF_F_TSO;
252 netdev->features |= NETIF_F_TSO6; 251 netdev->features |= NETIF_F_TSO6;
253 } else { 252 } else {
253#ifdef CONFIG_NETDEVICES_MULTIQUEUE
254 struct ixgbe_adapter *adapter = netdev_priv(netdev);
255 int i;
256#endif
257 netif_stop_queue(netdev);
258#ifdef CONFIG_NETDEVICES_MULTIQUEUE
259 for (i = 0; i < adapter->num_tx_queues; i++)
260 netif_stop_subqueue(netdev, i);
261#endif
254 netdev->features &= ~NETIF_F_TSO; 262 netdev->features &= ~NETIF_F_TSO;
255 netdev->features &= ~NETIF_F_TSO6; 263 netdev->features &= ~NETIF_F_TSO6;
264#ifdef CONFIG_NETDEVICES_MULTIQUEUE
265 for (i = 0; i < adapter->num_tx_queues; i++)
266 netif_start_subqueue(netdev, i);
267#endif
268 netif_start_queue(netdev);
256 } 269 }
257 return 0; 270 return 0;
258} 271}
@@ -873,13 +886,13 @@ static int ixgbe_get_coalesce(struct net_device *netdev,
873{ 886{
874 struct ixgbe_adapter *adapter = netdev_priv(netdev); 887 struct ixgbe_adapter *adapter = netdev_priv(netdev);
875 888
876 if (adapter->rx_eitr == 0) 889 if (adapter->rx_eitr < IXGBE_MIN_ITR_USECS)
877 ec->rx_coalesce_usecs = 0; 890 ec->rx_coalesce_usecs = adapter->rx_eitr;
878 else 891 else
879 ec->rx_coalesce_usecs = 1000000 / adapter->rx_eitr; 892 ec->rx_coalesce_usecs = 1000000 / adapter->rx_eitr;
880 893
881 if (adapter->tx_eitr == 0) 894 if (adapter->tx_eitr < IXGBE_MIN_ITR_USECS)
882 ec->tx_coalesce_usecs = 0; 895 ec->tx_coalesce_usecs = adapter->tx_eitr;
883 else 896 else
884 ec->tx_coalesce_usecs = 1000000 / adapter->tx_eitr; 897 ec->tx_coalesce_usecs = 1000000 / adapter->tx_eitr;
885 898
@@ -893,22 +906,26 @@ static int ixgbe_set_coalesce(struct net_device *netdev,
893 struct ixgbe_adapter *adapter = netdev_priv(netdev); 906 struct ixgbe_adapter *adapter = netdev_priv(netdev);
894 907
895 if ((ec->rx_coalesce_usecs > IXGBE_MAX_ITR_USECS) || 908 if ((ec->rx_coalesce_usecs > IXGBE_MAX_ITR_USECS) ||
896 ((ec->rx_coalesce_usecs > 0) && 909 ((ec->rx_coalesce_usecs != 0) &&
910 (ec->rx_coalesce_usecs != 1) &&
911 (ec->rx_coalesce_usecs != 3) &&
897 (ec->rx_coalesce_usecs < IXGBE_MIN_ITR_USECS))) 912 (ec->rx_coalesce_usecs < IXGBE_MIN_ITR_USECS)))
898 return -EINVAL; 913 return -EINVAL;
899 if ((ec->tx_coalesce_usecs > IXGBE_MAX_ITR_USECS) || 914 if ((ec->tx_coalesce_usecs > IXGBE_MAX_ITR_USECS) ||
900 ((ec->tx_coalesce_usecs > 0) && 915 ((ec->tx_coalesce_usecs != 0) &&
916 (ec->tx_coalesce_usecs != 1) &&
917 (ec->tx_coalesce_usecs != 3) &&
901 (ec->tx_coalesce_usecs < IXGBE_MIN_ITR_USECS))) 918 (ec->tx_coalesce_usecs < IXGBE_MIN_ITR_USECS)))
902 return -EINVAL; 919 return -EINVAL;
903 920
904 /* convert to rate of irq's per second */ 921 /* convert to rate of irq's per second */
905 if (ec->rx_coalesce_usecs == 0) 922 if (ec->rx_coalesce_usecs < IXGBE_MIN_ITR_USECS)
906 adapter->rx_eitr = 0; 923 adapter->rx_eitr = ec->rx_coalesce_usecs;
907 else 924 else
908 adapter->rx_eitr = (1000000 / ec->rx_coalesce_usecs); 925 adapter->rx_eitr = (1000000 / ec->rx_coalesce_usecs);
909 926
910 if (ec->tx_coalesce_usecs == 0) 927 if (ec->tx_coalesce_usecs < IXGBE_MIN_ITR_USECS)
911 adapter->tx_eitr = 0; 928 adapter->tx_eitr = ec->rx_coalesce_usecs;
912 else 929 else
913 adapter->tx_eitr = (1000000 / ec->tx_coalesce_usecs); 930 adapter->tx_eitr = (1000000 / ec->tx_coalesce_usecs);
914 931