瀏覽代碼

sfc: Stop the TX queues during loopback self-tests

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>
Neil Turton 14 年之前
父節點
當前提交
9d1aea62e4
共有 3 個文件被更改,包括 5 次插入2 次删除
  1. 1 1
      drivers/net/sfc/efx.c
  2. 2 0
      drivers/net/sfc/selftest.c
  3. 2 1
      drivers/net/sfc/tx.c

+ 1 - 1
drivers/net/sfc/efx.c

@@ -1436,7 +1436,7 @@ static void efx_start_all(struct efx_nic *efx)
 	 * restart the transmit interface early so the watchdog timer stops */
 	 * restart the transmit interface early so the watchdog timer stops */
 	efx_start_port(efx);
 	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);
 		netif_tx_wake_all_queues(efx->net_dev);
 
 
 	efx_for_each_channel(channel, efx)
 	efx_for_each_channel(channel, efx)

+ 2 - 0
drivers/net/sfc/selftest.c

@@ -770,6 +770,8 @@ int efx_selftest(struct efx_nic *efx, struct efx_self_tests *tests,
 	__efx_reconfigure_port(efx);
 	__efx_reconfigure_port(efx);
 	mutex_unlock(&efx->mac_lock);
 	mutex_unlock(&efx->mac_lock);
 
 
+	netif_tx_wake_all_queues(efx->net_dev);
+
 	return rc_test;
 	return rc_test;
 }
 }
 
 

+ 2 - 1
drivers/net/sfc/tx.c

@@ -435,7 +435,8 @@ void efx_xmit_done(struct efx_tx_queue *tx_queue, unsigned int index)
 	 * queue state. */
 	 * queue state. */
 	smp_mb();
 	smp_mb();
 	if (unlikely(netif_tx_queue_stopped(tx_queue->core_txq)) &&
 	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;
 		fill_level = tx_queue->insert_count - tx_queue->read_count;
 		if (fill_level < EFX_TXQ_THRESHOLD(efx)) {
 		if (fill_level < EFX_TXQ_THRESHOLD(efx)) {
 			EFX_BUG_ON_PARANOID(!efx_dev_registered(efx));
 			EFX_BUG_ON_PARANOID(!efx_dev_registered(efx));