sfc: Self-test reporting cleanup
Removed log messages that are redundant with calling functions. Fixed bitwise or-ing of return codes. Signed-off-by: Ben Hutchings <bhutchings@solarflare.com> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
This commit is contained in:
parent
e9713e6f4e
commit
f8ea0b6743
@ -566,8 +566,8 @@ static int efx_test_loopbacks(struct efx_nic *efx,
|
|||||||
struct ethtool_cmd ecmd, ecmd_loopback;
|
struct ethtool_cmd ecmd, ecmd_loopback;
|
||||||
struct efx_tx_queue *tx_queue;
|
struct efx_tx_queue *tx_queue;
|
||||||
enum efx_loopback_mode old_mode, mode;
|
enum efx_loopback_mode old_mode, mode;
|
||||||
int count, rc = 0, link_up;
|
int count, rc, link_up;
|
||||||
|
|
||||||
rc = efx_ethtool_get_settings(efx->net_dev, &ecmd);
|
rc = efx_ethtool_get_settings(efx->net_dev, &ecmd);
|
||||||
if (rc) {
|
if (rc) {
|
||||||
EFX_ERR(efx, "could not get GMII settings\n");
|
EFX_ERR(efx, "could not get GMII settings\n");
|
||||||
@ -641,8 +641,8 @@ static int efx_test_loopbacks(struct efx_nic *efx,
|
|||||||
efx_for_each_tx_queue(tx_queue, efx) {
|
efx_for_each_tx_queue(tx_queue, efx) {
|
||||||
state->offload_csum = (tx_queue->queue ==
|
state->offload_csum = (tx_queue->queue ==
|
||||||
EFX_TX_QUEUE_OFFLOAD_CSUM);
|
EFX_TX_QUEUE_OFFLOAD_CSUM);
|
||||||
rc |= efx_test_loopback(tx_queue,
|
rc = efx_test_loopback(tx_queue,
|
||||||
&tests->loopback[mode]);
|
&tests->loopback[mode]);
|
||||||
if (rc)
|
if (rc)
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
@ -668,22 +668,20 @@ static int efx_test_loopbacks(struct efx_nic *efx,
|
|||||||
int efx_online_test(struct efx_nic *efx, struct efx_self_tests *tests)
|
int efx_online_test(struct efx_nic *efx, struct efx_self_tests *tests)
|
||||||
{
|
{
|
||||||
struct efx_channel *channel;
|
struct efx_channel *channel;
|
||||||
int rc = 0;
|
int rc;
|
||||||
|
|
||||||
EFX_LOG(efx, "performing online self-tests\n");
|
rc = efx_test_interrupts(efx, tests);
|
||||||
|
if (rc)
|
||||||
rc |= efx_test_interrupts(efx, tests);
|
return rc;
|
||||||
efx_for_each_channel(channel, efx) {
|
efx_for_each_channel(channel, efx) {
|
||||||
if (channel->has_interrupt)
|
if (channel->has_interrupt)
|
||||||
rc |= efx_test_eventq_irq(channel, tests);
|
rc = efx_test_eventq_irq(channel, tests);
|
||||||
else
|
else
|
||||||
rc |= efx_test_eventq(channel, tests);
|
rc = efx_test_eventq(channel, tests);
|
||||||
|
if (rc)
|
||||||
|
return rc;
|
||||||
}
|
}
|
||||||
rc |= efx_test_phy(efx, tests);
|
rc = efx_test_phy(efx, tests);
|
||||||
|
|
||||||
if (rc)
|
|
||||||
EFX_ERR(efx, "failed online self-tests\n");
|
|
||||||
|
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -693,16 +691,12 @@ int efx_offline_test(struct efx_nic *efx,
|
|||||||
struct efx_self_tests *tests, unsigned int loopback_modes)
|
struct efx_self_tests *tests, unsigned int loopback_modes)
|
||||||
{
|
{
|
||||||
struct efx_selftest_state *state;
|
struct efx_selftest_state *state;
|
||||||
int rc = 0;
|
int rc;
|
||||||
|
|
||||||
EFX_LOG(efx, "performing offline self-tests\n");
|
|
||||||
|
|
||||||
/* Create a selftest_state structure to hold state for the test */
|
/* Create a selftest_state structure to hold state for the test */
|
||||||
state = kzalloc(sizeof(*state), GFP_KERNEL);
|
state = kzalloc(sizeof(*state), GFP_KERNEL);
|
||||||
if (state == NULL) {
|
if (state == NULL)
|
||||||
rc = -ENOMEM;
|
return -ENOMEM;
|
||||||
goto out;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Set the port loopback_selftest member. From this point on
|
/* Set the port loopback_selftest member. From this point on
|
||||||
* all received packets will be dropped. Mark the state as
|
* all received packets will be dropped. Mark the state as
|
||||||
@ -717,10 +711,6 @@ int efx_offline_test(struct efx_nic *efx,
|
|||||||
wmb();
|
wmb();
|
||||||
kfree(state);
|
kfree(state);
|
||||||
|
|
||||||
out:
|
|
||||||
if (rc)
|
|
||||||
EFX_ERR(efx, "failed offline self-tests\n");
|
|
||||||
|
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user