efx_test_loopback() used "|" to combine the results of the RX and TX
phases. If both phases fail with different error codes, this results
in a bogus error code.
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
struct efx_nic *efx = tx_queue->efx;
struct efx_selftest_state *state = efx->loopback_selftest;
struct efx_channel *channel;
struct efx_nic *efx = tx_queue->efx;
struct efx_selftest_state *state = efx->loopback_selftest;
struct efx_channel *channel;
for (i = 0; i < loopback_test_level; i++) {
/* Determine how many packets to send */
for (i = 0; i < loopback_test_level; i++) {
/* Determine how many packets to send */
state->packet_count);
efx_iterate_state(efx);
state->packet_count);
efx_iterate_state(efx);
- rc = efx_tx_loopback(tx_queue);
+ tx_rc = efx_tx_loopback(tx_queue);
/* NAPI polling is not enabled, so process channels synchronously */
schedule_timeout_uninterruptible(HZ / 50);
/* NAPI polling is not enabled, so process channels synchronously */
schedule_timeout_uninterruptible(HZ / 50);
efx_process_channel_now(channel);
}
efx_process_channel_now(channel);
}
- rc |= efx_rx_loopback(tx_queue, lb_tests);
+ rx_rc = efx_rx_loopback(tx_queue, lb_tests);
/* Wait a while to ensure there are no packets
* floating around after a failure. */
schedule_timeout_uninterruptible(HZ / 10);
/* Wait a while to ensure there are no packets
* floating around after a failure. */
schedule_timeout_uninterruptible(HZ / 10);
+ return tx_rc ? tx_rc : rx_rc;
"of %d packets\n", tx_queue->queue, LOOPBACK_MODE(efx),
state->packet_count);
"of %d packets\n", tx_queue->queue, LOOPBACK_MODE(efx),
state->packet_count);
}
static int efx_test_loopbacks(struct efx_nic *efx,
}
static int efx_test_loopbacks(struct efx_nic *efx,