aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/sfc/ethtool.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/sfc/ethtool.c')
-rw-r--r--drivers/net/sfc/ethtool.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/drivers/net/sfc/ethtool.c b/drivers/net/sfc/ethtool.c
index fd19d6ab97a2..b9291db023bb 100644
--- a/drivers/net/sfc/ethtool.c
+++ b/drivers/net/sfc/ethtool.c
@@ -328,9 +328,10 @@ static int efx_fill_loopback_test(struct efx_nic *efx,
328 unsigned int test_index, 328 unsigned int test_index,
329 struct ethtool_string *strings, u64 *data) 329 struct ethtool_string *strings, u64 *data)
330{ 330{
331 struct efx_channel *channel = efx_get_channel(efx, 0);
331 struct efx_tx_queue *tx_queue; 332 struct efx_tx_queue *tx_queue;
332 333
333 efx_for_each_channel_tx_queue(tx_queue, &efx->channel[0]) { 334 efx_for_each_channel_tx_queue(tx_queue, channel) {
334 efx_fill_test(test_index++, strings, data, 335 efx_fill_test(test_index++, strings, data,
335 &lb_tests->tx_sent[tx_queue->queue], 336 &lb_tests->tx_sent[tx_queue->queue],
336 EFX_TX_QUEUE_NAME(tx_queue), 337 EFX_TX_QUEUE_NAME(tx_queue),
@@ -673,15 +674,15 @@ static int efx_ethtool_get_coalesce(struct net_device *net_dev,
673 struct ethtool_coalesce *coalesce) 674 struct ethtool_coalesce *coalesce)
674{ 675{
675 struct efx_nic *efx = netdev_priv(net_dev); 676 struct efx_nic *efx = netdev_priv(net_dev);
676 struct efx_tx_queue *tx_queue;
677 struct efx_channel *channel; 677 struct efx_channel *channel;
678 678
679 memset(coalesce, 0, sizeof(*coalesce)); 679 memset(coalesce, 0, sizeof(*coalesce));
680 680
681 /* Find lowest IRQ moderation across all used TX queues */ 681 /* Find lowest IRQ moderation across all used TX queues */
682 coalesce->tx_coalesce_usecs_irq = ~((u32) 0); 682 coalesce->tx_coalesce_usecs_irq = ~((u32) 0);
683 efx_for_each_tx_queue(tx_queue, efx) { 683 efx_for_each_channel(channel, efx) {
684 channel = tx_queue->channel; 684 if (!efx_channel_get_tx_queue(channel, 0))
685 continue;
685 if (channel->irq_moderation < coalesce->tx_coalesce_usecs_irq) { 686 if (channel->irq_moderation < coalesce->tx_coalesce_usecs_irq) {
686 if (channel->channel < efx->n_rx_channels) 687 if (channel->channel < efx->n_rx_channels)
687 coalesce->tx_coalesce_usecs_irq = 688 coalesce->tx_coalesce_usecs_irq =
@@ -708,7 +709,6 @@ static int efx_ethtool_set_coalesce(struct net_device *net_dev,
708{ 709{
709 struct efx_nic *efx = netdev_priv(net_dev); 710 struct efx_nic *efx = netdev_priv(net_dev);
710 struct efx_channel *channel; 711 struct efx_channel *channel;
711 struct efx_tx_queue *tx_queue;
712 unsigned tx_usecs, rx_usecs, adaptive; 712 unsigned tx_usecs, rx_usecs, adaptive;
713 713
714 if (coalesce->use_adaptive_tx_coalesce) 714 if (coalesce->use_adaptive_tx_coalesce)
@@ -725,8 +725,9 @@ static int efx_ethtool_set_coalesce(struct net_device *net_dev,
725 adaptive = coalesce->use_adaptive_rx_coalesce; 725 adaptive = coalesce->use_adaptive_rx_coalesce;
726 726
727 /* If the channel is shared only allow RX parameters to be set */ 727 /* If the channel is shared only allow RX parameters to be set */
728 efx_for_each_tx_queue(tx_queue, efx) { 728 efx_for_each_channel(channel, efx) {
729 if ((tx_queue->channel->channel < efx->n_rx_channels) && 729 if (efx_channel_get_rx_queue(channel) &&
730 efx_channel_get_tx_queue(channel, 0) &&
730 tx_usecs) { 731 tx_usecs) {
731 netif_err(efx, drv, efx->net_dev, "Channel is shared. " 732 netif_err(efx, drv, efx->net_dev, "Channel is shared. "
732 "Only RX coalescing may be set\n"); 733 "Only RX coalescing may be set\n");