aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/sfc
diff options
context:
space:
mode:
authorSteve Hodgson <shodgson@solarflare.com>2011-05-23 07:18:45 -0400
committerBen Hutchings <bhutchings@solarflare.com>2012-02-15 19:25:07 -0500
commita606f4325dca6950996abbae452d33f2af095f39 (patch)
tree5d39056ca66b6be3190ff9df902eb404acc17eda /drivers/net/ethernet/sfc
parent90893000e21e2d52a0a9d5aa0c4234c90bcd9470 (diff)
sfc: Disable flow control during flushes
The TX DMA engine issues upstream read requests when there is room in the TX FIFO for the completion. However, the fetches for the rest of the packet might be delayed by any back pressure. Since a flush must wait for an EOP, the entire flush may be delayed by back pressure. Mitigate this by disabling flow control before the flushes are started. Since PF and VF flushes run in parallel introduce fc_disable, a reference count of the number of flushes outstanding. The same principle could be applied to Falcon, but that would bring with it its own testing. Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Diffstat (limited to 'drivers/net/ethernet/sfc')
-rw-r--r--drivers/net/ethernet/sfc/mcdi_mac.c2
-rw-r--r--drivers/net/ethernet/sfc/net_driver.h4
-rw-r--r--drivers/net/ethernet/sfc/nic.c3
3 files changed, 9 insertions, 0 deletions
diff --git a/drivers/net/ethernet/sfc/mcdi_mac.c b/drivers/net/ethernet/sfc/mcdi_mac.c
index f67cf921bd1b..98afe1c1165d 100644
--- a/drivers/net/ethernet/sfc/mcdi_mac.c
+++ b/drivers/net/ethernet/sfc/mcdi_mac.c
@@ -44,6 +44,8 @@ static int efx_mcdi_set_mac(struct efx_nic *efx)
44 } 44 }
45 if (efx->wanted_fc & EFX_FC_AUTO) 45 if (efx->wanted_fc & EFX_FC_AUTO)
46 fcntl = MC_CMD_FCNTL_AUTO; 46 fcntl = MC_CMD_FCNTL_AUTO;
47 if (efx->fc_disable)
48 fcntl = MC_CMD_FCNTL_OFF;
47 49
48 MCDI_SET_DWORD(cmdbytes, SET_MAC_IN_FCNTL, fcntl); 50 MCDI_SET_DWORD(cmdbytes, SET_MAC_IN_FCNTL, fcntl);
49 51
diff --git a/drivers/net/ethernet/sfc/net_driver.h b/drivers/net/ethernet/sfc/net_driver.h
index 18c4b3c245e2..f52687741508 100644
--- a/drivers/net/ethernet/sfc/net_driver.h
+++ b/drivers/net/ethernet/sfc/net_driver.h
@@ -670,6 +670,9 @@ struct efx_filter_state;
670 * @promiscuous: Promiscuous flag. Protected by netif_tx_lock. 670 * @promiscuous: Promiscuous flag. Protected by netif_tx_lock.
671 * @multicast_hash: Multicast hash table 671 * @multicast_hash: Multicast hash table
672 * @wanted_fc: Wanted flow control flags 672 * @wanted_fc: Wanted flow control flags
673 * @fc_disable: When non-zero flow control is disabled. Typically used to
674 * ensure that network back pressure doesn't delay dma queue flushes.
675 * Serialised by the rtnl lock.
673 * @mac_work: Work item for changing MAC promiscuity and multicast hash 676 * @mac_work: Work item for changing MAC promiscuity and multicast hash
674 * @loopback_mode: Loopback status 677 * @loopback_mode: Loopback status
675 * @loopback_modes: Supported loopback mode bitmask 678 * @loopback_modes: Supported loopback mode bitmask
@@ -769,6 +772,7 @@ struct efx_nic {
769 bool promiscuous; 772 bool promiscuous;
770 union efx_multicast_hash multicast_hash; 773 union efx_multicast_hash multicast_hash;
771 u8 wanted_fc; 774 u8 wanted_fc;
775 unsigned fc_disable;
772 776
773 atomic_t rx_reset; 777 atomic_t rx_reset;
774 enum efx_loopback_mode loopback_mode; 778 enum efx_loopback_mode loopback_mode;
diff --git a/drivers/net/ethernet/sfc/nic.c b/drivers/net/ethernet/sfc/nic.c
index 539b57441e80..1bb41fff3edc 100644
--- a/drivers/net/ethernet/sfc/nic.c
+++ b/drivers/net/ethernet/sfc/nic.c
@@ -677,6 +677,7 @@ int efx_nic_flush_queues(struct efx_nic *efx)
677 struct efx_tx_queue *tx_queue; 677 struct efx_tx_queue *tx_queue;
678 int rc = 0; 678 int rc = 0;
679 679
680 efx->fc_disable++;
680 efx->type->prepare_flush(efx); 681 efx->type->prepare_flush(efx);
681 682
682 efx_for_each_channel(channel, efx) { 683 efx_for_each_channel(channel, efx) {
@@ -727,6 +728,8 @@ int efx_nic_flush_queues(struct efx_nic *efx)
727 atomic_set(&efx->rxq_flush_outstanding, 0); 728 atomic_set(&efx->rxq_flush_outstanding, 0);
728 } 729 }
729 730
731 efx->fc_disable--;
732
730 return rc; 733 return rc;
731} 734}
732 735