Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

bnx2x: Enhanced self test

Added registers, memories, loopback, nvram, interrupt and link tests to
the self-test

Signed-off-by: Yitchak Gertner <gertner@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Yitchak Gertner and committed by
David S. Miller
f3c87cdd 755735eb

+488 -10
+488 -10
drivers/net/bnx2x_main.c
··· 8313 8313 return 0; 8314 8314 } 8315 8315 8316 - static struct { 8316 + static const struct { 8317 8317 char string[ETH_GSTRING_LEN]; 8318 8318 } bnx2x_tests_str_arr[BNX2X_NUM_TESTS] = { 8319 - { "MC Errors (online)" } 8319 + { "register_test (offline)" }, 8320 + { "memory_test (offline)" }, 8321 + { "loopback_test (offline)" }, 8322 + { "nvram_test (online)" }, 8323 + { "interrupt_test (online)" }, 8324 + { "link_test (online)" }, 8325 + { "idle check (online)" }, 8326 + { "MC errors (online)" } 8320 8327 }; 8321 8328 8322 8329 static int bnx2x_self_test_count(struct net_device *dev) ··· 8331 8324 return BNX2X_NUM_TESTS; 8332 8325 } 8333 8326 8327 + static int bnx2x_test_registers(struct bnx2x *bp) 8328 + { 8329 + int idx, i, rc = -ENODEV; 8330 + u32 wr_val = 0; 8331 + static const struct { 8332 + u32 offset0; 8333 + u32 offset1; 8334 + u32 mask; 8335 + } reg_tbl[] = { 8336 + /* 0 */ { BRB1_REG_PAUSE_LOW_THRESHOLD_0, 4, 0x000003ff }, 8337 + { DORQ_REG_DB_ADDR0, 4, 0xffffffff }, 8338 + { HC_REG_AGG_INT_0, 4, 0x000003ff }, 8339 + { PBF_REG_MAC_IF0_ENABLE, 4, 0x00000001 }, 8340 + { PBF_REG_P0_INIT_CRD, 4, 0x000007ff }, 8341 + { PRS_REG_CID_PORT_0, 4, 0x00ffffff }, 8342 + { PXP2_REG_PSWRQ_CDU0_L2P, 4, 0x000fffff }, 8343 + { PXP2_REG_RQ_CDU0_EFIRST_MEM_ADDR, 8, 0x0003ffff }, 8344 + { PXP2_REG_PSWRQ_TM0_L2P, 4, 0x000fffff }, 8345 + { PXP2_REG_RQ_USDM0_EFIRST_MEM_ADDR, 8, 0x0003ffff }, 8346 + /* 10 */ { PXP2_REG_PSWRQ_TSDM0_L2P, 4, 0x000fffff }, 8347 + { QM_REG_CONNNUM_0, 4, 0x000fffff }, 8348 + { TM_REG_LIN0_MAX_ACTIVE_CID, 4, 0x0003ffff }, 8349 + { SRC_REG_KEYRSS0_0, 40, 0xffffffff }, 8350 + { SRC_REG_KEYRSS0_7, 40, 0xffffffff }, 8351 + { XCM_REG_WU_DA_SET_TMR_CNT_FLG_CMD00, 4, 0x00000001 }, 8352 + { XCM_REG_WU_DA_CNT_CMD00, 4, 0x00000003 }, 8353 + { XCM_REG_GLB_DEL_ACK_MAX_CNT_0, 4, 0x000000ff }, 8354 + { NIG_REG_EGRESS_MNG0_FIFO, 20, 0xffffffff }, 8355 + { NIG_REG_LLH0_T_BIT, 4, 0x00000001 }, 8356 + /* 20 */ { NIG_REG_EMAC0_IN_EN, 4, 0x00000001 }, 8357 + { NIG_REG_BMAC0_IN_EN, 4, 0x00000001 }, 8358 + { NIG_REG_XCM0_OUT_EN, 4, 0x00000001 }, 8359 + { NIG_REG_BRB0_OUT_EN, 4, 0x00000001 }, 8360 + { NIG_REG_LLH0_XCM_MASK, 4, 0x00000007 }, 8361 + { NIG_REG_LLH0_ACPI_PAT_6_LEN, 68, 0x000000ff }, 8362 + { NIG_REG_LLH0_ACPI_PAT_0_CRC, 68, 0xffffffff }, 8363 + { NIG_REG_LLH0_DEST_MAC_0_0, 160, 0xffffffff }, 8364 + { NIG_REG_LLH0_DEST_IP_0_1, 160, 0xffffffff }, 8365 + { NIG_REG_LLH0_IPV4_IPV6_0, 160, 0x00000001 }, 8366 + /* 30 */ { NIG_REG_LLH0_DEST_UDP_0, 160, 0x0000ffff }, 8367 + { NIG_REG_LLH0_DEST_TCP_0, 160, 0x0000ffff }, 8368 + { NIG_REG_LLH0_VLAN_ID_0, 160, 0x00000fff }, 8369 + { NIG_REG_XGXS_SERDES0_MODE_SEL, 4, 0x00000001 }, 8370 + { NIG_REG_LED_CONTROL_OVERRIDE_TRAFFIC_P0, 4, 0x00000001 }, 8371 + { NIG_REG_STATUS_INTERRUPT_PORT0, 4, 0x07ffffff }, 8372 + { NIG_REG_XGXS0_CTRL_EXTREMOTEMDIOST, 24, 0x00000001 }, 8373 + { NIG_REG_SERDES0_CTRL_PHY_ADDR, 16, 0x0000001f }, 8374 + 8375 + { 0xffffffff, 0, 0x00000000 } 8376 + }; 8377 + 8378 + if (!netif_running(bp->dev)) 8379 + return rc; 8380 + 8381 + /* Repeat the test twice: 8382 + First by writing 0x00000000, second by writing 0xffffffff */ 8383 + for (idx = 0; idx < 2; idx++) { 8384 + 8385 + switch (idx) { 8386 + case 0: 8387 + wr_val = 0; 8388 + break; 8389 + case 1: 8390 + wr_val = 0xffffffff; 8391 + break; 8392 + } 8393 + 8394 + for (i = 0; reg_tbl[i].offset0 != 0xffffffff; i++) { 8395 + u32 offset, mask, save_val, val; 8396 + int port = BP_PORT(bp); 8397 + 8398 + offset = reg_tbl[i].offset0 + port*reg_tbl[i].offset1; 8399 + mask = reg_tbl[i].mask; 8400 + 8401 + save_val = REG_RD(bp, offset); 8402 + 8403 + REG_WR(bp, offset, wr_val); 8404 + val = REG_RD(bp, offset); 8405 + 8406 + /* Restore the original register's value */ 8407 + REG_WR(bp, offset, save_val); 8408 + 8409 + /* verify that value is as expected value */ 8410 + if ((val & mask) != (wr_val & mask)) 8411 + goto test_reg_exit; 8412 + } 8413 + } 8414 + 8415 + rc = 0; 8416 + 8417 + test_reg_exit: 8418 + return rc; 8419 + } 8420 + 8421 + static int bnx2x_test_memory(struct bnx2x *bp) 8422 + { 8423 + int i, j, rc = -ENODEV; 8424 + u32 val; 8425 + static const struct { 8426 + u32 offset; 8427 + int size; 8428 + } mem_tbl[] = { 8429 + { CCM_REG_XX_DESCR_TABLE, CCM_REG_XX_DESCR_TABLE_SIZE }, 8430 + { CFC_REG_ACTIVITY_COUNTER, CFC_REG_ACTIVITY_COUNTER_SIZE }, 8431 + { CFC_REG_LINK_LIST, CFC_REG_LINK_LIST_SIZE }, 8432 + { DMAE_REG_CMD_MEM, DMAE_REG_CMD_MEM_SIZE }, 8433 + { TCM_REG_XX_DESCR_TABLE, TCM_REG_XX_DESCR_TABLE_SIZE }, 8434 + { UCM_REG_XX_DESCR_TABLE, UCM_REG_XX_DESCR_TABLE_SIZE }, 8435 + { XCM_REG_XX_DESCR_TABLE, XCM_REG_XX_DESCR_TABLE_SIZE }, 8436 + 8437 + { 0xffffffff, 0 } 8438 + }; 8439 + static const struct { 8440 + char *name; 8441 + u32 offset; 8442 + u32 mask; 8443 + } prty_tbl[] = { 8444 + { "CCM_REG_CCM_PRTY_STS", CCM_REG_CCM_PRTY_STS, 0 }, 8445 + { "CFC_REG_CFC_PRTY_STS", CFC_REG_CFC_PRTY_STS, 0 }, 8446 + { "DMAE_REG_DMAE_PRTY_STS", DMAE_REG_DMAE_PRTY_STS, 0 }, 8447 + { "TCM_REG_TCM_PRTY_STS", TCM_REG_TCM_PRTY_STS, 0 }, 8448 + { "UCM_REG_UCM_PRTY_STS", UCM_REG_UCM_PRTY_STS, 0 }, 8449 + { "XCM_REG_XCM_PRTY_STS", XCM_REG_XCM_PRTY_STS, 0x1 }, 8450 + 8451 + { NULL, 0xffffffff, 0 } 8452 + }; 8453 + 8454 + if (!netif_running(bp->dev)) 8455 + return rc; 8456 + 8457 + /* Go through all the memories */ 8458 + for (i = 0; mem_tbl[i].offset != 0xffffffff; i++) 8459 + for (j = 0; j < mem_tbl[i].size; j++) 8460 + REG_RD(bp, mem_tbl[i].offset + j*4); 8461 + 8462 + /* Check the parity status */ 8463 + for (i = 0; prty_tbl[i].offset != 0xffffffff; i++) { 8464 + val = REG_RD(bp, prty_tbl[i].offset); 8465 + if (val & ~(prty_tbl[i].mask)) { 8466 + DP(NETIF_MSG_HW, 8467 + "%s is 0x%x\n", prty_tbl[i].name, val); 8468 + goto test_mem_exit; 8469 + } 8470 + } 8471 + 8472 + rc = 0; 8473 + 8474 + test_mem_exit: 8475 + return rc; 8476 + } 8477 + 8478 + static void bnx2x_netif_start(struct bnx2x *bp) 8479 + { 8480 + int i; 8481 + 8482 + if (atomic_dec_and_test(&bp->intr_sem)) { 8483 + if (netif_running(bp->dev)) { 8484 + bnx2x_int_enable(bp); 8485 + for_each_queue(bp, i) 8486 + napi_enable(&bnx2x_fp(bp, i, napi)); 8487 + if (bp->state == BNX2X_STATE_OPEN) 8488 + netif_wake_queue(bp->dev); 8489 + } 8490 + } 8491 + } 8492 + 8493 + static void bnx2x_netif_stop(struct bnx2x *bp) 8494 + { 8495 + int i; 8496 + 8497 + if (netif_running(bp->dev)) { 8498 + netif_tx_disable(bp->dev); 8499 + bp->dev->trans_start = jiffies; /* prevent tx timeout */ 8500 + for_each_queue(bp, i) 8501 + napi_disable(&bnx2x_fp(bp, i, napi)); 8502 + } 8503 + bnx2x_int_disable_sync(bp); 8504 + } 8505 + 8506 + static void bnx2x_wait_for_link(struct bnx2x *bp, u8 link_up) 8507 + { 8508 + int cnt = 1000; 8509 + 8510 + if (link_up) 8511 + while (bnx2x_link_test(bp) && cnt--) 8512 + msleep(10); 8513 + } 8514 + 8515 + static int bnx2x_run_loopback(struct bnx2x *bp, int loopback_mode, u8 link_up) 8516 + { 8517 + unsigned int pkt_size, num_pkts, i; 8518 + struct sk_buff *skb; 8519 + unsigned char *packet; 8520 + struct bnx2x_fastpath *fp = &bp->fp[0]; 8521 + u16 tx_start_idx, tx_idx; 8522 + u16 rx_start_idx, rx_idx; 8523 + u16 pkt_prod; 8524 + struct sw_tx_bd *tx_buf; 8525 + struct eth_tx_bd *tx_bd; 8526 + dma_addr_t mapping; 8527 + union eth_rx_cqe *cqe; 8528 + u8 cqe_fp_flags; 8529 + struct sw_rx_bd *rx_buf; 8530 + u16 len; 8531 + int rc = -ENODEV; 8532 + 8533 + if (loopback_mode == BNX2X_MAC_LOOPBACK) { 8534 + bp->link_params.loopback_mode = LOOPBACK_BMAC; 8535 + bnx2x_phy_hw_lock(bp); 8536 + bnx2x_phy_init(&bp->link_params, &bp->link_vars); 8537 + bnx2x_phy_hw_unlock(bp); 8538 + 8539 + } else if (loopback_mode == BNX2X_PHY_LOOPBACK) { 8540 + bp->link_params.loopback_mode = LOOPBACK_XGXS_10; 8541 + bnx2x_phy_hw_lock(bp); 8542 + bnx2x_phy_init(&bp->link_params, &bp->link_vars); 8543 + bnx2x_phy_hw_unlock(bp); 8544 + /* wait until link state is restored */ 8545 + bnx2x_wait_for_link(bp, link_up); 8546 + 8547 + } else 8548 + return -EINVAL; 8549 + 8550 + pkt_size = 1514; 8551 + skb = netdev_alloc_skb(bp->dev, bp->rx_buf_size); 8552 + if (!skb) { 8553 + rc = -ENOMEM; 8554 + goto test_loopback_exit; 8555 + } 8556 + packet = skb_put(skb, pkt_size); 8557 + memcpy(packet, bp->dev->dev_addr, ETH_ALEN); 8558 + memset(packet + ETH_ALEN, 0, (ETH_HLEN - ETH_ALEN)); 8559 + for (i = ETH_HLEN; i < pkt_size; i++) 8560 + packet[i] = (unsigned char) (i & 0xff); 8561 + 8562 + num_pkts = 0; 8563 + tx_start_idx = le16_to_cpu(*fp->tx_cons_sb); 8564 + rx_start_idx = le16_to_cpu(*fp->rx_cons_sb); 8565 + 8566 + pkt_prod = fp->tx_pkt_prod++; 8567 + tx_buf = &fp->tx_buf_ring[TX_BD(pkt_prod)]; 8568 + tx_buf->first_bd = fp->tx_bd_prod; 8569 + tx_buf->skb = skb; 8570 + 8571 + tx_bd = &fp->tx_desc_ring[TX_BD(fp->tx_bd_prod)]; 8572 + mapping = pci_map_single(bp->pdev, skb->data, 8573 + skb_headlen(skb), PCI_DMA_TODEVICE); 8574 + tx_bd->addr_hi = cpu_to_le32(U64_HI(mapping)); 8575 + tx_bd->addr_lo = cpu_to_le32(U64_LO(mapping)); 8576 + tx_bd->nbd = cpu_to_le16(1); 8577 + tx_bd->nbytes = cpu_to_le16(skb_headlen(skb)); 8578 + tx_bd->vlan = cpu_to_le16(pkt_prod); 8579 + tx_bd->bd_flags.as_bitfield = (ETH_TX_BD_FLAGS_START_BD | 8580 + ETH_TX_BD_FLAGS_END_BD); 8581 + tx_bd->general_data = ((UNICAST_ADDRESS << 8582 + ETH_TX_BD_ETH_ADDR_TYPE_SHIFT) | 1); 8583 + 8584 + fp->hw_tx_prods->bds_prod = 8585 + cpu_to_le16(le16_to_cpu(fp->hw_tx_prods->bds_prod) + 1); 8586 + mb(); /* FW restriction: must not reorder writing nbd and packets */ 8587 + fp->hw_tx_prods->packets_prod = 8588 + cpu_to_le32(le32_to_cpu(fp->hw_tx_prods->packets_prod) + 1); 8589 + DOORBELL(bp, FP_IDX(fp), 0); 8590 + 8591 + mmiowb(); 8592 + 8593 + num_pkts++; 8594 + fp->tx_bd_prod++; 8595 + bp->dev->trans_start = jiffies; 8596 + 8597 + udelay(100); 8598 + 8599 + tx_idx = le16_to_cpu(*fp->tx_cons_sb); 8600 + if (tx_idx != tx_start_idx + num_pkts) 8601 + goto test_loopback_exit; 8602 + 8603 + rx_idx = le16_to_cpu(*fp->rx_cons_sb); 8604 + if (rx_idx != rx_start_idx + num_pkts) 8605 + goto test_loopback_exit; 8606 + 8607 + cqe = &fp->rx_comp_ring[RCQ_BD(fp->rx_comp_cons)]; 8608 + cqe_fp_flags = cqe->fast_path_cqe.type_error_flags; 8609 + if (CQE_TYPE(cqe_fp_flags) || (cqe_fp_flags & ETH_RX_ERROR_FALGS)) 8610 + goto test_loopback_rx_exit; 8611 + 8612 + len = le16_to_cpu(cqe->fast_path_cqe.pkt_len); 8613 + if (len != pkt_size) 8614 + goto test_loopback_rx_exit; 8615 + 8616 + rx_buf = &fp->rx_buf_ring[RX_BD(fp->rx_bd_cons)]; 8617 + skb = rx_buf->skb; 8618 + skb_reserve(skb, cqe->fast_path_cqe.placement_offset); 8619 + for (i = ETH_HLEN; i < pkt_size; i++) 8620 + if (*(skb->data + i) != (unsigned char) (i & 0xff)) 8621 + goto test_loopback_rx_exit; 8622 + 8623 + rc = 0; 8624 + 8625 + test_loopback_rx_exit: 8626 + bp->dev->last_rx = jiffies; 8627 + 8628 + fp->rx_bd_cons = NEXT_RX_IDX(fp->rx_bd_cons); 8629 + fp->rx_bd_prod = NEXT_RX_IDX(fp->rx_bd_prod); 8630 + fp->rx_comp_cons = NEXT_RCQ_IDX(fp->rx_comp_cons); 8631 + fp->rx_comp_prod = NEXT_RCQ_IDX(fp->rx_comp_prod); 8632 + 8633 + /* Update producers */ 8634 + bnx2x_update_rx_prod(bp, fp, fp->rx_bd_prod, fp->rx_comp_prod, 8635 + fp->rx_sge_prod); 8636 + mmiowb(); /* keep prod updates ordered */ 8637 + 8638 + test_loopback_exit: 8639 + bp->link_params.loopback_mode = LOOPBACK_NONE; 8640 + 8641 + return rc; 8642 + } 8643 + 8644 + static int bnx2x_test_loopback(struct bnx2x *bp, u8 link_up) 8645 + { 8646 + int rc = 0; 8647 + 8648 + if (!netif_running(bp->dev)) 8649 + return BNX2X_LOOPBACK_FAILED; 8650 + 8651 + bnx2x_netif_stop(bp); 8652 + 8653 + if (bnx2x_run_loopback(bp, BNX2X_MAC_LOOPBACK, link_up)) { 8654 + DP(NETIF_MSG_PROBE, "MAC loopback failed\n"); 8655 + rc |= BNX2X_MAC_LOOPBACK_FAILED; 8656 + } 8657 + 8658 + if (bnx2x_run_loopback(bp, BNX2X_PHY_LOOPBACK, link_up)) { 8659 + DP(NETIF_MSG_PROBE, "PHY loopback failed\n"); 8660 + rc |= BNX2X_PHY_LOOPBACK_FAILED; 8661 + } 8662 + 8663 + bnx2x_netif_start(bp); 8664 + 8665 + return rc; 8666 + } 8667 + 8668 + #define CRC32_RESIDUAL 0xdebb20e3 8669 + 8670 + static int bnx2x_test_nvram(struct bnx2x *bp) 8671 + { 8672 + static const struct { 8673 + int offset; 8674 + int size; 8675 + } nvram_tbl[] = { 8676 + { 0, 0x14 }, /* bootstrap */ 8677 + { 0x14, 0xec }, /* dir */ 8678 + { 0x100, 0x350 }, /* manuf_info */ 8679 + { 0x450, 0xf0 }, /* feature_info */ 8680 + { 0x640, 0x64 }, /* upgrade_key_info */ 8681 + { 0x6a4, 0x64 }, 8682 + { 0x708, 0x70 }, /* manuf_key_info */ 8683 + { 0x778, 0x70 }, 8684 + { 0, 0 } 8685 + }; 8686 + u32 buf[0x350 / 4]; 8687 + u8 *data = (u8 *)buf; 8688 + int i, rc; 8689 + u32 magic, csum; 8690 + 8691 + rc = bnx2x_nvram_read(bp, 0, data, 4); 8692 + if (rc) { 8693 + DP(NETIF_MSG_PROBE, "magic value read (rc -%d)\n", -rc); 8694 + goto test_nvram_exit; 8695 + } 8696 + 8697 + magic = be32_to_cpu(buf[0]); 8698 + if (magic != 0x669955aa) { 8699 + DP(NETIF_MSG_PROBE, "magic value (0x%08x)\n", magic); 8700 + rc = -ENODEV; 8701 + goto test_nvram_exit; 8702 + } 8703 + 8704 + for (i = 0; nvram_tbl[i].size; i++) { 8705 + 8706 + rc = bnx2x_nvram_read(bp, nvram_tbl[i].offset, data, 8707 + nvram_tbl[i].size); 8708 + if (rc) { 8709 + DP(NETIF_MSG_PROBE, 8710 + "nvram_tbl[%d] read data (rc -%d)\n", i, -rc); 8711 + goto test_nvram_exit; 8712 + } 8713 + 8714 + csum = ether_crc_le(nvram_tbl[i].size, data); 8715 + if (csum != CRC32_RESIDUAL) { 8716 + DP(NETIF_MSG_PROBE, 8717 + "nvram_tbl[%d] csum value (0x%08x)\n", i, csum); 8718 + rc = -ENODEV; 8719 + goto test_nvram_exit; 8720 + } 8721 + } 8722 + 8723 + test_nvram_exit: 8724 + return rc; 8725 + } 8726 + 8727 + static int bnx2x_test_intr(struct bnx2x *bp) 8728 + { 8729 + struct mac_configuration_cmd *config = bnx2x_sp(bp, mac_config); 8730 + int i, rc; 8731 + 8732 + if (!netif_running(bp->dev)) 8733 + return -ENODEV; 8734 + 8735 + config->hdr.length_6b = 0; 8736 + config->hdr.offset = 0; 8737 + config->hdr.client_id = BP_CL_ID(bp); 8738 + config->hdr.reserved1 = 0; 8739 + 8740 + rc = bnx2x_sp_post(bp, RAMROD_CMD_ID_ETH_SET_MAC, 0, 8741 + U64_HI(bnx2x_sp_mapping(bp, mac_config)), 8742 + U64_LO(bnx2x_sp_mapping(bp, mac_config)), 0); 8743 + if (rc == 0) { 8744 + bp->set_mac_pending++; 8745 + for (i = 0; i < 10; i++) { 8746 + if (!bp->set_mac_pending) 8747 + break; 8748 + msleep_interruptible(10); 8749 + } 8750 + if (i == 10) 8751 + rc = -ENODEV; 8752 + } 8753 + 8754 + return rc; 8755 + } 8756 + 8334 8757 static void bnx2x_self_test(struct net_device *dev, 8335 8758 struct ethtool_test *etest, u64 *buf) 8336 8759 { 8337 8760 struct bnx2x *bp = netdev_priv(dev); 8338 - int stats_state; 8339 8761 8340 8762 memset(buf, 0, sizeof(u64) * BNX2X_NUM_TESTS); 8341 8763 8342 - if (bp->state != BNX2X_STATE_OPEN) { 8343 - DP(NETIF_MSG_PROBE, "state is %x, returning\n", bp->state); 8764 + if (!netif_running(dev)) 8344 8765 return; 8766 + 8767 + /* offline tests are not suppoerted in MF mode */ 8768 + if (IS_E1HMF(bp)) 8769 + etest->flags &= ~ETH_TEST_FL_OFFLINE; 8770 + 8771 + if (etest->flags & ETH_TEST_FL_OFFLINE) { 8772 + u8 link_up; 8773 + 8774 + link_up = bp->link_vars.link_up; 8775 + bnx2x_nic_unload(bp, UNLOAD_NORMAL); 8776 + bnx2x_nic_load(bp, LOAD_DIAG); 8777 + /* wait until link state is restored */ 8778 + bnx2x_wait_for_link(bp, link_up); 8779 + 8780 + if (bnx2x_test_registers(bp) != 0) { 8781 + buf[0] = 1; 8782 + etest->flags |= ETH_TEST_FL_FAILED; 8783 + } 8784 + if (bnx2x_test_memory(bp) != 0) { 8785 + buf[1] = 1; 8786 + etest->flags |= ETH_TEST_FL_FAILED; 8787 + } 8788 + buf[2] = bnx2x_test_loopback(bp, link_up); 8789 + if (buf[2] != 0) 8790 + etest->flags |= ETH_TEST_FL_FAILED; 8791 + 8792 + bnx2x_nic_unload(bp, UNLOAD_NORMAL); 8793 + bnx2x_nic_load(bp, LOAD_NORMAL); 8794 + /* wait until link state is restored */ 8795 + bnx2x_wait_for_link(bp, link_up); 8345 8796 } 8346 - 8347 - stats_state = bp->stats_state; 8348 - 8349 - if (bnx2x_mc_assert(bp) != 0) { 8350 - buf[0] = 1; 8797 + if (bnx2x_test_nvram(bp) != 0) { 8798 + buf[3] = 1; 8351 8799 etest->flags |= ETH_TEST_FL_FAILED; 8352 8800 } 8801 + if (bnx2x_test_intr(bp) != 0) { 8802 + buf[4] = 1; 8803 + etest->flags |= ETH_TEST_FL_FAILED; 8804 + } 8805 + if (bp->port.pmf) 8806 + if (bnx2x_link_test(bp) != 0) { 8807 + buf[5] = 1; 8808 + etest->flags |= ETH_TEST_FL_FAILED; 8809 + } 8810 + buf[7] = bnx2x_mc_assert(bp); 8811 + if (buf[7] != 0) 8812 + etest->flags |= ETH_TEST_FL_FAILED; 8813 + 8814 + #ifdef BNX2X_EXTRA_DEBUG 8815 + bnx2x_panic_dump(bp); 8816 + #endif 8353 8817 } 8354 8818 8355 8819 static const struct {