Skip to content

Commit

Permalink
sfc: Stop the TX queues during loopback self-tests
Browse files Browse the repository at this point in the history
If the TX queues are running during loopback self tests, host
traffic gets looped back which causes the test to fail.  Avoid
restarting the TX queues after the port reset so that any packets
sent by the host get held back until after the tests have completed.

[bwh: Also wake all TX queues at the end of self-tests.]

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
  • Loading branch information
Neil Turton authored and Ben Hutchings committed Apr 12, 2011
1 parent 4a9f65f commit 9d1aea6
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion drivers/net/sfc/efx.c
Original file line number Diff line number Diff line change
Expand Up @@ -1436,7 +1436,7 @@ static void efx_start_all(struct efx_nic *efx)
* restart the transmit interface early so the watchdog timer stops */
efx_start_port(efx);

if (efx_dev_registered(efx))
if (efx_dev_registered(efx) && !efx->port_inhibited)
netif_tx_wake_all_queues(efx->net_dev);

efx_for_each_channel(channel, efx)
Expand Down
2 changes: 2 additions & 0 deletions drivers/net/sfc/selftest.c
Original file line number Diff line number Diff line change
Expand Up @@ -770,6 +770,8 @@ int efx_selftest(struct efx_nic *efx, struct efx_self_tests *tests,
__efx_reconfigure_port(efx);
mutex_unlock(&efx->mac_lock);

netif_tx_wake_all_queues(efx->net_dev);

return rc_test;
}

3 changes: 2 additions & 1 deletion drivers/net/sfc/tx.c
Original file line number Diff line number Diff line change
Expand Up @@ -435,7 +435,8 @@ void efx_xmit_done(struct efx_tx_queue *tx_queue, unsigned int index)
* queue state. */
smp_mb();
if (unlikely(netif_tx_queue_stopped(tx_queue->core_txq)) &&
likely(efx->port_enabled)) {
likely(efx->port_enabled) &&
likely(!efx->port_inhibited)) {
fill_level = tx_queue->insert_count - tx_queue->read_count;
if (fill_level < EFX_TXQ_THRESHOLD(efx)) {
EFX_BUG_ON_PARANOID(!efx_dev_registered(efx));
Expand Down

0 comments on commit 9d1aea6

Please sign in to comment.