aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/sfc/selftest.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/sfc/selftest.c')
-rw-r--r--drivers/net/sfc/selftest.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/drivers/net/sfc/selftest.c b/drivers/net/sfc/selftest.c
index cbda15946e8f..3b2de9fe7f27 100644
--- a/drivers/net/sfc/selftest.c
+++ b/drivers/net/sfc/selftest.c
@@ -290,7 +290,7 @@ void efx_loopback_rx_packet(struct efx_nic *efx,
290 290
291 payload = &state->payload; 291 payload = &state->payload;
292 292
293 received = (struct efx_loopback_payload *)(char *) buf_ptr; 293 received = (struct efx_loopback_payload *) buf_ptr;
294 received->ip.saddr = payload->ip.saddr; 294 received->ip.saddr = payload->ip.saddr;
295 received->ip.check = payload->ip.check; 295 received->ip.check = payload->ip.check;
296 296
@@ -424,10 +424,10 @@ static int efx_tx_loopback(struct efx_tx_queue *tx_queue)
424 * interrupt handler. */ 424 * interrupt handler. */
425 smp_wmb(); 425 smp_wmb();
426 426
427 if (NET_DEV_REGISTERED(efx)) 427 if (efx_dev_registered(efx))
428 netif_tx_lock_bh(efx->net_dev); 428 netif_tx_lock_bh(efx->net_dev);
429 rc = efx_xmit(efx, tx_queue, skb); 429 rc = efx_xmit(efx, tx_queue, skb);
430 if (NET_DEV_REGISTERED(efx)) 430 if (efx_dev_registered(efx))
431 netif_tx_unlock_bh(efx->net_dev); 431 netif_tx_unlock_bh(efx->net_dev);
432 432
433 if (rc != NETDEV_TX_OK) { 433 if (rc != NETDEV_TX_OK) {
@@ -453,7 +453,7 @@ static int efx_rx_loopback(struct efx_tx_queue *tx_queue,
453 int tx_done = 0, rx_good, rx_bad; 453 int tx_done = 0, rx_good, rx_bad;
454 int i, rc = 0; 454 int i, rc = 0;
455 455
456 if (NET_DEV_REGISTERED(efx)) 456 if (efx_dev_registered(efx))
457 netif_tx_lock_bh(efx->net_dev); 457 netif_tx_lock_bh(efx->net_dev);
458 458
459 /* Count the number of tx completions, and decrement the refcnt. Any 459 /* Count the number of tx completions, and decrement the refcnt. Any
@@ -465,7 +465,7 @@ static int efx_rx_loopback(struct efx_tx_queue *tx_queue,
465 dev_kfree_skb_any(skb); 465 dev_kfree_skb_any(skb);
466 } 466 }
467 467
468 if (NET_DEV_REGISTERED(efx)) 468 if (efx_dev_registered(efx))
469 netif_tx_unlock_bh(efx->net_dev); 469 netif_tx_unlock_bh(efx->net_dev);
470 470
471 /* Check TX completion and received packet counts */ 471 /* Check TX completion and received packet counts */
@@ -517,6 +517,8 @@ efx_test_loopback(struct efx_tx_queue *tx_queue,
517 state->packet_count = min(1 << (i << 2), state->packet_count); 517 state->packet_count = min(1 << (i << 2), state->packet_count);
518 state->skbs = kzalloc(sizeof(state->skbs[0]) * 518 state->skbs = kzalloc(sizeof(state->skbs[0]) *
519 state->packet_count, GFP_KERNEL); 519 state->packet_count, GFP_KERNEL);
520 if (!state->skbs)
521 return -ENOMEM;
520 state->flush = 0; 522 state->flush = 0;
521 523
522 EFX_LOG(efx, "TX queue %d testing %s loopback with %d " 524 EFX_LOG(efx, "TX queue %d testing %s loopback with %d "
@@ -700,7 +702,7 @@ int efx_offline_test(struct efx_nic *efx,
700 * "flushing" so all inflight packets are dropped */ 702 * "flushing" so all inflight packets are dropped */
701 BUG_ON(efx->loopback_selftest); 703 BUG_ON(efx->loopback_selftest);
702 state->flush = 1; 704 state->flush = 1;
703 efx->loopback_selftest = (void *)state; 705 efx->loopback_selftest = state;
704 706
705 rc = efx_test_loopbacks(efx, tests, loopback_modes); 707 rc = efx_test_loopbacks(efx, tests, loopback_modes);
706 708