.. | .. |
---|
1 | 1 | /******************************************************************* |
---|
2 | 2 | * This file is part of the Emulex Linux Device Driver for * |
---|
3 | 3 | * Fibre Channel Host Bus Adapters. * |
---|
4 | | - * Copyright (C) 2017-2018 Broadcom. All Rights Reserved. The term * |
---|
| 4 | + * Copyright (C) 2017-2019 Broadcom. All Rights Reserved. The term * |
---|
5 | 5 | * “Broadcom” refers to Broadcom Inc. and/or its subsidiaries. * |
---|
6 | 6 | * Copyright (C) 2007-2015 Emulex. All rights reserved. * |
---|
7 | 7 | * EMULEX and SLI are trademarks of Emulex. * |
---|
.. | .. |
---|
31 | 31 | #include <linux/pci.h> |
---|
32 | 32 | #include <linux/spinlock.h> |
---|
33 | 33 | #include <linux/ctype.h> |
---|
| 34 | +#include <linux/vmalloc.h> |
---|
34 | 35 | |
---|
35 | 36 | #include <scsi/scsi.h> |
---|
36 | 37 | #include <scsi/scsi_device.h> |
---|
37 | 38 | #include <scsi/scsi_host.h> |
---|
38 | 39 | #include <scsi/scsi_transport_fc.h> |
---|
39 | 40 | #include <scsi/fc/fc_fs.h> |
---|
40 | | - |
---|
41 | | -#include <linux/nvme-fc-driver.h> |
---|
42 | 41 | |
---|
43 | 42 | #include "lpfc_hw4.h" |
---|
44 | 43 | #include "lpfc_hw.h" |
---|
.. | .. |
---|
49 | 48 | #include "lpfc.h" |
---|
50 | 49 | #include "lpfc_scsi.h" |
---|
51 | 50 | #include "lpfc_nvme.h" |
---|
52 | | -#include "lpfc_nvmet.h" |
---|
53 | 51 | #include "lpfc_logmsg.h" |
---|
54 | 52 | #include "lpfc_crtn.h" |
---|
55 | 53 | #include "lpfc_vport.h" |
---|
.. | .. |
---|
361 | 359 | phys = ((uint64_t)hbq_buf->dbuf.phys & 0xffffffff); |
---|
362 | 360 | if (phys == le32_to_cpu(hbqe->bde.addrLow)) { |
---|
363 | 361 | len += scnprintf(buf+len, size-len, |
---|
364 | | - "Buf%d: %p %06x\n", i, |
---|
| 362 | + "Buf%d: x%px %06x\n", i, |
---|
365 | 363 | hbq_buf->dbuf.virt, hbq_buf->tag); |
---|
366 | 364 | found = 1; |
---|
367 | 365 | break; |
---|
.. | .. |
---|
379 | 377 | spin_unlock_irq(&phba->hbalock); |
---|
380 | 378 | return len; |
---|
381 | 379 | } |
---|
| 380 | + |
---|
| 381 | +static int lpfc_debugfs_last_xripool; |
---|
| 382 | + |
---|
| 383 | +/** |
---|
| 384 | + * lpfc_debugfs_common_xri_data - Dump Hardware Queue info to a buffer |
---|
| 385 | + * @phba: The HBA to gather host buffer info from. |
---|
| 386 | + * @buf: The buffer to dump log into. |
---|
| 387 | + * @size: The maximum amount of data to process. |
---|
| 388 | + * |
---|
| 389 | + * Description: |
---|
| 390 | + * This routine dumps the Hardware Queue info from the @phba to @buf up to |
---|
| 391 | + * @size number of bytes. A header that describes the current hdwq state will be |
---|
| 392 | + * dumped to @buf first and then info on each hdwq entry will be dumped to @buf |
---|
| 393 | + * until @size bytes have been dumped or all the hdwq info has been dumped. |
---|
| 394 | + * |
---|
| 395 | + * Notes: |
---|
| 396 | + * This routine will rotate through each configured Hardware Queue each |
---|
| 397 | + * time called. |
---|
| 398 | + * |
---|
| 399 | + * Return Value: |
---|
| 400 | + * This routine returns the amount of bytes that were dumped into @buf and will |
---|
| 401 | + * not exceed @size. |
---|
| 402 | + **/ |
---|
| 403 | +static int |
---|
| 404 | +lpfc_debugfs_commonxripools_data(struct lpfc_hba *phba, char *buf, int size) |
---|
| 405 | +{ |
---|
| 406 | + struct lpfc_sli4_hdw_queue *qp; |
---|
| 407 | + int len = 0; |
---|
| 408 | + int i, out; |
---|
| 409 | + unsigned long iflag; |
---|
| 410 | + |
---|
| 411 | + for (i = 0; i < phba->cfg_hdw_queue; i++) { |
---|
| 412 | + if (len > (LPFC_DUMP_MULTIXRIPOOL_SIZE - 80)) |
---|
| 413 | + break; |
---|
| 414 | + qp = &phba->sli4_hba.hdwq[lpfc_debugfs_last_xripool]; |
---|
| 415 | + |
---|
| 416 | + len += scnprintf(buf + len, size - len, "HdwQ %d Info ", i); |
---|
| 417 | + spin_lock_irqsave(&qp->abts_io_buf_list_lock, iflag); |
---|
| 418 | + spin_lock(&qp->io_buf_list_get_lock); |
---|
| 419 | + spin_lock(&qp->io_buf_list_put_lock); |
---|
| 420 | + out = qp->total_io_bufs - (qp->get_io_bufs + qp->put_io_bufs + |
---|
| 421 | + qp->abts_scsi_io_bufs + qp->abts_nvme_io_bufs); |
---|
| 422 | + len += scnprintf(buf + len, size - len, |
---|
| 423 | + "tot:%d get:%d put:%d mt:%d " |
---|
| 424 | + "ABTS scsi:%d nvme:%d Out:%d\n", |
---|
| 425 | + qp->total_io_bufs, qp->get_io_bufs, qp->put_io_bufs, |
---|
| 426 | + qp->empty_io_bufs, qp->abts_scsi_io_bufs, |
---|
| 427 | + qp->abts_nvme_io_bufs, out); |
---|
| 428 | + spin_unlock(&qp->io_buf_list_put_lock); |
---|
| 429 | + spin_unlock(&qp->io_buf_list_get_lock); |
---|
| 430 | + spin_unlock_irqrestore(&qp->abts_io_buf_list_lock, iflag); |
---|
| 431 | + |
---|
| 432 | + lpfc_debugfs_last_xripool++; |
---|
| 433 | + if (lpfc_debugfs_last_xripool >= phba->cfg_hdw_queue) |
---|
| 434 | + lpfc_debugfs_last_xripool = 0; |
---|
| 435 | + } |
---|
| 436 | + |
---|
| 437 | + return len; |
---|
| 438 | +} |
---|
| 439 | + |
---|
| 440 | +/** |
---|
| 441 | + * lpfc_debugfs_multixripools_data - Display multi-XRI pools information |
---|
| 442 | + * @phba: The HBA to gather host buffer info from. |
---|
| 443 | + * @buf: The buffer to dump log into. |
---|
| 444 | + * @size: The maximum amount of data to process. |
---|
| 445 | + * |
---|
| 446 | + * Description: |
---|
| 447 | + * This routine displays current multi-XRI pools information including XRI |
---|
| 448 | + * count in public, private and txcmplq. It also displays current high and |
---|
| 449 | + * low watermark. |
---|
| 450 | + * |
---|
| 451 | + * Return Value: |
---|
| 452 | + * This routine returns the amount of bytes that were dumped into @buf and will |
---|
| 453 | + * not exceed @size. |
---|
| 454 | + **/ |
---|
| 455 | +static int |
---|
| 456 | +lpfc_debugfs_multixripools_data(struct lpfc_hba *phba, char *buf, int size) |
---|
| 457 | +{ |
---|
| 458 | + u32 i; |
---|
| 459 | + u32 hwq_count; |
---|
| 460 | + struct lpfc_sli4_hdw_queue *qp; |
---|
| 461 | + struct lpfc_multixri_pool *multixri_pool; |
---|
| 462 | + struct lpfc_pvt_pool *pvt_pool; |
---|
| 463 | + struct lpfc_pbl_pool *pbl_pool; |
---|
| 464 | + u32 txcmplq_cnt; |
---|
| 465 | + char tmp[LPFC_DEBUG_OUT_LINE_SZ] = {0}; |
---|
| 466 | + |
---|
| 467 | + if (phba->sli_rev != LPFC_SLI_REV4) |
---|
| 468 | + return 0; |
---|
| 469 | + |
---|
| 470 | + if (!phba->sli4_hba.hdwq) |
---|
| 471 | + return 0; |
---|
| 472 | + |
---|
| 473 | + if (!phba->cfg_xri_rebalancing) { |
---|
| 474 | + i = lpfc_debugfs_commonxripools_data(phba, buf, size); |
---|
| 475 | + return i; |
---|
| 476 | + } |
---|
| 477 | + |
---|
| 478 | + /* |
---|
| 479 | + * Pbl: Current number of free XRIs in public pool |
---|
| 480 | + * Pvt: Current number of free XRIs in private pool |
---|
| 481 | + * Busy: Current number of outstanding XRIs |
---|
| 482 | + * HWM: Current high watermark |
---|
| 483 | + * pvt_empty: Incremented by 1 when IO submission fails (no xri) |
---|
| 484 | + * pbl_empty: Incremented by 1 when all pbl_pool are empty during |
---|
| 485 | + * IO submission |
---|
| 486 | + */ |
---|
| 487 | + scnprintf(tmp, sizeof(tmp), |
---|
| 488 | + "HWQ: Pbl Pvt Busy HWM | pvt_empty pbl_empty "); |
---|
| 489 | + if (strlcat(buf, tmp, size) >= size) |
---|
| 490 | + return strnlen(buf, size); |
---|
| 491 | + |
---|
| 492 | +#ifdef LPFC_MXP_STAT |
---|
| 493 | + /* |
---|
| 494 | + * MAXH: Max high watermark seen so far |
---|
| 495 | + * above_lmt: Incremented by 1 if xri_owned > xri_limit during |
---|
| 496 | + * IO submission |
---|
| 497 | + * below_lmt: Incremented by 1 if xri_owned <= xri_limit during |
---|
| 498 | + * IO submission |
---|
| 499 | + * locPbl_hit: Incremented by 1 if successfully get a batch of XRI from |
---|
| 500 | + * local pbl_pool |
---|
| 501 | + * othPbl_hit: Incremented by 1 if successfully get a batch of XRI from |
---|
| 502 | + * other pbl_pool |
---|
| 503 | + */ |
---|
| 504 | + scnprintf(tmp, sizeof(tmp), |
---|
| 505 | + "MAXH above_lmt below_lmt locPbl_hit othPbl_hit"); |
---|
| 506 | + if (strlcat(buf, tmp, size) >= size) |
---|
| 507 | + return strnlen(buf, size); |
---|
| 508 | + |
---|
| 509 | + /* |
---|
| 510 | + * sPbl: snapshot of Pbl 15 sec after stat gets cleared |
---|
| 511 | + * sPvt: snapshot of Pvt 15 sec after stat gets cleared |
---|
| 512 | + * sBusy: snapshot of Busy 15 sec after stat gets cleared |
---|
| 513 | + */ |
---|
| 514 | + scnprintf(tmp, sizeof(tmp), |
---|
| 515 | + " | sPbl sPvt sBusy"); |
---|
| 516 | + if (strlcat(buf, tmp, size) >= size) |
---|
| 517 | + return strnlen(buf, size); |
---|
| 518 | +#endif |
---|
| 519 | + |
---|
| 520 | + scnprintf(tmp, sizeof(tmp), "\n"); |
---|
| 521 | + if (strlcat(buf, tmp, size) >= size) |
---|
| 522 | + return strnlen(buf, size); |
---|
| 523 | + |
---|
| 524 | + hwq_count = phba->cfg_hdw_queue; |
---|
| 525 | + for (i = 0; i < hwq_count; i++) { |
---|
| 526 | + qp = &phba->sli4_hba.hdwq[i]; |
---|
| 527 | + multixri_pool = qp->p_multixri_pool; |
---|
| 528 | + if (!multixri_pool) |
---|
| 529 | + continue; |
---|
| 530 | + pbl_pool = &multixri_pool->pbl_pool; |
---|
| 531 | + pvt_pool = &multixri_pool->pvt_pool; |
---|
| 532 | + txcmplq_cnt = qp->io_wq->pring->txcmplq_cnt; |
---|
| 533 | + |
---|
| 534 | + scnprintf(tmp, sizeof(tmp), |
---|
| 535 | + "%03d: %4d %4d %4d %4d | %10d %10d ", |
---|
| 536 | + i, pbl_pool->count, pvt_pool->count, |
---|
| 537 | + txcmplq_cnt, pvt_pool->high_watermark, |
---|
| 538 | + qp->empty_io_bufs, multixri_pool->pbl_empty_count); |
---|
| 539 | + if (strlcat(buf, tmp, size) >= size) |
---|
| 540 | + break; |
---|
| 541 | + |
---|
| 542 | +#ifdef LPFC_MXP_STAT |
---|
| 543 | + scnprintf(tmp, sizeof(tmp), |
---|
| 544 | + "%4d %10d %10d %10d %10d", |
---|
| 545 | + multixri_pool->stat_max_hwm, |
---|
| 546 | + multixri_pool->above_limit_count, |
---|
| 547 | + multixri_pool->below_limit_count, |
---|
| 548 | + multixri_pool->local_pbl_hit_count, |
---|
| 549 | + multixri_pool->other_pbl_hit_count); |
---|
| 550 | + if (strlcat(buf, tmp, size) >= size) |
---|
| 551 | + break; |
---|
| 552 | + |
---|
| 553 | + scnprintf(tmp, sizeof(tmp), |
---|
| 554 | + " | %4d %4d %5d", |
---|
| 555 | + multixri_pool->stat_pbl_count, |
---|
| 556 | + multixri_pool->stat_pvt_count, |
---|
| 557 | + multixri_pool->stat_busy_count); |
---|
| 558 | + if (strlcat(buf, tmp, size) >= size) |
---|
| 559 | + break; |
---|
| 560 | +#endif |
---|
| 561 | + |
---|
| 562 | + scnprintf(tmp, sizeof(tmp), "\n"); |
---|
| 563 | + if (strlcat(buf, tmp, size) >= size) |
---|
| 564 | + break; |
---|
| 565 | + } |
---|
| 566 | + return strnlen(buf, size); |
---|
| 567 | +} |
---|
| 568 | + |
---|
| 569 | + |
---|
| 570 | +#ifdef LPFC_HDWQ_LOCK_STAT |
---|
| 571 | +static int lpfc_debugfs_last_lock; |
---|
| 572 | + |
---|
| 573 | +/** |
---|
| 574 | + * lpfc_debugfs_lockstat_data - Dump Hardware Queue info to a buffer |
---|
| 575 | + * @phba: The HBA to gather host buffer info from. |
---|
| 576 | + * @buf: The buffer to dump log into. |
---|
| 577 | + * @size: The maximum amount of data to process. |
---|
| 578 | + * |
---|
| 579 | + * Description: |
---|
| 580 | + * This routine dumps the Hardware Queue info from the @phba to @buf up to |
---|
| 581 | + * @size number of bytes. A header that describes the current hdwq state will be |
---|
| 582 | + * dumped to @buf first and then info on each hdwq entry will be dumped to @buf |
---|
| 583 | + * until @size bytes have been dumped or all the hdwq info has been dumped. |
---|
| 584 | + * |
---|
| 585 | + * Notes: |
---|
| 586 | + * This routine will rotate through each configured Hardware Queue each |
---|
| 587 | + * time called. |
---|
| 588 | + * |
---|
| 589 | + * Return Value: |
---|
| 590 | + * This routine returns the amount of bytes that were dumped into @buf and will |
---|
| 591 | + * not exceed @size. |
---|
| 592 | + **/ |
---|
| 593 | +static int |
---|
| 594 | +lpfc_debugfs_lockstat_data(struct lpfc_hba *phba, char *buf, int size) |
---|
| 595 | +{ |
---|
| 596 | + struct lpfc_sli4_hdw_queue *qp; |
---|
| 597 | + int len = 0; |
---|
| 598 | + int i; |
---|
| 599 | + |
---|
| 600 | + if (phba->sli_rev != LPFC_SLI_REV4) |
---|
| 601 | + return 0; |
---|
| 602 | + |
---|
| 603 | + if (!phba->sli4_hba.hdwq) |
---|
| 604 | + return 0; |
---|
| 605 | + |
---|
| 606 | + for (i = 0; i < phba->cfg_hdw_queue; i++) { |
---|
| 607 | + if (len > (LPFC_HDWQINFO_SIZE - 100)) |
---|
| 608 | + break; |
---|
| 609 | + qp = &phba->sli4_hba.hdwq[lpfc_debugfs_last_lock]; |
---|
| 610 | + |
---|
| 611 | + len += scnprintf(buf + len, size - len, "HdwQ %03d Lock ", i); |
---|
| 612 | + if (phba->cfg_xri_rebalancing) { |
---|
| 613 | + len += scnprintf(buf + len, size - len, |
---|
| 614 | + "get_pvt:%d mv_pvt:%d " |
---|
| 615 | + "mv2pub:%d mv2pvt:%d " |
---|
| 616 | + "put_pvt:%d put_pub:%d wq:%d\n", |
---|
| 617 | + qp->lock_conflict.alloc_pvt_pool, |
---|
| 618 | + qp->lock_conflict.mv_from_pvt_pool, |
---|
| 619 | + qp->lock_conflict.mv_to_pub_pool, |
---|
| 620 | + qp->lock_conflict.mv_to_pvt_pool, |
---|
| 621 | + qp->lock_conflict.free_pvt_pool, |
---|
| 622 | + qp->lock_conflict.free_pub_pool, |
---|
| 623 | + qp->lock_conflict.wq_access); |
---|
| 624 | + } else { |
---|
| 625 | + len += scnprintf(buf + len, size - len, |
---|
| 626 | + "get:%d put:%d free:%d wq:%d\n", |
---|
| 627 | + qp->lock_conflict.alloc_xri_get, |
---|
| 628 | + qp->lock_conflict.alloc_xri_put, |
---|
| 629 | + qp->lock_conflict.free_xri, |
---|
| 630 | + qp->lock_conflict.wq_access); |
---|
| 631 | + } |
---|
| 632 | + |
---|
| 633 | + lpfc_debugfs_last_lock++; |
---|
| 634 | + if (lpfc_debugfs_last_lock >= phba->cfg_hdw_queue) |
---|
| 635 | + lpfc_debugfs_last_lock = 0; |
---|
| 636 | + } |
---|
| 637 | + |
---|
| 638 | + return len; |
---|
| 639 | +} |
---|
| 640 | +#endif |
---|
382 | 641 | |
---|
383 | 642 | static int lpfc_debugfs_last_hba_slim_off; |
---|
384 | 643 | |
---|
.. | .. |
---|
552 | 811 | struct lpfc_nodelist *ndlp; |
---|
553 | 812 | unsigned char *statep; |
---|
554 | 813 | struct nvme_fc_local_port *localport; |
---|
555 | | - struct lpfc_nvmet_tgtport *tgtp; |
---|
556 | 814 | struct nvme_fc_remote_port *nrport = NULL; |
---|
557 | 815 | struct lpfc_nvme_rport *rport; |
---|
558 | 816 | |
---|
.. | .. |
---|
648 | 906 | i, ndlp->cmd_qdepth); |
---|
649 | 907 | outio += i; |
---|
650 | 908 | } |
---|
| 909 | + len += scnprintf(buf + len, size - len, "defer:%x ", |
---|
| 910 | + ndlp->nlp_defer_did); |
---|
651 | 911 | len += scnprintf(buf+len, size-len, "\n"); |
---|
652 | 912 | } |
---|
653 | 913 | spin_unlock_irq(shost->host_lock); |
---|
.. | .. |
---|
656 | 916 | "\nOutstanding IO x%x\n", outio); |
---|
657 | 917 | |
---|
658 | 918 | if (phba->nvmet_support && phba->targetport && (vport == phba->pport)) { |
---|
659 | | - tgtp = (struct lpfc_nvmet_tgtport *)phba->targetport->private; |
---|
660 | 919 | len += scnprintf(buf + len, size - len, |
---|
661 | 920 | "\nNVME Targetport Entry ...\n"); |
---|
662 | 921 | |
---|
.. | .. |
---|
773 | 1032 | { |
---|
774 | 1033 | struct lpfc_hba *phba = vport->phba; |
---|
775 | 1034 | struct lpfc_nvmet_tgtport *tgtp; |
---|
776 | | - struct lpfc_nvmet_rcv_ctx *ctxp, *next_ctxp; |
---|
| 1035 | + struct lpfc_async_xchg_ctx *ctxp, *next_ctxp; |
---|
777 | 1036 | struct nvme_fc_local_port *localport; |
---|
778 | | - struct lpfc_nvme_ctrl_stat *cstat; |
---|
| 1037 | + struct lpfc_fc4_ctrl_stat *cstat; |
---|
779 | 1038 | struct lpfc_nvme_lport *lport; |
---|
780 | 1039 | uint64_t data1, data2, data3; |
---|
781 | 1040 | uint64_t tot, totin, totout; |
---|
782 | | - int cnt, i, maxch; |
---|
| 1041 | + int cnt, i; |
---|
783 | 1042 | int len = 0; |
---|
784 | 1043 | |
---|
785 | 1044 | if (phba->nvmet_support) { |
---|
.. | .. |
---|
865 | 1124 | len += scnprintf(buf + len, size - len, "\n"); |
---|
866 | 1125 | |
---|
867 | 1126 | cnt = 0; |
---|
868 | | - spin_lock(&phba->sli4_hba.abts_nvme_buf_list_lock); |
---|
| 1127 | + spin_lock(&phba->sli4_hba.abts_nvmet_buf_list_lock); |
---|
869 | 1128 | list_for_each_entry_safe(ctxp, next_ctxp, |
---|
870 | 1129 | &phba->sli4_hba.lpfc_abts_nvmet_ctx_list, |
---|
871 | 1130 | list) { |
---|
872 | 1131 | cnt++; |
---|
873 | 1132 | } |
---|
874 | | - spin_unlock(&phba->sli4_hba.abts_nvme_buf_list_lock); |
---|
| 1133 | + spin_unlock(&phba->sli4_hba.abts_nvmet_buf_list_lock); |
---|
875 | 1134 | if (cnt) { |
---|
876 | 1135 | len += scnprintf(buf + len, size - len, |
---|
877 | 1136 | "ABORT: %d ctx entries\n", cnt); |
---|
878 | | - spin_lock(&phba->sli4_hba.abts_nvme_buf_list_lock); |
---|
| 1137 | + spin_lock(&phba->sli4_hba.abts_nvmet_buf_list_lock); |
---|
879 | 1138 | list_for_each_entry_safe(ctxp, next_ctxp, |
---|
880 | 1139 | &phba->sli4_hba.lpfc_abts_nvmet_ctx_list, |
---|
881 | 1140 | list) { |
---|
.. | .. |
---|
887 | 1146 | ctxp->oxid, ctxp->state, |
---|
888 | 1147 | ctxp->flag); |
---|
889 | 1148 | } |
---|
890 | | - spin_unlock(&phba->sli4_hba.abts_nvme_buf_list_lock); |
---|
| 1149 | + spin_unlock(&phba->sli4_hba.abts_nvmet_buf_list_lock); |
---|
891 | 1150 | } |
---|
892 | 1151 | |
---|
893 | 1152 | /* Calculate outstanding IOs */ |
---|
.. | .. |
---|
903 | 1162 | phba->sli4_hba.nvmet_io_wait_total, |
---|
904 | 1163 | tot); |
---|
905 | 1164 | } else { |
---|
906 | | - if (!(phba->cfg_enable_fc4_type & LPFC_ENABLE_NVME)) |
---|
| 1165 | + if (!(vport->cfg_enable_fc4_type & LPFC_ENABLE_NVME)) |
---|
907 | 1166 | return len; |
---|
908 | 1167 | |
---|
909 | 1168 | localport = vport->localport; |
---|
.. | .. |
---|
914 | 1173 | return len; |
---|
915 | 1174 | |
---|
916 | 1175 | len += scnprintf(buf + len, size - len, |
---|
917 | | - "\nNVME Lport Statistics\n"); |
---|
| 1176 | + "\nNVME HDWQ Statistics\n"); |
---|
918 | 1177 | |
---|
919 | 1178 | len += scnprintf(buf + len, size - len, |
---|
920 | 1179 | "LS: Xmt %016x Cmpl %016x\n", |
---|
921 | 1180 | atomic_read(&lport->fc4NvmeLsRequests), |
---|
922 | 1181 | atomic_read(&lport->fc4NvmeLsCmpls)); |
---|
923 | 1182 | |
---|
924 | | - if (phba->cfg_nvme_io_channel < 32) |
---|
925 | | - maxch = phba->cfg_nvme_io_channel; |
---|
926 | | - else |
---|
927 | | - maxch = 32; |
---|
928 | 1183 | totin = 0; |
---|
929 | 1184 | totout = 0; |
---|
930 | | - for (i = 0; i < phba->cfg_nvme_io_channel; i++) { |
---|
931 | | - cstat = &lport->cstat[i]; |
---|
932 | | - tot = atomic_read(&cstat->fc4NvmeIoCmpls); |
---|
| 1185 | + for (i = 0; i < phba->cfg_hdw_queue; i++) { |
---|
| 1186 | + cstat = &phba->sli4_hba.hdwq[i].nvme_cstat; |
---|
| 1187 | + tot = cstat->io_cmpls; |
---|
933 | 1188 | totin += tot; |
---|
934 | | - data1 = atomic_read(&cstat->fc4NvmeInputRequests); |
---|
935 | | - data2 = atomic_read(&cstat->fc4NvmeOutputRequests); |
---|
936 | | - data3 = atomic_read(&cstat->fc4NvmeControlRequests); |
---|
| 1189 | + data1 = cstat->input_requests; |
---|
| 1190 | + data2 = cstat->output_requests; |
---|
| 1191 | + data3 = cstat->control_requests; |
---|
937 | 1192 | totout += (data1 + data2 + data3); |
---|
938 | 1193 | |
---|
939 | 1194 | /* Limit to 32, debugfs display buffer limitation */ |
---|
.. | .. |
---|
941 | 1196 | continue; |
---|
942 | 1197 | |
---|
943 | 1198 | len += scnprintf(buf + len, PAGE_SIZE - len, |
---|
944 | | - "FCP (%d): Rd %016llx Wr %016llx " |
---|
| 1199 | + "HDWQ (%d): Rd %016llx Wr %016llx " |
---|
945 | 1200 | "IO %016llx ", |
---|
946 | 1201 | i, data1, data2, data3); |
---|
947 | 1202 | len += scnprintf(buf + len, PAGE_SIZE - len, |
---|
.. | .. |
---|
981 | 1236 | return len; |
---|
982 | 1237 | } |
---|
983 | 1238 | |
---|
| 1239 | +/** |
---|
| 1240 | + * lpfc_debugfs_scsistat_data - Dump target node list to a buffer |
---|
| 1241 | + * @vport: The vport to gather target node info from. |
---|
| 1242 | + * @buf: The buffer to dump log into. |
---|
| 1243 | + * @size: The maximum amount of data to process. |
---|
| 1244 | + * |
---|
| 1245 | + * Description: |
---|
| 1246 | + * This routine dumps the SCSI statistics associated with @vport |
---|
| 1247 | + * |
---|
| 1248 | + * Return Value: |
---|
| 1249 | + * This routine returns the amount of bytes that were dumped into @buf and will |
---|
| 1250 | + * not exceed @size. |
---|
| 1251 | + **/ |
---|
| 1252 | +static int |
---|
| 1253 | +lpfc_debugfs_scsistat_data(struct lpfc_vport *vport, char *buf, int size) |
---|
| 1254 | +{ |
---|
| 1255 | + int len; |
---|
| 1256 | + struct lpfc_hba *phba = vport->phba; |
---|
| 1257 | + struct lpfc_fc4_ctrl_stat *cstat; |
---|
| 1258 | + u64 data1, data2, data3; |
---|
| 1259 | + u64 tot, totin, totout; |
---|
| 1260 | + int i; |
---|
| 1261 | + char tmp[LPFC_MAX_SCSI_INFO_TMP_LEN] = {0}; |
---|
| 1262 | + |
---|
| 1263 | + if (!(vport->cfg_enable_fc4_type & LPFC_ENABLE_FCP) || |
---|
| 1264 | + (phba->sli_rev != LPFC_SLI_REV4)) |
---|
| 1265 | + return 0; |
---|
| 1266 | + |
---|
| 1267 | + scnprintf(buf, size, "SCSI HDWQ Statistics\n"); |
---|
| 1268 | + |
---|
| 1269 | + totin = 0; |
---|
| 1270 | + totout = 0; |
---|
| 1271 | + for (i = 0; i < phba->cfg_hdw_queue; i++) { |
---|
| 1272 | + cstat = &phba->sli4_hba.hdwq[i].scsi_cstat; |
---|
| 1273 | + tot = cstat->io_cmpls; |
---|
| 1274 | + totin += tot; |
---|
| 1275 | + data1 = cstat->input_requests; |
---|
| 1276 | + data2 = cstat->output_requests; |
---|
| 1277 | + data3 = cstat->control_requests; |
---|
| 1278 | + totout += (data1 + data2 + data3); |
---|
| 1279 | + |
---|
| 1280 | + scnprintf(tmp, sizeof(tmp), "HDWQ (%d): Rd %016llx Wr %016llx " |
---|
| 1281 | + "IO %016llx ", i, data1, data2, data3); |
---|
| 1282 | + if (strlcat(buf, tmp, size) >= size) |
---|
| 1283 | + goto buffer_done; |
---|
| 1284 | + |
---|
| 1285 | + scnprintf(tmp, sizeof(tmp), "Cmpl %016llx OutIO %016llx\n", |
---|
| 1286 | + tot, ((data1 + data2 + data3) - tot)); |
---|
| 1287 | + if (strlcat(buf, tmp, size) >= size) |
---|
| 1288 | + goto buffer_done; |
---|
| 1289 | + } |
---|
| 1290 | + scnprintf(tmp, sizeof(tmp), "Total FCP Cmpl %016llx Issue %016llx " |
---|
| 1291 | + "OutIO %016llx\n", totin, totout, totout - totin); |
---|
| 1292 | + strlcat(buf, tmp, size); |
---|
| 1293 | + |
---|
| 1294 | +buffer_done: |
---|
| 1295 | + len = strnlen(buf, size); |
---|
| 1296 | + |
---|
| 1297 | + return len; |
---|
| 1298 | +} |
---|
| 1299 | + |
---|
| 1300 | +void |
---|
| 1301 | +lpfc_io_ktime(struct lpfc_hba *phba, struct lpfc_io_buf *lpfc_cmd) |
---|
| 1302 | +{ |
---|
| 1303 | + uint64_t seg1, seg2, seg3, seg4; |
---|
| 1304 | + uint64_t segsum; |
---|
| 1305 | + |
---|
| 1306 | + if (!lpfc_cmd->ts_last_cmd || |
---|
| 1307 | + !lpfc_cmd->ts_cmd_start || |
---|
| 1308 | + !lpfc_cmd->ts_cmd_wqput || |
---|
| 1309 | + !lpfc_cmd->ts_isr_cmpl || |
---|
| 1310 | + !lpfc_cmd->ts_data_io) |
---|
| 1311 | + return; |
---|
| 1312 | + |
---|
| 1313 | + if (lpfc_cmd->ts_data_io < lpfc_cmd->ts_cmd_start) |
---|
| 1314 | + return; |
---|
| 1315 | + if (lpfc_cmd->ts_cmd_start < lpfc_cmd->ts_last_cmd) |
---|
| 1316 | + return; |
---|
| 1317 | + if (lpfc_cmd->ts_cmd_wqput < lpfc_cmd->ts_cmd_start) |
---|
| 1318 | + return; |
---|
| 1319 | + if (lpfc_cmd->ts_isr_cmpl < lpfc_cmd->ts_cmd_wqput) |
---|
| 1320 | + return; |
---|
| 1321 | + if (lpfc_cmd->ts_data_io < lpfc_cmd->ts_isr_cmpl) |
---|
| 1322 | + return; |
---|
| 1323 | + /* |
---|
| 1324 | + * Segment 1 - Time from Last FCP command cmpl is handed |
---|
| 1325 | + * off to NVME Layer to start of next command. |
---|
| 1326 | + * Segment 2 - Time from Driver receives a IO cmd start |
---|
| 1327 | + * from NVME Layer to WQ put is done on IO cmd. |
---|
| 1328 | + * Segment 3 - Time from Driver WQ put is done on IO cmd |
---|
| 1329 | + * to MSI-X ISR for IO cmpl. |
---|
| 1330 | + * Segment 4 - Time from MSI-X ISR for IO cmpl to when |
---|
| 1331 | + * cmpl is handled off to the NVME Layer. |
---|
| 1332 | + */ |
---|
| 1333 | + seg1 = lpfc_cmd->ts_cmd_start - lpfc_cmd->ts_last_cmd; |
---|
| 1334 | + if (seg1 > 5000000) /* 5 ms - for sequential IOs only */ |
---|
| 1335 | + seg1 = 0; |
---|
| 1336 | + |
---|
| 1337 | + /* Calculate times relative to start of IO */ |
---|
| 1338 | + seg2 = (lpfc_cmd->ts_cmd_wqput - lpfc_cmd->ts_cmd_start); |
---|
| 1339 | + segsum = seg2; |
---|
| 1340 | + seg3 = lpfc_cmd->ts_isr_cmpl - lpfc_cmd->ts_cmd_start; |
---|
| 1341 | + if (segsum > seg3) |
---|
| 1342 | + return; |
---|
| 1343 | + seg3 -= segsum; |
---|
| 1344 | + segsum += seg3; |
---|
| 1345 | + |
---|
| 1346 | + seg4 = lpfc_cmd->ts_data_io - lpfc_cmd->ts_cmd_start; |
---|
| 1347 | + if (segsum > seg4) |
---|
| 1348 | + return; |
---|
| 1349 | + seg4 -= segsum; |
---|
| 1350 | + |
---|
| 1351 | + phba->ktime_data_samples++; |
---|
| 1352 | + phba->ktime_seg1_total += seg1; |
---|
| 1353 | + if (seg1 < phba->ktime_seg1_min) |
---|
| 1354 | + phba->ktime_seg1_min = seg1; |
---|
| 1355 | + else if (seg1 > phba->ktime_seg1_max) |
---|
| 1356 | + phba->ktime_seg1_max = seg1; |
---|
| 1357 | + phba->ktime_seg2_total += seg2; |
---|
| 1358 | + if (seg2 < phba->ktime_seg2_min) |
---|
| 1359 | + phba->ktime_seg2_min = seg2; |
---|
| 1360 | + else if (seg2 > phba->ktime_seg2_max) |
---|
| 1361 | + phba->ktime_seg2_max = seg2; |
---|
| 1362 | + phba->ktime_seg3_total += seg3; |
---|
| 1363 | + if (seg3 < phba->ktime_seg3_min) |
---|
| 1364 | + phba->ktime_seg3_min = seg3; |
---|
| 1365 | + else if (seg3 > phba->ktime_seg3_max) |
---|
| 1366 | + phba->ktime_seg3_max = seg3; |
---|
| 1367 | + phba->ktime_seg4_total += seg4; |
---|
| 1368 | + if (seg4 < phba->ktime_seg4_min) |
---|
| 1369 | + phba->ktime_seg4_min = seg4; |
---|
| 1370 | + else if (seg4 > phba->ktime_seg4_max) |
---|
| 1371 | + phba->ktime_seg4_max = seg4; |
---|
| 1372 | + |
---|
| 1373 | + lpfc_cmd->ts_last_cmd = 0; |
---|
| 1374 | + lpfc_cmd->ts_cmd_start = 0; |
---|
| 1375 | + lpfc_cmd->ts_cmd_wqput = 0; |
---|
| 1376 | + lpfc_cmd->ts_isr_cmpl = 0; |
---|
| 1377 | + lpfc_cmd->ts_data_io = 0; |
---|
| 1378 | +} |
---|
984 | 1379 | |
---|
985 | 1380 | /** |
---|
986 | | - * lpfc_debugfs_nvmektime_data - Dump target node list to a buffer |
---|
| 1381 | + * lpfc_debugfs_ioktime_data - Dump target node list to a buffer |
---|
987 | 1382 | * @vport: The vport to gather target node info from. |
---|
988 | 1383 | * @buf: The buffer to dump log into. |
---|
989 | 1384 | * @size: The maximum amount of data to process. |
---|
.. | .. |
---|
996 | 1391 | * not exceed @size. |
---|
997 | 1392 | **/ |
---|
998 | 1393 | static int |
---|
999 | | -lpfc_debugfs_nvmektime_data(struct lpfc_vport *vport, char *buf, int size) |
---|
| 1394 | +lpfc_debugfs_ioktime_data(struct lpfc_vport *vport, char *buf, int size) |
---|
1000 | 1395 | { |
---|
1001 | 1396 | struct lpfc_hba *phba = vport->phba; |
---|
1002 | 1397 | int len = 0; |
---|
1003 | 1398 | |
---|
1004 | 1399 | if (phba->nvmet_support == 0) { |
---|
1005 | | - /* NVME Initiator */ |
---|
| 1400 | + /* Initiator */ |
---|
1006 | 1401 | len += scnprintf(buf + len, PAGE_SIZE - len, |
---|
1007 | 1402 | "ktime %s: Total Samples: %lld\n", |
---|
1008 | 1403 | (phba->ktime_on ? "Enabled" : "Disabled"), |
---|
.. | .. |
---|
1012 | 1407 | |
---|
1013 | 1408 | len += scnprintf( |
---|
1014 | 1409 | buf + len, PAGE_SIZE - len, |
---|
1015 | | - "Segment 1: Last NVME Cmd cmpl " |
---|
1016 | | - "done -to- Start of next NVME cnd (in driver)\n"); |
---|
| 1410 | + "Segment 1: Last Cmd cmpl " |
---|
| 1411 | + "done -to- Start of next Cmd (in driver)\n"); |
---|
1017 | 1412 | len += scnprintf( |
---|
1018 | 1413 | buf + len, PAGE_SIZE - len, |
---|
1019 | 1414 | "avg:%08lld min:%08lld max %08lld\n", |
---|
.. | .. |
---|
1023 | 1418 | phba->ktime_seg1_max); |
---|
1024 | 1419 | len += scnprintf( |
---|
1025 | 1420 | buf + len, PAGE_SIZE - len, |
---|
1026 | | - "Segment 2: Driver start of NVME cmd " |
---|
| 1421 | + "Segment 2: Driver start of Cmd " |
---|
1027 | 1422 | "-to- Firmware WQ doorbell\n"); |
---|
1028 | 1423 | len += scnprintf( |
---|
1029 | 1424 | buf + len, PAGE_SIZE - len, |
---|
.. | .. |
---|
1046 | 1441 | len += scnprintf( |
---|
1047 | 1442 | buf + len, PAGE_SIZE - len, |
---|
1048 | 1443 | "Segment 4: MSI-X ISR cmpl -to- " |
---|
1049 | | - "NVME cmpl done\n"); |
---|
| 1444 | + "Cmd cmpl done\n"); |
---|
1050 | 1445 | len += scnprintf( |
---|
1051 | 1446 | buf + len, PAGE_SIZE - len, |
---|
1052 | 1447 | "avg:%08lld min:%08lld max %08lld\n", |
---|
.. | .. |
---|
1285 | 1680 | } |
---|
1286 | 1681 | |
---|
1287 | 1682 | /** |
---|
1288 | | - * lpfc_debugfs_cpucheck_data - Dump target node list to a buffer |
---|
| 1683 | + * lpfc_debugfs_hdwqstat_data - Dump I/O stats to a buffer |
---|
1289 | 1684 | * @vport: The vport to gather target node info from. |
---|
1290 | 1685 | * @buf: The buffer to dump log into. |
---|
1291 | 1686 | * @size: The maximum amount of data to process. |
---|
1292 | 1687 | * |
---|
1293 | 1688 | * Description: |
---|
1294 | | - * This routine dumps the NVME statistics associated with @vport |
---|
| 1689 | + * This routine dumps the NVME + SCSI statistics associated with @vport |
---|
1295 | 1690 | * |
---|
1296 | 1691 | * Return Value: |
---|
1297 | 1692 | * This routine returns the amount of bytes that were dumped into @buf and will |
---|
1298 | 1693 | * not exceed @size. |
---|
1299 | 1694 | **/ |
---|
1300 | 1695 | static int |
---|
1301 | | -lpfc_debugfs_cpucheck_data(struct lpfc_vport *vport, char *buf, int size) |
---|
| 1696 | +lpfc_debugfs_hdwqstat_data(struct lpfc_vport *vport, char *buf, int size) |
---|
1302 | 1697 | { |
---|
1303 | 1698 | struct lpfc_hba *phba = vport->phba; |
---|
1304 | | - int i; |
---|
1305 | | - int len = 0; |
---|
1306 | | - uint32_t tot_xmt = 0; |
---|
1307 | | - uint32_t tot_rcv = 0; |
---|
1308 | | - uint32_t tot_cmpl = 0; |
---|
1309 | | - uint32_t tot_ccmpl = 0; |
---|
| 1699 | + struct lpfc_hdwq_stat *c_stat; |
---|
| 1700 | + int i, j, len; |
---|
| 1701 | + uint32_t tot_xmt; |
---|
| 1702 | + uint32_t tot_rcv; |
---|
| 1703 | + uint32_t tot_cmpl; |
---|
| 1704 | + char tmp[LPFC_MAX_SCSI_INFO_TMP_LEN] = {0}; |
---|
1310 | 1705 | |
---|
1311 | | - if (phba->nvmet_support == 0) { |
---|
1312 | | - /* NVME Initiator */ |
---|
1313 | | - len += scnprintf(buf + len, PAGE_SIZE - len, |
---|
1314 | | - "CPUcheck %s\n", |
---|
1315 | | - (phba->cpucheck_on & LPFC_CHECK_NVME_IO ? |
---|
1316 | | - "Enabled" : "Disabled")); |
---|
1317 | | - for (i = 0; i < phba->sli4_hba.num_present_cpu; i++) { |
---|
1318 | | - if (i >= LPFC_CHECK_CPU_CNT) |
---|
1319 | | - break; |
---|
1320 | | - len += scnprintf(buf + len, PAGE_SIZE - len, |
---|
1321 | | - "%02d: xmit x%08x cmpl x%08x\n", |
---|
1322 | | - i, phba->cpucheck_xmt_io[i], |
---|
1323 | | - phba->cpucheck_cmpl_io[i]); |
---|
1324 | | - tot_xmt += phba->cpucheck_xmt_io[i]; |
---|
1325 | | - tot_cmpl += phba->cpucheck_cmpl_io[i]; |
---|
| 1706 | + scnprintf(tmp, sizeof(tmp), "HDWQ Stats:\n\n"); |
---|
| 1707 | + if (strlcat(buf, tmp, size) >= size) |
---|
| 1708 | + goto buffer_done; |
---|
| 1709 | + |
---|
| 1710 | + scnprintf(tmp, sizeof(tmp), "(NVME Accounting: %s) ", |
---|
| 1711 | + (phba->hdwqstat_on & |
---|
| 1712 | + (LPFC_CHECK_NVME_IO | LPFC_CHECK_NVMET_IO) ? |
---|
| 1713 | + "Enabled" : "Disabled")); |
---|
| 1714 | + if (strlcat(buf, tmp, size) >= size) |
---|
| 1715 | + goto buffer_done; |
---|
| 1716 | + |
---|
| 1717 | + scnprintf(tmp, sizeof(tmp), "(SCSI Accounting: %s) ", |
---|
| 1718 | + (phba->hdwqstat_on & LPFC_CHECK_SCSI_IO ? |
---|
| 1719 | + "Enabled" : "Disabled")); |
---|
| 1720 | + if (strlcat(buf, tmp, size) >= size) |
---|
| 1721 | + goto buffer_done; |
---|
| 1722 | + |
---|
| 1723 | + scnprintf(tmp, sizeof(tmp), "\n\n"); |
---|
| 1724 | + if (strlcat(buf, tmp, size) >= size) |
---|
| 1725 | + goto buffer_done; |
---|
| 1726 | + |
---|
| 1727 | + for (i = 0; i < phba->cfg_hdw_queue; i++) { |
---|
| 1728 | + tot_rcv = 0; |
---|
| 1729 | + tot_xmt = 0; |
---|
| 1730 | + tot_cmpl = 0; |
---|
| 1731 | + |
---|
| 1732 | + for_each_present_cpu(j) { |
---|
| 1733 | + c_stat = per_cpu_ptr(phba->sli4_hba.c_stat, j); |
---|
| 1734 | + |
---|
| 1735 | + /* Only display for this HDWQ */ |
---|
| 1736 | + if (i != c_stat->hdwq_no) |
---|
| 1737 | + continue; |
---|
| 1738 | + |
---|
| 1739 | + /* Only display non-zero counters */ |
---|
| 1740 | + if (!c_stat->xmt_io && !c_stat->cmpl_io && |
---|
| 1741 | + !c_stat->rcv_io) |
---|
| 1742 | + continue; |
---|
| 1743 | + |
---|
| 1744 | + if (!tot_xmt && !tot_cmpl && !tot_rcv) { |
---|
| 1745 | + /* Print HDWQ string only the first time */ |
---|
| 1746 | + scnprintf(tmp, sizeof(tmp), "[HDWQ %d]:\t", i); |
---|
| 1747 | + if (strlcat(buf, tmp, size) >= size) |
---|
| 1748 | + goto buffer_done; |
---|
| 1749 | + } |
---|
| 1750 | + |
---|
| 1751 | + tot_xmt += c_stat->xmt_io; |
---|
| 1752 | + tot_cmpl += c_stat->cmpl_io; |
---|
| 1753 | + if (phba->nvmet_support) |
---|
| 1754 | + tot_rcv += c_stat->rcv_io; |
---|
| 1755 | + |
---|
| 1756 | + scnprintf(tmp, sizeof(tmp), "| [CPU %d]: ", j); |
---|
| 1757 | + if (strlcat(buf, tmp, size) >= size) |
---|
| 1758 | + goto buffer_done; |
---|
| 1759 | + |
---|
| 1760 | + if (phba->nvmet_support) { |
---|
| 1761 | + scnprintf(tmp, sizeof(tmp), |
---|
| 1762 | + "XMT 0x%x CMPL 0x%x RCV 0x%x |", |
---|
| 1763 | + c_stat->xmt_io, c_stat->cmpl_io, |
---|
| 1764 | + c_stat->rcv_io); |
---|
| 1765 | + if (strlcat(buf, tmp, size) >= size) |
---|
| 1766 | + goto buffer_done; |
---|
| 1767 | + } else { |
---|
| 1768 | + scnprintf(tmp, sizeof(tmp), |
---|
| 1769 | + "XMT 0x%x CMPL 0x%x |", |
---|
| 1770 | + c_stat->xmt_io, c_stat->cmpl_io); |
---|
| 1771 | + if (strlcat(buf, tmp, size) >= size) |
---|
| 1772 | + goto buffer_done; |
---|
| 1773 | + } |
---|
1326 | 1774 | } |
---|
1327 | | - len += scnprintf(buf + len, PAGE_SIZE - len, |
---|
1328 | | - "tot:xmit x%08x cmpl x%08x\n", |
---|
1329 | | - tot_xmt, tot_cmpl); |
---|
1330 | | - return len; |
---|
| 1775 | + |
---|
| 1776 | + /* Check if nothing to display */ |
---|
| 1777 | + if (!tot_xmt && !tot_cmpl && !tot_rcv) |
---|
| 1778 | + continue; |
---|
| 1779 | + |
---|
| 1780 | + scnprintf(tmp, sizeof(tmp), "\t->\t[HDWQ Total: "); |
---|
| 1781 | + if (strlcat(buf, tmp, size) >= size) |
---|
| 1782 | + goto buffer_done; |
---|
| 1783 | + |
---|
| 1784 | + if (phba->nvmet_support) { |
---|
| 1785 | + scnprintf(tmp, sizeof(tmp), |
---|
| 1786 | + "XMT 0x%x CMPL 0x%x RCV 0x%x]\n\n", |
---|
| 1787 | + tot_xmt, tot_cmpl, tot_rcv); |
---|
| 1788 | + if (strlcat(buf, tmp, size) >= size) |
---|
| 1789 | + goto buffer_done; |
---|
| 1790 | + } else { |
---|
| 1791 | + scnprintf(tmp, sizeof(tmp), |
---|
| 1792 | + "XMT 0x%x CMPL 0x%x]\n\n", |
---|
| 1793 | + tot_xmt, tot_cmpl); |
---|
| 1794 | + if (strlcat(buf, tmp, size) >= size) |
---|
| 1795 | + goto buffer_done; |
---|
| 1796 | + } |
---|
1331 | 1797 | } |
---|
1332 | 1798 | |
---|
1333 | | - /* NVME Target */ |
---|
1334 | | - len += scnprintf(buf + len, PAGE_SIZE - len, |
---|
1335 | | - "CPUcheck %s ", |
---|
1336 | | - (phba->cpucheck_on & LPFC_CHECK_NVMET_IO ? |
---|
1337 | | - "IO Enabled - " : "IO Disabled - ")); |
---|
1338 | | - len += scnprintf(buf + len, PAGE_SIZE - len, |
---|
1339 | | - "%s\n", |
---|
1340 | | - (phba->cpucheck_on & LPFC_CHECK_NVMET_RCV ? |
---|
1341 | | - "Rcv Enabled\n" : "Rcv Disabled\n")); |
---|
1342 | | - for (i = 0; i < phba->sli4_hba.num_present_cpu; i++) { |
---|
1343 | | - if (i >= LPFC_CHECK_CPU_CNT) |
---|
1344 | | - break; |
---|
1345 | | - len += scnprintf(buf + len, PAGE_SIZE - len, |
---|
1346 | | - "%02d: xmit x%08x ccmpl x%08x " |
---|
1347 | | - "cmpl x%08x rcv x%08x\n", |
---|
1348 | | - i, phba->cpucheck_xmt_io[i], |
---|
1349 | | - phba->cpucheck_ccmpl_io[i], |
---|
1350 | | - phba->cpucheck_cmpl_io[i], |
---|
1351 | | - phba->cpucheck_rcv_io[i]); |
---|
1352 | | - tot_xmt += phba->cpucheck_xmt_io[i]; |
---|
1353 | | - tot_rcv += phba->cpucheck_rcv_io[i]; |
---|
1354 | | - tot_cmpl += phba->cpucheck_cmpl_io[i]; |
---|
1355 | | - tot_ccmpl += phba->cpucheck_ccmpl_io[i]; |
---|
1356 | | - } |
---|
1357 | | - len += scnprintf(buf + len, PAGE_SIZE - len, |
---|
1358 | | - "tot:xmit x%08x ccmpl x%08x cmpl x%08x rcv x%08x\n", |
---|
1359 | | - tot_xmt, tot_ccmpl, tot_cmpl, tot_rcv); |
---|
| 1799 | +buffer_done: |
---|
| 1800 | + len = strnlen(buf, size); |
---|
1360 | 1801 | return len; |
---|
1361 | 1802 | } |
---|
1362 | 1803 | |
---|
.. | .. |
---|
1503 | 1944 | int rc = -ENOMEM; |
---|
1504 | 1945 | |
---|
1505 | 1946 | if (!lpfc_debugfs_max_disc_trc) { |
---|
1506 | | - rc = -ENOSPC; |
---|
| 1947 | + rc = -ENOSPC; |
---|
1507 | 1948 | goto out; |
---|
1508 | 1949 | } |
---|
1509 | 1950 | |
---|
.. | .. |
---|
1553 | 1994 | int rc = -ENOMEM; |
---|
1554 | 1995 | |
---|
1555 | 1996 | if (!lpfc_debugfs_max_slow_ring_trc) { |
---|
1556 | | - rc = -ENOSPC; |
---|
| 1997 | + rc = -ENOSPC; |
---|
1557 | 1998 | goto out; |
---|
1558 | 1999 | } |
---|
1559 | 2000 | |
---|
.. | .. |
---|
1617 | 2058 | file->private_data = debug; |
---|
1618 | 2059 | |
---|
1619 | 2060 | rc = 0; |
---|
| 2061 | +out: |
---|
| 2062 | + return rc; |
---|
| 2063 | +} |
---|
| 2064 | + |
---|
| 2065 | +/** |
---|
| 2066 | + * lpfc_debugfs_multixripools_open - Open the multixripool debugfs buffer |
---|
| 2067 | + * @inode: The inode pointer that contains a hba pointer. |
---|
| 2068 | + * @file: The file pointer to attach the log output. |
---|
| 2069 | + * |
---|
| 2070 | + * Description: |
---|
| 2071 | + * This routine is the entry point for the debugfs open file operation. It gets |
---|
| 2072 | + * the hba from the i_private field in @inode, allocates the necessary buffer |
---|
| 2073 | + * for the log, fills the buffer from the in-memory log for this hba, and then |
---|
| 2074 | + * returns a pointer to that log in the private_data field in @file. |
---|
| 2075 | + * |
---|
| 2076 | + * Returns: |
---|
| 2077 | + * This function returns zero if successful. On error it will return a negative |
---|
| 2078 | + * error value. |
---|
| 2079 | + **/ |
---|
| 2080 | +static int |
---|
| 2081 | +lpfc_debugfs_multixripools_open(struct inode *inode, struct file *file) |
---|
| 2082 | +{ |
---|
| 2083 | + struct lpfc_hba *phba = inode->i_private; |
---|
| 2084 | + struct lpfc_debug *debug; |
---|
| 2085 | + int rc = -ENOMEM; |
---|
| 2086 | + |
---|
| 2087 | + debug = kmalloc(sizeof(*debug), GFP_KERNEL); |
---|
| 2088 | + if (!debug) |
---|
| 2089 | + goto out; |
---|
| 2090 | + |
---|
| 2091 | + /* Round to page boundary */ |
---|
| 2092 | + debug->buffer = kzalloc(LPFC_DUMP_MULTIXRIPOOL_SIZE, GFP_KERNEL); |
---|
| 2093 | + if (!debug->buffer) { |
---|
| 2094 | + kfree(debug); |
---|
| 2095 | + goto out; |
---|
| 2096 | + } |
---|
| 2097 | + |
---|
| 2098 | + debug->len = lpfc_debugfs_multixripools_data( |
---|
| 2099 | + phba, debug->buffer, LPFC_DUMP_MULTIXRIPOOL_SIZE); |
---|
| 2100 | + |
---|
| 2101 | + debug->i_private = inode->i_private; |
---|
| 2102 | + file->private_data = debug; |
---|
| 2103 | + |
---|
| 2104 | + rc = 0; |
---|
| 2105 | +out: |
---|
| 2106 | + return rc; |
---|
| 2107 | +} |
---|
| 2108 | + |
---|
| 2109 | +#ifdef LPFC_HDWQ_LOCK_STAT |
---|
| 2110 | +/** |
---|
| 2111 | + * lpfc_debugfs_lockstat_open - Open the lockstat debugfs buffer |
---|
| 2112 | + * @inode: The inode pointer that contains a vport pointer. |
---|
| 2113 | + * @file: The file pointer to attach the log output. |
---|
| 2114 | + * |
---|
| 2115 | + * Description: |
---|
| 2116 | + * This routine is the entry point for the debugfs open file operation. It gets |
---|
| 2117 | + * the vport from the i_private field in @inode, allocates the necessary buffer |
---|
| 2118 | + * for the log, fills the buffer from the in-memory log for this vport, and then |
---|
| 2119 | + * returns a pointer to that log in the private_data field in @file. |
---|
| 2120 | + * |
---|
| 2121 | + * Returns: |
---|
| 2122 | + * This function returns zero if successful. On error it will return a negative |
---|
| 2123 | + * error value. |
---|
| 2124 | + **/ |
---|
| 2125 | +static int |
---|
| 2126 | +lpfc_debugfs_lockstat_open(struct inode *inode, struct file *file) |
---|
| 2127 | +{ |
---|
| 2128 | + struct lpfc_hba *phba = inode->i_private; |
---|
| 2129 | + struct lpfc_debug *debug; |
---|
| 2130 | + int rc = -ENOMEM; |
---|
| 2131 | + |
---|
| 2132 | + debug = kmalloc(sizeof(*debug), GFP_KERNEL); |
---|
| 2133 | + if (!debug) |
---|
| 2134 | + goto out; |
---|
| 2135 | + |
---|
| 2136 | + /* Round to page boundary */ |
---|
| 2137 | + debug->buffer = kmalloc(LPFC_HDWQINFO_SIZE, GFP_KERNEL); |
---|
| 2138 | + if (!debug->buffer) { |
---|
| 2139 | + kfree(debug); |
---|
| 2140 | + goto out; |
---|
| 2141 | + } |
---|
| 2142 | + |
---|
| 2143 | + debug->len = lpfc_debugfs_lockstat_data(phba, debug->buffer, |
---|
| 2144 | + LPFC_HBQINFO_SIZE); |
---|
| 2145 | + file->private_data = debug; |
---|
| 2146 | + |
---|
| 2147 | + rc = 0; |
---|
| 2148 | +out: |
---|
| 2149 | + return rc; |
---|
| 2150 | +} |
---|
| 2151 | + |
---|
| 2152 | +static ssize_t |
---|
| 2153 | +lpfc_debugfs_lockstat_write(struct file *file, const char __user *buf, |
---|
| 2154 | + size_t nbytes, loff_t *ppos) |
---|
| 2155 | +{ |
---|
| 2156 | + struct lpfc_debug *debug = file->private_data; |
---|
| 2157 | + struct lpfc_hba *phba = (struct lpfc_hba *)debug->i_private; |
---|
| 2158 | + struct lpfc_sli4_hdw_queue *qp; |
---|
| 2159 | + char mybuf[64]; |
---|
| 2160 | + char *pbuf; |
---|
| 2161 | + int i; |
---|
| 2162 | + size_t bsize; |
---|
| 2163 | + |
---|
| 2164 | + memset(mybuf, 0, sizeof(mybuf)); |
---|
| 2165 | + |
---|
| 2166 | + bsize = min(nbytes, (sizeof(mybuf) - 1)); |
---|
| 2167 | + |
---|
| 2168 | + if (copy_from_user(mybuf, buf, bsize)) |
---|
| 2169 | + return -EFAULT; |
---|
| 2170 | + pbuf = &mybuf[0]; |
---|
| 2171 | + |
---|
| 2172 | + if ((strncmp(pbuf, "reset", strlen("reset")) == 0) || |
---|
| 2173 | + (strncmp(pbuf, "zero", strlen("zero")) == 0)) { |
---|
| 2174 | + for (i = 0; i < phba->cfg_hdw_queue; i++) { |
---|
| 2175 | + qp = &phba->sli4_hba.hdwq[i]; |
---|
| 2176 | + qp->lock_conflict.alloc_xri_get = 0; |
---|
| 2177 | + qp->lock_conflict.alloc_xri_put = 0; |
---|
| 2178 | + qp->lock_conflict.free_xri = 0; |
---|
| 2179 | + qp->lock_conflict.wq_access = 0; |
---|
| 2180 | + qp->lock_conflict.alloc_pvt_pool = 0; |
---|
| 2181 | + qp->lock_conflict.mv_from_pvt_pool = 0; |
---|
| 2182 | + qp->lock_conflict.mv_to_pub_pool = 0; |
---|
| 2183 | + qp->lock_conflict.mv_to_pvt_pool = 0; |
---|
| 2184 | + qp->lock_conflict.free_pvt_pool = 0; |
---|
| 2185 | + qp->lock_conflict.free_pub_pool = 0; |
---|
| 2186 | + qp->lock_conflict.wq_access = 0; |
---|
| 2187 | + } |
---|
| 2188 | + } |
---|
| 2189 | + return bsize; |
---|
| 2190 | +} |
---|
| 2191 | +#endif |
---|
| 2192 | + |
---|
| 2193 | +static int lpfc_debugfs_ras_log_data(struct lpfc_hba *phba, |
---|
| 2194 | + char *buffer, int size) |
---|
| 2195 | +{ |
---|
| 2196 | + int copied = 0; |
---|
| 2197 | + struct lpfc_dmabuf *dmabuf, *next; |
---|
| 2198 | + |
---|
| 2199 | + memset(buffer, 0, size); |
---|
| 2200 | + |
---|
| 2201 | + spin_lock_irq(&phba->hbalock); |
---|
| 2202 | + if (phba->ras_fwlog.state != ACTIVE) { |
---|
| 2203 | + spin_unlock_irq(&phba->hbalock); |
---|
| 2204 | + return -EINVAL; |
---|
| 2205 | + } |
---|
| 2206 | + spin_unlock_irq(&phba->hbalock); |
---|
| 2207 | + |
---|
| 2208 | + list_for_each_entry_safe(dmabuf, next, |
---|
| 2209 | + &phba->ras_fwlog.fwlog_buff_list, list) { |
---|
| 2210 | + /* Check if copying will go over size and a '\0' char */ |
---|
| 2211 | + if ((copied + LPFC_RAS_MAX_ENTRY_SIZE) >= (size - 1)) { |
---|
| 2212 | + memcpy(buffer + copied, dmabuf->virt, |
---|
| 2213 | + size - copied - 1); |
---|
| 2214 | + copied += size - copied - 1; |
---|
| 2215 | + break; |
---|
| 2216 | + } |
---|
| 2217 | + memcpy(buffer + copied, dmabuf->virt, LPFC_RAS_MAX_ENTRY_SIZE); |
---|
| 2218 | + copied += LPFC_RAS_MAX_ENTRY_SIZE; |
---|
| 2219 | + } |
---|
| 2220 | + return copied; |
---|
| 2221 | +} |
---|
| 2222 | + |
---|
| 2223 | +static int |
---|
| 2224 | +lpfc_debugfs_ras_log_release(struct inode *inode, struct file *file) |
---|
| 2225 | +{ |
---|
| 2226 | + struct lpfc_debug *debug = file->private_data; |
---|
| 2227 | + |
---|
| 2228 | + vfree(debug->buffer); |
---|
| 2229 | + kfree(debug); |
---|
| 2230 | + |
---|
| 2231 | + return 0; |
---|
| 2232 | +} |
---|
| 2233 | + |
---|
| 2234 | +/** |
---|
| 2235 | + * lpfc_debugfs_ras_log_open - Open the RAS log debugfs buffer |
---|
| 2236 | + * @inode: The inode pointer that contains a vport pointer. |
---|
| 2237 | + * @file: The file pointer to attach the log output. |
---|
| 2238 | + * |
---|
| 2239 | + * Description: |
---|
| 2240 | + * This routine is the entry point for the debugfs open file operation. It gets |
---|
| 2241 | + * the vport from the i_private field in @inode, allocates the necessary buffer |
---|
| 2242 | + * for the log, fills the buffer from the in-memory log for this vport, and then |
---|
| 2243 | + * returns a pointer to that log in the private_data field in @file. |
---|
| 2244 | + * |
---|
| 2245 | + * Returns: |
---|
| 2246 | + * This function returns zero if successful. On error it will return a negative |
---|
| 2247 | + * error value. |
---|
| 2248 | + **/ |
---|
| 2249 | +static int |
---|
| 2250 | +lpfc_debugfs_ras_log_open(struct inode *inode, struct file *file) |
---|
| 2251 | +{ |
---|
| 2252 | + struct lpfc_hba *phba = inode->i_private; |
---|
| 2253 | + struct lpfc_debug *debug; |
---|
| 2254 | + int size; |
---|
| 2255 | + int rc = -ENOMEM; |
---|
| 2256 | + |
---|
| 2257 | + spin_lock_irq(&phba->hbalock); |
---|
| 2258 | + if (phba->ras_fwlog.state != ACTIVE) { |
---|
| 2259 | + spin_unlock_irq(&phba->hbalock); |
---|
| 2260 | + rc = -EINVAL; |
---|
| 2261 | + goto out; |
---|
| 2262 | + } |
---|
| 2263 | + spin_unlock_irq(&phba->hbalock); |
---|
| 2264 | + debug = kmalloc(sizeof(*debug), GFP_KERNEL); |
---|
| 2265 | + if (!debug) |
---|
| 2266 | + goto out; |
---|
| 2267 | + |
---|
| 2268 | + size = LPFC_RAS_MIN_BUFF_POST_SIZE * phba->cfg_ras_fwlog_buffsize; |
---|
| 2269 | + debug->buffer = vmalloc(size); |
---|
| 2270 | + if (!debug->buffer) |
---|
| 2271 | + goto free_debug; |
---|
| 2272 | + |
---|
| 2273 | + debug->len = lpfc_debugfs_ras_log_data(phba, debug->buffer, size); |
---|
| 2274 | + if (debug->len < 0) { |
---|
| 2275 | + rc = -EINVAL; |
---|
| 2276 | + goto free_buffer; |
---|
| 2277 | + } |
---|
| 2278 | + file->private_data = debug; |
---|
| 2279 | + |
---|
| 2280 | + return 0; |
---|
| 2281 | + |
---|
| 2282 | +free_buffer: |
---|
| 2283 | + vfree(debug->buffer); |
---|
| 2284 | +free_debug: |
---|
| 2285 | + kfree(debug); |
---|
1620 | 2286 | out: |
---|
1621 | 2287 | return rc; |
---|
1622 | 2288 | } |
---|
.. | .. |
---|
1705 | 2371 | return rc; |
---|
1706 | 2372 | } |
---|
1707 | 2373 | |
---|
1708 | | -static int |
---|
1709 | | -lpfc_debugfs_dumpData_open(struct inode *inode, struct file *file) |
---|
1710 | | -{ |
---|
1711 | | - struct lpfc_debug *debug; |
---|
1712 | | - int rc = -ENOMEM; |
---|
1713 | | - |
---|
1714 | | - if (!_dump_buf_data) |
---|
1715 | | - return -EBUSY; |
---|
1716 | | - |
---|
1717 | | - debug = kmalloc(sizeof(*debug), GFP_KERNEL); |
---|
1718 | | - if (!debug) |
---|
1719 | | - goto out; |
---|
1720 | | - |
---|
1721 | | - /* Round to page boundary */ |
---|
1722 | | - pr_err("9059 BLKGRD: %s: _dump_buf_data=0x%p\n", |
---|
1723 | | - __func__, _dump_buf_data); |
---|
1724 | | - debug->buffer = _dump_buf_data; |
---|
1725 | | - if (!debug->buffer) { |
---|
1726 | | - kfree(debug); |
---|
1727 | | - goto out; |
---|
1728 | | - } |
---|
1729 | | - |
---|
1730 | | - debug->len = (1 << _dump_buf_data_order) << PAGE_SHIFT; |
---|
1731 | | - file->private_data = debug; |
---|
1732 | | - |
---|
1733 | | - rc = 0; |
---|
1734 | | -out: |
---|
1735 | | - return rc; |
---|
1736 | | -} |
---|
1737 | | - |
---|
1738 | | -static int |
---|
1739 | | -lpfc_debugfs_dumpDif_open(struct inode *inode, struct file *file) |
---|
1740 | | -{ |
---|
1741 | | - struct lpfc_debug *debug; |
---|
1742 | | - int rc = -ENOMEM; |
---|
1743 | | - |
---|
1744 | | - if (!_dump_buf_dif) |
---|
1745 | | - return -EBUSY; |
---|
1746 | | - |
---|
1747 | | - debug = kmalloc(sizeof(*debug), GFP_KERNEL); |
---|
1748 | | - if (!debug) |
---|
1749 | | - goto out; |
---|
1750 | | - |
---|
1751 | | - /* Round to page boundary */ |
---|
1752 | | - pr_err("9060 BLKGRD: %s: _dump_buf_dif=0x%p file=%pD\n", |
---|
1753 | | - __func__, _dump_buf_dif, file); |
---|
1754 | | - debug->buffer = _dump_buf_dif; |
---|
1755 | | - if (!debug->buffer) { |
---|
1756 | | - kfree(debug); |
---|
1757 | | - goto out; |
---|
1758 | | - } |
---|
1759 | | - |
---|
1760 | | - debug->len = (1 << _dump_buf_dif_order) << PAGE_SHIFT; |
---|
1761 | | - file->private_data = debug; |
---|
1762 | | - |
---|
1763 | | - rc = 0; |
---|
1764 | | -out: |
---|
1765 | | - return rc; |
---|
1766 | | -} |
---|
1767 | | - |
---|
1768 | | -static ssize_t |
---|
1769 | | -lpfc_debugfs_dumpDataDif_write(struct file *file, const char __user *buf, |
---|
1770 | | - size_t nbytes, loff_t *ppos) |
---|
1771 | | -{ |
---|
1772 | | - /* |
---|
1773 | | - * The Data/DIF buffers only save one failing IO |
---|
1774 | | - * The write op is used as a reset mechanism after an IO has |
---|
1775 | | - * already been saved to the next one can be saved |
---|
1776 | | - */ |
---|
1777 | | - spin_lock(&_dump_buf_lock); |
---|
1778 | | - |
---|
1779 | | - memset((void *)_dump_buf_data, 0, |
---|
1780 | | - ((1 << PAGE_SHIFT) << _dump_buf_data_order)); |
---|
1781 | | - memset((void *)_dump_buf_dif, 0, |
---|
1782 | | - ((1 << PAGE_SHIFT) << _dump_buf_dif_order)); |
---|
1783 | | - |
---|
1784 | | - _dump_buf_done = 0; |
---|
1785 | | - |
---|
1786 | | - spin_unlock(&_dump_buf_lock); |
---|
1787 | | - |
---|
1788 | | - return nbytes; |
---|
1789 | | -} |
---|
1790 | | - |
---|
1791 | 2374 | static ssize_t |
---|
1792 | 2375 | lpfc_debugfs_dif_err_read(struct file *file, char __user *buf, |
---|
1793 | 2376 | size_t nbytes, loff_t *ppos) |
---|
.. | .. |
---|
1846 | 2429 | return -EFAULT; |
---|
1847 | 2430 | |
---|
1848 | 2431 | if (dent == phba->debug_InjErrLBA) { |
---|
1849 | | - if ((buf[0] == 'o') && (buf[1] == 'f') && (buf[2] == 'f')) |
---|
| 2432 | + if ((dstbuf[0] == 'o') && (dstbuf[1] == 'f') && |
---|
| 2433 | + (dstbuf[2] == 'f')) |
---|
1850 | 2434 | tmp = (uint64_t)(-1); |
---|
1851 | 2435 | } |
---|
1852 | 2436 | |
---|
.. | .. |
---|
2000 | 2584 | return 0; |
---|
2001 | 2585 | } |
---|
2002 | 2586 | |
---|
2003 | | -static int |
---|
2004 | | -lpfc_debugfs_dumpDataDif_release(struct inode *inode, struct file *file) |
---|
| 2587 | +/** |
---|
| 2588 | + * lpfc_debugfs_multixripools_write - Clear multi-XRI pools statistics |
---|
| 2589 | + * @file: The file pointer to read from. |
---|
| 2590 | + * @buf: The buffer to copy the user data from. |
---|
| 2591 | + * @nbytes: The number of bytes to get. |
---|
| 2592 | + * @ppos: The position in the file to start reading from. |
---|
| 2593 | + * |
---|
| 2594 | + * Description: |
---|
| 2595 | + * This routine clears multi-XRI pools statistics when buf contains "clear". |
---|
| 2596 | + * |
---|
| 2597 | + * Return Value: |
---|
| 2598 | + * It returns the @nbytges passing in from debugfs user space when successful. |
---|
| 2599 | + * In case of error conditions, it returns proper error code back to the user |
---|
| 2600 | + * space. |
---|
| 2601 | + **/ |
---|
| 2602 | +static ssize_t |
---|
| 2603 | +lpfc_debugfs_multixripools_write(struct file *file, const char __user *buf, |
---|
| 2604 | + size_t nbytes, loff_t *ppos) |
---|
2005 | 2605 | { |
---|
2006 | 2606 | struct lpfc_debug *debug = file->private_data; |
---|
| 2607 | + struct lpfc_hba *phba = (struct lpfc_hba *)debug->i_private; |
---|
| 2608 | + char mybuf[64]; |
---|
| 2609 | + char *pbuf; |
---|
| 2610 | + u32 i; |
---|
| 2611 | + u32 hwq_count; |
---|
| 2612 | + struct lpfc_sli4_hdw_queue *qp; |
---|
| 2613 | + struct lpfc_multixri_pool *multixri_pool; |
---|
2007 | 2614 | |
---|
2008 | | - debug->buffer = NULL; |
---|
2009 | | - kfree(debug); |
---|
| 2615 | + if (nbytes > sizeof(mybuf) - 1) |
---|
| 2616 | + nbytes = sizeof(mybuf) - 1; |
---|
2010 | 2617 | |
---|
2011 | | - return 0; |
---|
| 2618 | + memset(mybuf, 0, sizeof(mybuf)); |
---|
| 2619 | + |
---|
| 2620 | + if (copy_from_user(mybuf, buf, nbytes)) |
---|
| 2621 | + return -EFAULT; |
---|
| 2622 | + pbuf = &mybuf[0]; |
---|
| 2623 | + |
---|
| 2624 | + if ((strncmp(pbuf, "clear", strlen("clear"))) == 0) { |
---|
| 2625 | + hwq_count = phba->cfg_hdw_queue; |
---|
| 2626 | + for (i = 0; i < hwq_count; i++) { |
---|
| 2627 | + qp = &phba->sli4_hba.hdwq[i]; |
---|
| 2628 | + multixri_pool = qp->p_multixri_pool; |
---|
| 2629 | + if (!multixri_pool) |
---|
| 2630 | + continue; |
---|
| 2631 | + |
---|
| 2632 | + qp->empty_io_bufs = 0; |
---|
| 2633 | + multixri_pool->pbl_empty_count = 0; |
---|
| 2634 | +#ifdef LPFC_MXP_STAT |
---|
| 2635 | + multixri_pool->above_limit_count = 0; |
---|
| 2636 | + multixri_pool->below_limit_count = 0; |
---|
| 2637 | + multixri_pool->stat_max_hwm = 0; |
---|
| 2638 | + multixri_pool->local_pbl_hit_count = 0; |
---|
| 2639 | + multixri_pool->other_pbl_hit_count = 0; |
---|
| 2640 | + |
---|
| 2641 | + multixri_pool->stat_pbl_count = 0; |
---|
| 2642 | + multixri_pool->stat_pvt_count = 0; |
---|
| 2643 | + multixri_pool->stat_busy_count = 0; |
---|
| 2644 | + multixri_pool->stat_snapshot_taken = 0; |
---|
| 2645 | +#endif |
---|
| 2646 | + } |
---|
| 2647 | + return strlen(pbuf); |
---|
| 2648 | + } |
---|
| 2649 | + |
---|
| 2650 | + return -EINVAL; |
---|
2012 | 2651 | } |
---|
2013 | | - |
---|
2014 | 2652 | |
---|
2015 | 2653 | static int |
---|
2016 | 2654 | lpfc_debugfs_nvmestat_open(struct inode *inode, struct file *file) |
---|
.. | .. |
---|
2055 | 2693 | if (!phba->targetport) |
---|
2056 | 2694 | return -ENXIO; |
---|
2057 | 2695 | |
---|
2058 | | - if (nbytes > 64) |
---|
2059 | | - nbytes = 64; |
---|
| 2696 | + if (nbytes > sizeof(mybuf) - 1) |
---|
| 2697 | + nbytes = sizeof(mybuf) - 1; |
---|
2060 | 2698 | |
---|
2061 | 2699 | memset(mybuf, 0, sizeof(mybuf)); |
---|
2062 | 2700 | |
---|
.. | .. |
---|
2101 | 2739 | } |
---|
2102 | 2740 | |
---|
2103 | 2741 | static int |
---|
2104 | | -lpfc_debugfs_nvmektime_open(struct inode *inode, struct file *file) |
---|
| 2742 | +lpfc_debugfs_scsistat_open(struct inode *inode, struct file *file) |
---|
2105 | 2743 | { |
---|
2106 | 2744 | struct lpfc_vport *vport = inode->i_private; |
---|
2107 | 2745 | struct lpfc_debug *debug; |
---|
.. | .. |
---|
2112 | 2750 | goto out; |
---|
2113 | 2751 | |
---|
2114 | 2752 | /* Round to page boundary */ |
---|
2115 | | - debug->buffer = kmalloc(LPFC_NVMEKTIME_SIZE, GFP_KERNEL); |
---|
| 2753 | + debug->buffer = kzalloc(LPFC_SCSISTAT_SIZE, GFP_KERNEL); |
---|
2116 | 2754 | if (!debug->buffer) { |
---|
2117 | 2755 | kfree(debug); |
---|
2118 | 2756 | goto out; |
---|
2119 | 2757 | } |
---|
2120 | 2758 | |
---|
2121 | | - debug->len = lpfc_debugfs_nvmektime_data(vport, debug->buffer, |
---|
2122 | | - LPFC_NVMEKTIME_SIZE); |
---|
| 2759 | + debug->len = lpfc_debugfs_scsistat_data(vport, debug->buffer, |
---|
| 2760 | + LPFC_SCSISTAT_SIZE); |
---|
2123 | 2761 | |
---|
2124 | 2762 | debug->i_private = inode->i_private; |
---|
2125 | 2763 | file->private_data = debug; |
---|
.. | .. |
---|
2130 | 2768 | } |
---|
2131 | 2769 | |
---|
2132 | 2770 | static ssize_t |
---|
2133 | | -lpfc_debugfs_nvmektime_write(struct file *file, const char __user *buf, |
---|
2134 | | - size_t nbytes, loff_t *ppos) |
---|
| 2771 | +lpfc_debugfs_scsistat_write(struct file *file, const char __user *buf, |
---|
| 2772 | + size_t nbytes, loff_t *ppos) |
---|
| 2773 | +{ |
---|
| 2774 | + struct lpfc_debug *debug = file->private_data; |
---|
| 2775 | + struct lpfc_vport *vport = (struct lpfc_vport *)debug->i_private; |
---|
| 2776 | + struct lpfc_hba *phba = vport->phba; |
---|
| 2777 | + char mybuf[6] = {0}; |
---|
| 2778 | + int i; |
---|
| 2779 | + |
---|
| 2780 | + if (copy_from_user(mybuf, buf, (nbytes >= sizeof(mybuf)) ? |
---|
| 2781 | + (sizeof(mybuf) - 1) : nbytes)) |
---|
| 2782 | + return -EFAULT; |
---|
| 2783 | + |
---|
| 2784 | + if ((strncmp(&mybuf[0], "reset", strlen("reset")) == 0) || |
---|
| 2785 | + (strncmp(&mybuf[0], "zero", strlen("zero")) == 0)) { |
---|
| 2786 | + for (i = 0; i < phba->cfg_hdw_queue; i++) { |
---|
| 2787 | + memset(&phba->sli4_hba.hdwq[i].scsi_cstat, 0, |
---|
| 2788 | + sizeof(phba->sli4_hba.hdwq[i].scsi_cstat)); |
---|
| 2789 | + } |
---|
| 2790 | + } |
---|
| 2791 | + |
---|
| 2792 | + return nbytes; |
---|
| 2793 | +} |
---|
| 2794 | + |
---|
| 2795 | +static int |
---|
| 2796 | +lpfc_debugfs_ioktime_open(struct inode *inode, struct file *file) |
---|
| 2797 | +{ |
---|
| 2798 | + struct lpfc_vport *vport = inode->i_private; |
---|
| 2799 | + struct lpfc_debug *debug; |
---|
| 2800 | + int rc = -ENOMEM; |
---|
| 2801 | + |
---|
| 2802 | + debug = kmalloc(sizeof(*debug), GFP_KERNEL); |
---|
| 2803 | + if (!debug) |
---|
| 2804 | + goto out; |
---|
| 2805 | + |
---|
| 2806 | + /* Round to page boundary */ |
---|
| 2807 | + debug->buffer = kmalloc(LPFC_IOKTIME_SIZE, GFP_KERNEL); |
---|
| 2808 | + if (!debug->buffer) { |
---|
| 2809 | + kfree(debug); |
---|
| 2810 | + goto out; |
---|
| 2811 | + } |
---|
| 2812 | + |
---|
| 2813 | + debug->len = lpfc_debugfs_ioktime_data(vport, debug->buffer, |
---|
| 2814 | + LPFC_IOKTIME_SIZE); |
---|
| 2815 | + |
---|
| 2816 | + debug->i_private = inode->i_private; |
---|
| 2817 | + file->private_data = debug; |
---|
| 2818 | + |
---|
| 2819 | + rc = 0; |
---|
| 2820 | +out: |
---|
| 2821 | + return rc; |
---|
| 2822 | +} |
---|
| 2823 | + |
---|
| 2824 | +static ssize_t |
---|
| 2825 | +lpfc_debugfs_ioktime_write(struct file *file, const char __user *buf, |
---|
| 2826 | + size_t nbytes, loff_t *ppos) |
---|
2135 | 2827 | { |
---|
2136 | 2828 | struct lpfc_debug *debug = file->private_data; |
---|
2137 | 2829 | struct lpfc_vport *vport = (struct lpfc_vport *)debug->i_private; |
---|
.. | .. |
---|
2139 | 2831 | char mybuf[64]; |
---|
2140 | 2832 | char *pbuf; |
---|
2141 | 2833 | |
---|
2142 | | - if (nbytes > 64) |
---|
2143 | | - nbytes = 64; |
---|
| 2834 | + if (nbytes > sizeof(mybuf) - 1) |
---|
| 2835 | + nbytes = sizeof(mybuf) - 1; |
---|
2144 | 2836 | |
---|
2145 | 2837 | memset(mybuf, 0, sizeof(mybuf)); |
---|
2146 | 2838 | |
---|
.. | .. |
---|
2267 | 2959 | char mybuf[64]; |
---|
2268 | 2960 | char *pbuf; |
---|
2269 | 2961 | |
---|
2270 | | - if (nbytes > 63) |
---|
2271 | | - nbytes = 63; |
---|
| 2962 | + if (nbytes > sizeof(mybuf) - 1) |
---|
| 2963 | + nbytes = sizeof(mybuf) - 1; |
---|
2272 | 2964 | |
---|
2273 | 2965 | memset(mybuf, 0, sizeof(mybuf)); |
---|
2274 | 2966 | |
---|
.. | .. |
---|
2333 | 3025 | } |
---|
2334 | 3026 | |
---|
2335 | 3027 | static int |
---|
2336 | | -lpfc_debugfs_cpucheck_open(struct inode *inode, struct file *file) |
---|
| 3028 | +lpfc_debugfs_hdwqstat_open(struct inode *inode, struct file *file) |
---|
2337 | 3029 | { |
---|
2338 | 3030 | struct lpfc_vport *vport = inode->i_private; |
---|
2339 | 3031 | struct lpfc_debug *debug; |
---|
.. | .. |
---|
2344 | 3036 | goto out; |
---|
2345 | 3037 | |
---|
2346 | 3038 | /* Round to page boundary */ |
---|
2347 | | - debug->buffer = kmalloc(LPFC_CPUCHECK_SIZE, GFP_KERNEL); |
---|
| 3039 | + debug->buffer = kcalloc(1, LPFC_SCSISTAT_SIZE, GFP_KERNEL); |
---|
2348 | 3040 | if (!debug->buffer) { |
---|
2349 | 3041 | kfree(debug); |
---|
2350 | 3042 | goto out; |
---|
2351 | 3043 | } |
---|
2352 | 3044 | |
---|
2353 | | - debug->len = lpfc_debugfs_cpucheck_data(vport, debug->buffer, |
---|
2354 | | - LPFC_NVMEKTIME_SIZE); |
---|
| 3045 | + debug->len = lpfc_debugfs_hdwqstat_data(vport, debug->buffer, |
---|
| 3046 | + LPFC_SCSISTAT_SIZE); |
---|
2355 | 3047 | |
---|
2356 | 3048 | debug->i_private = inode->i_private; |
---|
2357 | 3049 | file->private_data = debug; |
---|
.. | .. |
---|
2362 | 3054 | } |
---|
2363 | 3055 | |
---|
2364 | 3056 | static ssize_t |
---|
2365 | | -lpfc_debugfs_cpucheck_write(struct file *file, const char __user *buf, |
---|
| 3057 | +lpfc_debugfs_hdwqstat_write(struct file *file, const char __user *buf, |
---|
2366 | 3058 | size_t nbytes, loff_t *ppos) |
---|
2367 | 3059 | { |
---|
2368 | 3060 | struct lpfc_debug *debug = file->private_data; |
---|
2369 | 3061 | struct lpfc_vport *vport = (struct lpfc_vport *)debug->i_private; |
---|
2370 | 3062 | struct lpfc_hba *phba = vport->phba; |
---|
| 3063 | + struct lpfc_hdwq_stat *c_stat; |
---|
2371 | 3064 | char mybuf[64]; |
---|
2372 | 3065 | char *pbuf; |
---|
2373 | 3066 | int i; |
---|
2374 | 3067 | |
---|
2375 | | - if (nbytes > 64) |
---|
2376 | | - nbytes = 64; |
---|
| 3068 | + if (nbytes > sizeof(mybuf) - 1) |
---|
| 3069 | + nbytes = sizeof(mybuf) - 1; |
---|
2377 | 3070 | |
---|
2378 | 3071 | memset(mybuf, 0, sizeof(mybuf)); |
---|
2379 | 3072 | |
---|
.. | .. |
---|
2383 | 3076 | |
---|
2384 | 3077 | if ((strncmp(pbuf, "on", sizeof("on") - 1) == 0)) { |
---|
2385 | 3078 | if (phba->nvmet_support) |
---|
2386 | | - phba->cpucheck_on |= LPFC_CHECK_NVMET_IO; |
---|
| 3079 | + phba->hdwqstat_on |= LPFC_CHECK_NVMET_IO; |
---|
2387 | 3080 | else |
---|
2388 | | - phba->cpucheck_on |= LPFC_CHECK_NVME_IO; |
---|
| 3081 | + phba->hdwqstat_on |= (LPFC_CHECK_NVME_IO | |
---|
| 3082 | + LPFC_CHECK_SCSI_IO); |
---|
2389 | 3083 | return strlen(pbuf); |
---|
2390 | | - } else if ((strncmp(pbuf, "rcv", |
---|
2391 | | - sizeof("rcv") - 1) == 0)) { |
---|
| 3084 | + } else if ((strncmp(pbuf, "nvme_on", sizeof("nvme_on") - 1) == 0)) { |
---|
2392 | 3085 | if (phba->nvmet_support) |
---|
2393 | | - phba->cpucheck_on |= LPFC_CHECK_NVMET_RCV; |
---|
| 3086 | + phba->hdwqstat_on |= LPFC_CHECK_NVMET_IO; |
---|
2394 | 3087 | else |
---|
2395 | | - return -EINVAL; |
---|
| 3088 | + phba->hdwqstat_on |= LPFC_CHECK_NVME_IO; |
---|
| 3089 | + return strlen(pbuf); |
---|
| 3090 | + } else if ((strncmp(pbuf, "scsi_on", sizeof("scsi_on") - 1) == 0)) { |
---|
| 3091 | + if (!phba->nvmet_support) |
---|
| 3092 | + phba->hdwqstat_on |= LPFC_CHECK_SCSI_IO; |
---|
| 3093 | + return strlen(pbuf); |
---|
| 3094 | + } else if ((strncmp(pbuf, "nvme_off", sizeof("nvme_off") - 1) == 0)) { |
---|
| 3095 | + phba->hdwqstat_on &= ~(LPFC_CHECK_NVME_IO | |
---|
| 3096 | + LPFC_CHECK_NVMET_IO); |
---|
| 3097 | + return strlen(pbuf); |
---|
| 3098 | + } else if ((strncmp(pbuf, "scsi_off", sizeof("scsi_off") - 1) == 0)) { |
---|
| 3099 | + phba->hdwqstat_on &= ~LPFC_CHECK_SCSI_IO; |
---|
2396 | 3100 | return strlen(pbuf); |
---|
2397 | 3101 | } else if ((strncmp(pbuf, "off", |
---|
2398 | 3102 | sizeof("off") - 1) == 0)) { |
---|
2399 | | - phba->cpucheck_on = LPFC_CHECK_OFF; |
---|
| 3103 | + phba->hdwqstat_on = LPFC_CHECK_OFF; |
---|
2400 | 3104 | return strlen(pbuf); |
---|
2401 | 3105 | } else if ((strncmp(pbuf, "zero", |
---|
2402 | 3106 | sizeof("zero") - 1) == 0)) { |
---|
2403 | | - for (i = 0; i < phba->sli4_hba.num_present_cpu; i++) { |
---|
2404 | | - if (i >= LPFC_CHECK_CPU_CNT) |
---|
2405 | | - break; |
---|
2406 | | - phba->cpucheck_rcv_io[i] = 0; |
---|
2407 | | - phba->cpucheck_xmt_io[i] = 0; |
---|
2408 | | - phba->cpucheck_cmpl_io[i] = 0; |
---|
2409 | | - phba->cpucheck_ccmpl_io[i] = 0; |
---|
| 3107 | + for_each_present_cpu(i) { |
---|
| 3108 | + c_stat = per_cpu_ptr(phba->sli4_hba.c_stat, i); |
---|
| 3109 | + c_stat->xmt_io = 0; |
---|
| 3110 | + c_stat->cmpl_io = 0; |
---|
| 3111 | + c_stat->rcv_io = 0; |
---|
2410 | 3112 | } |
---|
2411 | 3113 | return strlen(pbuf); |
---|
2412 | 3114 | } |
---|
.. | .. |
---|
3169 | 3871 | (unsigned long long)qp->q_cnt_4); |
---|
3170 | 3872 | len += scnprintf(pbuffer + len, LPFC_QUE_INFO_GET_BUF_SIZE - len, |
---|
3171 | 3873 | "\t\tWQID[%02d], QE-CNT[%04d], QE-SZ[%04d], " |
---|
3172 | | - "HST-IDX[%04d], PRT-IDX[%04d], PST[%03d]", |
---|
| 3874 | + "HST-IDX[%04d], PRT-IDX[%04d], NTFI[%03d]", |
---|
3173 | 3875 | qp->queue_id, qp->entry_count, |
---|
3174 | 3876 | qp->entry_size, qp->host_index, |
---|
3175 | | - qp->hba_index, qp->entry_repost); |
---|
| 3877 | + qp->hba_index, qp->notify_interval); |
---|
3176 | 3878 | len += scnprintf(pbuffer + len, |
---|
3177 | 3879 | LPFC_QUE_INFO_GET_BUF_SIZE - len, "\n"); |
---|
3178 | 3880 | return len; |
---|
.. | .. |
---|
3185 | 3887 | struct lpfc_queue *qp; |
---|
3186 | 3888 | int qidx; |
---|
3187 | 3889 | |
---|
3188 | | - for (qidx = 0; qidx < phba->cfg_fcp_io_channel; qidx++) { |
---|
3189 | | - qp = phba->sli4_hba.fcp_wq[qidx]; |
---|
3190 | | - if (qp->assoc_qid != cq_id) |
---|
3191 | | - continue; |
---|
3192 | | - *len = __lpfc_idiag_print_wq(qp, wqtype, pbuffer, *len); |
---|
3193 | | - if (*len >= max_cnt) |
---|
3194 | | - return 1; |
---|
3195 | | - } |
---|
3196 | | - for (qidx = 0; qidx < phba->cfg_nvme_io_channel; qidx++) { |
---|
3197 | | - qp = phba->sli4_hba.nvme_wq[qidx]; |
---|
| 3890 | + for (qidx = 0; qidx < phba->cfg_hdw_queue; qidx++) { |
---|
| 3891 | + qp = phba->sli4_hba.hdwq[qidx].io_wq; |
---|
3198 | 3892 | if (qp->assoc_qid != cq_id) |
---|
3199 | 3893 | continue; |
---|
3200 | 3894 | *len = __lpfc_idiag_print_wq(qp, wqtype, pbuffer, *len); |
---|
.. | .. |
---|
3220 | 3914 | qp->q_cnt_3, (unsigned long long)qp->q_cnt_4); |
---|
3221 | 3915 | len += scnprintf(pbuffer + len, LPFC_QUE_INFO_GET_BUF_SIZE - len, |
---|
3222 | 3916 | "\tCQID[%02d], QE-CNT[%04d], QE-SZ[%04d], " |
---|
3223 | | - "HST-IDX[%04d], PRT-IDX[%04d], PST[%03d]", |
---|
| 3917 | + "HST-IDX[%04d], NTFI[%03d], PLMT[%03d]", |
---|
3224 | 3918 | qp->queue_id, qp->entry_count, |
---|
3225 | 3919 | qp->entry_size, qp->host_index, |
---|
3226 | | - qp->hba_index, qp->entry_repost); |
---|
| 3920 | + qp->notify_interval, qp->max_proc_limit); |
---|
3227 | 3921 | |
---|
3228 | | - len += scnprintf(pbuffer + len, LPFC_QUE_INFO_GET_BUF_SIZE - len, "\n"); |
---|
| 3922 | + len += scnprintf(pbuffer + len, LPFC_QUE_INFO_GET_BUF_SIZE - len, |
---|
| 3923 | + "\n"); |
---|
3229 | 3924 | |
---|
3230 | 3925 | return len; |
---|
3231 | 3926 | } |
---|
.. | .. |
---|
3246 | 3941 | qp->q_cnt_3, (unsigned long long)qp->q_cnt_4); |
---|
3247 | 3942 | len += scnprintf(pbuffer + len, LPFC_QUE_INFO_GET_BUF_SIZE - len, |
---|
3248 | 3943 | "\t\tHQID[%02d], QE-CNT[%04d], QE-SZ[%04d], " |
---|
3249 | | - "HST-IDX[%04d], PRT-IDX[%04d], PST[%03d]\n", |
---|
| 3944 | + "HST-IDX[%04d], PRT-IDX[%04d], NTFI[%03d]\n", |
---|
3250 | 3945 | qp->queue_id, qp->entry_count, qp->entry_size, |
---|
3251 | | - qp->host_index, qp->hba_index, qp->entry_repost); |
---|
| 3946 | + qp->host_index, qp->hba_index, qp->notify_interval); |
---|
3252 | 3947 | len += scnprintf(pbuffer + len, LPFC_QUE_INFO_GET_BUF_SIZE - len, |
---|
3253 | 3948 | "\t\tDQID[%02d], QE-CNT[%04d], QE-SZ[%04d], " |
---|
3254 | | - "HST-IDX[%04d], PRT-IDX[%04d], PST[%03d]\n", |
---|
| 3949 | + "HST-IDX[%04d], PRT-IDX[%04d], NTFI[%03d]\n", |
---|
3255 | 3950 | datqp->queue_id, datqp->entry_count, |
---|
3256 | 3951 | datqp->entry_size, datqp->host_index, |
---|
3257 | | - datqp->hba_index, datqp->entry_repost); |
---|
| 3952 | + datqp->hba_index, datqp->notify_interval); |
---|
3258 | 3953 | return len; |
---|
3259 | 3954 | } |
---|
3260 | 3955 | |
---|
.. | .. |
---|
3263 | 3958 | int *len, int max_cnt, int eqidx, int eq_id) |
---|
3264 | 3959 | { |
---|
3265 | 3960 | struct lpfc_queue *qp; |
---|
3266 | | - int qidx, rc; |
---|
| 3961 | + int rc; |
---|
3267 | 3962 | |
---|
3268 | | - for (qidx = 0; qidx < phba->cfg_fcp_io_channel; qidx++) { |
---|
3269 | | - qp = phba->sli4_hba.fcp_cq[qidx]; |
---|
3270 | | - if (qp->assoc_qid != eq_id) |
---|
3271 | | - continue; |
---|
| 3963 | + qp = phba->sli4_hba.hdwq[eqidx].io_cq; |
---|
3272 | 3964 | |
---|
3273 | | - *len = __lpfc_idiag_print_cq(qp, "FCP", pbuffer, *len); |
---|
| 3965 | + *len = __lpfc_idiag_print_cq(qp, "IO", pbuffer, *len); |
---|
3274 | 3966 | |
---|
3275 | | - /* Reset max counter */ |
---|
3276 | | - qp->CQ_max_cqe = 0; |
---|
| 3967 | + /* Reset max counter */ |
---|
| 3968 | + qp->CQ_max_cqe = 0; |
---|
3277 | 3969 | |
---|
3278 | | - if (*len >= max_cnt) |
---|
3279 | | - return 1; |
---|
| 3970 | + if (*len >= max_cnt) |
---|
| 3971 | + return 1; |
---|
3280 | 3972 | |
---|
3281 | | - rc = lpfc_idiag_wqs_for_cq(phba, "FCP", pbuffer, len, |
---|
3282 | | - max_cnt, qp->queue_id); |
---|
3283 | | - if (rc) |
---|
3284 | | - return 1; |
---|
3285 | | - } |
---|
3286 | | - |
---|
3287 | | - for (qidx = 0; qidx < phba->cfg_nvme_io_channel; qidx++) { |
---|
3288 | | - qp = phba->sli4_hba.nvme_cq[qidx]; |
---|
3289 | | - if (qp->assoc_qid != eq_id) |
---|
3290 | | - continue; |
---|
3291 | | - |
---|
3292 | | - *len = __lpfc_idiag_print_cq(qp, "NVME", pbuffer, *len); |
---|
3293 | | - |
---|
3294 | | - /* Reset max counter */ |
---|
3295 | | - qp->CQ_max_cqe = 0; |
---|
3296 | | - |
---|
3297 | | - if (*len >= max_cnt) |
---|
3298 | | - return 1; |
---|
3299 | | - |
---|
3300 | | - rc = lpfc_idiag_wqs_for_cq(phba, "NVME", pbuffer, len, |
---|
3301 | | - max_cnt, qp->queue_id); |
---|
3302 | | - if (rc) |
---|
3303 | | - return 1; |
---|
3304 | | - } |
---|
| 3973 | + rc = lpfc_idiag_wqs_for_cq(phba, "IO", pbuffer, len, |
---|
| 3974 | + max_cnt, qp->queue_id); |
---|
| 3975 | + if (rc) |
---|
| 3976 | + return 1; |
---|
3305 | 3977 | |
---|
3306 | 3978 | if ((eqidx < phba->cfg_nvmet_mrq) && phba->nvmet_support) { |
---|
3307 | 3979 | /* NVMET CQset */ |
---|
.. | .. |
---|
3341 | 4013 | (unsigned long long)qp->q_cnt_4, qp->q_mode); |
---|
3342 | 4014 | len += scnprintf(pbuffer + len, LPFC_QUE_INFO_GET_BUF_SIZE - len, |
---|
3343 | 4015 | "EQID[%02d], QE-CNT[%04d], QE-SZ[%04d], " |
---|
3344 | | - "HST-IDX[%04d], PRT-IDX[%04d], PST[%03d]", |
---|
| 4016 | + "HST-IDX[%04d], NTFI[%03d], PLMT[%03d], AFFIN[%03d]", |
---|
3345 | 4017 | qp->queue_id, qp->entry_count, qp->entry_size, |
---|
3346 | | - qp->host_index, qp->hba_index, qp->entry_repost); |
---|
3347 | | - len += scnprintf(pbuffer + len, LPFC_QUE_INFO_GET_BUF_SIZE - len, "\n"); |
---|
| 4018 | + qp->host_index, qp->notify_interval, |
---|
| 4019 | + qp->max_proc_limit, qp->chann); |
---|
| 4020 | + len += scnprintf(pbuffer + len, LPFC_QUE_INFO_GET_BUF_SIZE - len, |
---|
| 4021 | + "\n"); |
---|
3348 | 4022 | |
---|
3349 | 4023 | return len; |
---|
3350 | 4024 | } |
---|
.. | .. |
---|
3390 | 4064 | spin_lock_irq(&phba->hbalock); |
---|
3391 | 4065 | |
---|
3392 | 4066 | /* Fast-path event queue */ |
---|
3393 | | - if (phba->sli4_hba.hba_eq && phba->io_channel_irqs) { |
---|
| 4067 | + if (phba->sli4_hba.hdwq && phba->cfg_hdw_queue) { |
---|
3394 | 4068 | |
---|
3395 | 4069 | x = phba->lpfc_idiag_last_eq; |
---|
3396 | | - if (phba->cfg_fof && (x >= phba->io_channel_irqs)) { |
---|
3397 | | - phba->lpfc_idiag_last_eq = 0; |
---|
3398 | | - goto fof; |
---|
3399 | | - } |
---|
3400 | 4070 | phba->lpfc_idiag_last_eq++; |
---|
3401 | | - if (phba->lpfc_idiag_last_eq >= phba->io_channel_irqs) |
---|
3402 | | - if (phba->cfg_fof == 0) |
---|
3403 | | - phba->lpfc_idiag_last_eq = 0; |
---|
| 4071 | + if (phba->lpfc_idiag_last_eq >= phba->cfg_hdw_queue) |
---|
| 4072 | + phba->lpfc_idiag_last_eq = 0; |
---|
3404 | 4073 | |
---|
3405 | | - len += scnprintf(pbuffer + len, LPFC_QUE_INFO_GET_BUF_SIZE - len, |
---|
3406 | | - "EQ %d out of %d HBA EQs\n", |
---|
3407 | | - x, phba->io_channel_irqs); |
---|
| 4074 | + len += scnprintf(pbuffer + len, |
---|
| 4075 | + LPFC_QUE_INFO_GET_BUF_SIZE - len, |
---|
| 4076 | + "HDWQ %d out of %d HBA HDWQs\n", |
---|
| 4077 | + x, phba->cfg_hdw_queue); |
---|
3408 | 4078 | |
---|
3409 | 4079 | /* Fast-path EQ */ |
---|
3410 | | - qp = phba->sli4_hba.hba_eq[x]; |
---|
| 4080 | + qp = phba->sli4_hba.hdwq[x].hba_eq; |
---|
3411 | 4081 | if (!qp) |
---|
3412 | 4082 | goto out; |
---|
3413 | 4083 | |
---|
.. | .. |
---|
3482 | 4152 | goto out; |
---|
3483 | 4153 | } |
---|
3484 | 4154 | |
---|
3485 | | -fof: |
---|
3486 | | - if (phba->cfg_fof) { |
---|
3487 | | - /* FOF EQ */ |
---|
3488 | | - qp = phba->sli4_hba.fof_eq; |
---|
3489 | | - len = __lpfc_idiag_print_eq(qp, "FOF", pbuffer, len); |
---|
3490 | | - |
---|
3491 | | - /* Reset max counter */ |
---|
3492 | | - if (qp) |
---|
3493 | | - qp->EQ_max_eqe = 0; |
---|
3494 | | - |
---|
3495 | | - if (len >= max_cnt) |
---|
3496 | | - goto too_big; |
---|
3497 | | - |
---|
3498 | | - /* OAS CQ */ |
---|
3499 | | - qp = phba->sli4_hba.oas_cq; |
---|
3500 | | - len = __lpfc_idiag_print_cq(qp, "OAS", pbuffer, len); |
---|
3501 | | - /* Reset max counter */ |
---|
3502 | | - if (qp) |
---|
3503 | | - qp->CQ_max_cqe = 0; |
---|
3504 | | - if (len >= max_cnt) |
---|
3505 | | - goto too_big; |
---|
3506 | | - |
---|
3507 | | - /* OAS WQ */ |
---|
3508 | | - qp = phba->sli4_hba.oas_wq; |
---|
3509 | | - len = __lpfc_idiag_print_wq(qp, "OAS", pbuffer, len); |
---|
3510 | | - if (len >= max_cnt) |
---|
3511 | | - goto too_big; |
---|
3512 | | - } |
---|
3513 | | - |
---|
3514 | 4155 | spin_unlock_irq(&phba->hbalock); |
---|
3515 | 4156 | return simple_read_from_buffer(buf, nbytes, ppos, pbuffer, len); |
---|
3516 | 4157 | |
---|
.. | .. |
---|
3575 | 4216 | "QE-INDEX[%04d]:\n", index); |
---|
3576 | 4217 | |
---|
3577 | 4218 | offset = 0; |
---|
3578 | | - pentry = pque->qe[index].address; |
---|
| 4219 | + pentry = lpfc_sli4_qe(pque, index); |
---|
3579 | 4220 | while (esize > 0) { |
---|
3580 | 4221 | len += scnprintf(pbuffer+len, LPFC_QUE_ACC_BUF_SIZE-len, |
---|
3581 | 4222 | "%08x ", *pentry); |
---|
.. | .. |
---|
3728 | 4369 | switch (quetp) { |
---|
3729 | 4370 | case LPFC_IDIAG_EQ: |
---|
3730 | 4371 | /* HBA event queue */ |
---|
3731 | | - if (phba->sli4_hba.hba_eq) { |
---|
3732 | | - for (qidx = 0; qidx < phba->io_channel_irqs; qidx++) { |
---|
3733 | | - qp = phba->sli4_hba.hba_eq[qidx]; |
---|
| 4372 | + if (phba->sli4_hba.hdwq) { |
---|
| 4373 | + for (qidx = 0; qidx < phba->cfg_hdw_queue; qidx++) { |
---|
| 4374 | + qp = phba->sli4_hba.hdwq[qidx].hba_eq; |
---|
3734 | 4375 | if (qp && qp->queue_id == queid) { |
---|
3735 | 4376 | /* Sanity check */ |
---|
3736 | 4377 | rc = lpfc_idiag_que_param_check(qp, |
---|
.. | .. |
---|
3779 | 4420 | goto pass_check; |
---|
3780 | 4421 | } |
---|
3781 | 4422 | /* FCP complete queue */ |
---|
3782 | | - if (phba->sli4_hba.fcp_cq) { |
---|
3783 | | - for (qidx = 0; qidx < phba->cfg_fcp_io_channel; |
---|
| 4423 | + if (phba->sli4_hba.hdwq) { |
---|
| 4424 | + for (qidx = 0; qidx < phba->cfg_hdw_queue; |
---|
3784 | 4425 | qidx++) { |
---|
3785 | | - qp = phba->sli4_hba.fcp_cq[qidx]; |
---|
| 4426 | + qp = phba->sli4_hba.hdwq[qidx].io_cq; |
---|
3786 | 4427 | if (qp && qp->queue_id == queid) { |
---|
3787 | 4428 | /* Sanity check */ |
---|
3788 | 4429 | rc = lpfc_idiag_que_param_check( |
---|
.. | .. |
---|
3793 | 4434 | goto pass_check; |
---|
3794 | 4435 | } |
---|
3795 | 4436 | } |
---|
3796 | | - } |
---|
3797 | | - /* NVME complete queue */ |
---|
3798 | | - if (phba->sli4_hba.nvme_cq) { |
---|
3799 | | - qidx = 0; |
---|
3800 | | - do { |
---|
3801 | | - if (phba->sli4_hba.nvme_cq[qidx] && |
---|
3802 | | - phba->sli4_hba.nvme_cq[qidx]->queue_id == |
---|
3803 | | - queid) { |
---|
3804 | | - /* Sanity check */ |
---|
3805 | | - rc = lpfc_idiag_que_param_check( |
---|
3806 | | - phba->sli4_hba.nvme_cq[qidx], |
---|
3807 | | - index, count); |
---|
3808 | | - if (rc) |
---|
3809 | | - goto error_out; |
---|
3810 | | - idiag.ptr_private = |
---|
3811 | | - phba->sli4_hba.nvme_cq[qidx]; |
---|
3812 | | - goto pass_check; |
---|
3813 | | - } |
---|
3814 | | - } while (++qidx < phba->cfg_nvme_io_channel); |
---|
3815 | 4437 | } |
---|
3816 | 4438 | goto error_out; |
---|
3817 | 4439 | break; |
---|
.. | .. |
---|
3852 | 4474 | idiag.ptr_private = phba->sli4_hba.nvmels_wq; |
---|
3853 | 4475 | goto pass_check; |
---|
3854 | 4476 | } |
---|
3855 | | - /* FCP work queue */ |
---|
3856 | | - if (phba->sli4_hba.fcp_wq) { |
---|
3857 | | - for (qidx = 0; qidx < phba->cfg_fcp_io_channel; |
---|
3858 | | - qidx++) { |
---|
3859 | | - qp = phba->sli4_hba.fcp_wq[qidx]; |
---|
3860 | | - if (qp && qp->queue_id == queid) { |
---|
3861 | | - /* Sanity check */ |
---|
3862 | | - rc = lpfc_idiag_que_param_check( |
---|
3863 | | - qp, index, count); |
---|
3864 | | - if (rc) |
---|
3865 | | - goto error_out; |
---|
3866 | | - idiag.ptr_private = qp; |
---|
3867 | | - goto pass_check; |
---|
3868 | | - } |
---|
3869 | | - } |
---|
3870 | | - } |
---|
3871 | | - /* NVME work queue */ |
---|
3872 | | - if (phba->sli4_hba.nvme_wq) { |
---|
3873 | | - for (qidx = 0; qidx < phba->cfg_nvme_io_channel; |
---|
3874 | | - qidx++) { |
---|
3875 | | - qp = phba->sli4_hba.nvme_wq[qidx]; |
---|
| 4477 | + |
---|
| 4478 | + if (phba->sli4_hba.hdwq) { |
---|
| 4479 | + /* FCP/SCSI work queue */ |
---|
| 4480 | + for (qidx = 0; qidx < phba->cfg_hdw_queue; qidx++) { |
---|
| 4481 | + qp = phba->sli4_hba.hdwq[qidx].io_wq; |
---|
3876 | 4482 | if (qp && qp->queue_id == queid) { |
---|
3877 | 4483 | /* Sanity check */ |
---|
3878 | 4484 | rc = lpfc_idiag_que_param_check( |
---|
.. | .. |
---|
3885 | 4491 | } |
---|
3886 | 4492 | } |
---|
3887 | 4493 | |
---|
3888 | | - /* NVME work queues */ |
---|
3889 | | - if (phba->sli4_hba.nvme_wq) { |
---|
3890 | | - for (qidx = 0; qidx < phba->cfg_nvme_io_channel; |
---|
3891 | | - qidx++) { |
---|
3892 | | - if (!phba->sli4_hba.nvme_wq[qidx]) |
---|
3893 | | - continue; |
---|
3894 | | - if (phba->sli4_hba.nvme_wq[qidx]->queue_id == |
---|
3895 | | - queid) { |
---|
3896 | | - /* Sanity check */ |
---|
3897 | | - rc = lpfc_idiag_que_param_check( |
---|
3898 | | - phba->sli4_hba.nvme_wq[qidx], |
---|
3899 | | - index, count); |
---|
3900 | | - if (rc) |
---|
3901 | | - goto error_out; |
---|
3902 | | - idiag.ptr_private = |
---|
3903 | | - phba->sli4_hba.nvme_wq[qidx]; |
---|
3904 | | - goto pass_check; |
---|
3905 | | - } |
---|
3906 | | - } |
---|
3907 | | - } |
---|
3908 | 4494 | goto error_out; |
---|
3909 | 4495 | break; |
---|
3910 | 4496 | case LPFC_IDIAG_RQ: |
---|
.. | .. |
---|
3951 | 4537 | pque = (struct lpfc_queue *)idiag.ptr_private; |
---|
3952 | 4538 | if (offset > pque->entry_size/sizeof(uint32_t) - 1) |
---|
3953 | 4539 | goto error_out; |
---|
3954 | | - pentry = pque->qe[index].address; |
---|
| 4540 | + pentry = lpfc_sli4_qe(pque, index); |
---|
3955 | 4541 | pentry += offset; |
---|
3956 | 4542 | if (idiag.cmd.opcode == LPFC_IDIAG_CMD_QUEACC_WR) |
---|
3957 | 4543 | *pentry = value; |
---|
.. | .. |
---|
3972 | 4558 | * lpfc_idiag_drbacc_read_reg - idiag debugfs read a doorbell register |
---|
3973 | 4559 | * @phba: The pointer to hba structure. |
---|
3974 | 4560 | * @pbuffer: The pointer to the buffer to copy the data to. |
---|
3975 | | - * @len: The lenght of bytes to copied. |
---|
| 4561 | + * @len: The length of bytes to copied. |
---|
3976 | 4562 | * @drbregid: The id to doorbell registers. |
---|
3977 | 4563 | * |
---|
3978 | 4564 | * Description: |
---|
.. | .. |
---|
4182 | 4768 | * lpfc_idiag_ctlacc_read_reg - idiag debugfs read a control registers |
---|
4183 | 4769 | * @phba: The pointer to hba structure. |
---|
4184 | 4770 | * @pbuffer: The pointer to the buffer to copy the data to. |
---|
4185 | | - * @len: The lenght of bytes to copied. |
---|
| 4771 | + * @len: The length of bytes to copied. |
---|
4186 | 4772 | * @drbregid: The id to doorbell registers. |
---|
4187 | 4773 | * |
---|
4188 | 4774 | * Description: |
---|
.. | .. |
---|
4869 | 5455 | .release = lpfc_debugfs_release, |
---|
4870 | 5456 | }; |
---|
4871 | 5457 | |
---|
| 5458 | +#undef lpfc_debugfs_op_multixripools |
---|
| 5459 | +static const struct file_operations lpfc_debugfs_op_multixripools = { |
---|
| 5460 | + .owner = THIS_MODULE, |
---|
| 5461 | + .open = lpfc_debugfs_multixripools_open, |
---|
| 5462 | + .llseek = lpfc_debugfs_lseek, |
---|
| 5463 | + .read = lpfc_debugfs_read, |
---|
| 5464 | + .write = lpfc_debugfs_multixripools_write, |
---|
| 5465 | + .release = lpfc_debugfs_release, |
---|
| 5466 | +}; |
---|
| 5467 | + |
---|
4872 | 5468 | #undef lpfc_debugfs_op_hbqinfo |
---|
4873 | 5469 | static const struct file_operations lpfc_debugfs_op_hbqinfo = { |
---|
4874 | 5470 | .owner = THIS_MODULE, |
---|
.. | .. |
---|
4876 | 5472 | .llseek = lpfc_debugfs_lseek, |
---|
4877 | 5473 | .read = lpfc_debugfs_read, |
---|
4878 | 5474 | .release = lpfc_debugfs_release, |
---|
| 5475 | +}; |
---|
| 5476 | + |
---|
| 5477 | +#ifdef LPFC_HDWQ_LOCK_STAT |
---|
| 5478 | +#undef lpfc_debugfs_op_lockstat |
---|
| 5479 | +static const struct file_operations lpfc_debugfs_op_lockstat = { |
---|
| 5480 | + .owner = THIS_MODULE, |
---|
| 5481 | + .open = lpfc_debugfs_lockstat_open, |
---|
| 5482 | + .llseek = lpfc_debugfs_lseek, |
---|
| 5483 | + .read = lpfc_debugfs_read, |
---|
| 5484 | + .write = lpfc_debugfs_lockstat_write, |
---|
| 5485 | + .release = lpfc_debugfs_release, |
---|
| 5486 | +}; |
---|
| 5487 | +#endif |
---|
| 5488 | + |
---|
| 5489 | +#undef lpfc_debugfs_ras_log |
---|
| 5490 | +static const struct file_operations lpfc_debugfs_ras_log = { |
---|
| 5491 | + .owner = THIS_MODULE, |
---|
| 5492 | + .open = lpfc_debugfs_ras_log_open, |
---|
| 5493 | + .llseek = lpfc_debugfs_lseek, |
---|
| 5494 | + .read = lpfc_debugfs_read, |
---|
| 5495 | + .release = lpfc_debugfs_ras_log_release, |
---|
4879 | 5496 | }; |
---|
4880 | 5497 | |
---|
4881 | 5498 | #undef lpfc_debugfs_op_dumpHBASlim |
---|
.. | .. |
---|
4906 | 5523 | .release = lpfc_debugfs_release, |
---|
4907 | 5524 | }; |
---|
4908 | 5525 | |
---|
4909 | | -#undef lpfc_debugfs_op_nvmektime |
---|
4910 | | -static const struct file_operations lpfc_debugfs_op_nvmektime = { |
---|
| 5526 | +#undef lpfc_debugfs_op_scsistat |
---|
| 5527 | +static const struct file_operations lpfc_debugfs_op_scsistat = { |
---|
4911 | 5528 | .owner = THIS_MODULE, |
---|
4912 | | - .open = lpfc_debugfs_nvmektime_open, |
---|
| 5529 | + .open = lpfc_debugfs_scsistat_open, |
---|
4913 | 5530 | .llseek = lpfc_debugfs_lseek, |
---|
4914 | 5531 | .read = lpfc_debugfs_read, |
---|
4915 | | - .write = lpfc_debugfs_nvmektime_write, |
---|
| 5532 | + .write = lpfc_debugfs_scsistat_write, |
---|
| 5533 | + .release = lpfc_debugfs_release, |
---|
| 5534 | +}; |
---|
| 5535 | + |
---|
| 5536 | +#undef lpfc_debugfs_op_ioktime |
---|
| 5537 | +static const struct file_operations lpfc_debugfs_op_ioktime = { |
---|
| 5538 | + .owner = THIS_MODULE, |
---|
| 5539 | + .open = lpfc_debugfs_ioktime_open, |
---|
| 5540 | + .llseek = lpfc_debugfs_lseek, |
---|
| 5541 | + .read = lpfc_debugfs_read, |
---|
| 5542 | + .write = lpfc_debugfs_ioktime_write, |
---|
4916 | 5543 | .release = lpfc_debugfs_release, |
---|
4917 | 5544 | }; |
---|
4918 | 5545 | |
---|
.. | .. |
---|
4926 | 5553 | .release = lpfc_debugfs_release, |
---|
4927 | 5554 | }; |
---|
4928 | 5555 | |
---|
4929 | | -#undef lpfc_debugfs_op_cpucheck |
---|
4930 | | -static const struct file_operations lpfc_debugfs_op_cpucheck = { |
---|
| 5556 | +#undef lpfc_debugfs_op_hdwqstat |
---|
| 5557 | +static const struct file_operations lpfc_debugfs_op_hdwqstat = { |
---|
4931 | 5558 | .owner = THIS_MODULE, |
---|
4932 | | - .open = lpfc_debugfs_cpucheck_open, |
---|
| 5559 | + .open = lpfc_debugfs_hdwqstat_open, |
---|
4933 | 5560 | .llseek = lpfc_debugfs_lseek, |
---|
4934 | 5561 | .read = lpfc_debugfs_read, |
---|
4935 | | - .write = lpfc_debugfs_cpucheck_write, |
---|
| 5562 | + .write = lpfc_debugfs_hdwqstat_write, |
---|
4936 | 5563 | .release = lpfc_debugfs_release, |
---|
4937 | | -}; |
---|
4938 | | - |
---|
4939 | | -#undef lpfc_debugfs_op_dumpData |
---|
4940 | | -static const struct file_operations lpfc_debugfs_op_dumpData = { |
---|
4941 | | - .owner = THIS_MODULE, |
---|
4942 | | - .open = lpfc_debugfs_dumpData_open, |
---|
4943 | | - .llseek = lpfc_debugfs_lseek, |
---|
4944 | | - .read = lpfc_debugfs_read, |
---|
4945 | | - .write = lpfc_debugfs_dumpDataDif_write, |
---|
4946 | | - .release = lpfc_debugfs_dumpDataDif_release, |
---|
4947 | | -}; |
---|
4948 | | - |
---|
4949 | | -#undef lpfc_debugfs_op_dumpDif |
---|
4950 | | -static const struct file_operations lpfc_debugfs_op_dumpDif = { |
---|
4951 | | - .owner = THIS_MODULE, |
---|
4952 | | - .open = lpfc_debugfs_dumpDif_open, |
---|
4953 | | - .llseek = lpfc_debugfs_lseek, |
---|
4954 | | - .read = lpfc_debugfs_read, |
---|
4955 | | - .write = lpfc_debugfs_dumpDataDif_write, |
---|
4956 | | - .release = lpfc_debugfs_dumpDataDif_release, |
---|
4957 | 5564 | }; |
---|
4958 | 5565 | |
---|
4959 | 5566 | #undef lpfc_debugfs_op_dif_err |
---|
.. | .. |
---|
5058 | 5665 | .write = lpfc_idiag_extacc_write, |
---|
5059 | 5666 | .release = lpfc_idiag_cmd_release, |
---|
5060 | 5667 | }; |
---|
5061 | | - |
---|
5062 | 5668 | #endif |
---|
5063 | 5669 | |
---|
5064 | 5670 | /* lpfc_idiag_mbxacc_dump_bsg_mbox - idiag debugfs dump bsg mailbox command |
---|
.. | .. |
---|
5283 | 5889 | if (!lpfc_debugfs_root) { |
---|
5284 | 5890 | lpfc_debugfs_root = debugfs_create_dir("lpfc", NULL); |
---|
5285 | 5891 | atomic_set(&lpfc_debugfs_hba_count, 0); |
---|
5286 | | - if (!lpfc_debugfs_root) { |
---|
5287 | | - lpfc_printf_vlog(vport, KERN_ERR, LOG_INIT, |
---|
5288 | | - "0408 Cannot create debugfs root\n"); |
---|
5289 | | - goto debug_failed; |
---|
5290 | | - } |
---|
5291 | 5892 | } |
---|
5292 | 5893 | if (!lpfc_debugfs_start_time) |
---|
5293 | 5894 | lpfc_debugfs_start_time = jiffies; |
---|
.. | .. |
---|
5298 | 5899 | pport_setup = true; |
---|
5299 | 5900 | phba->hba_debugfs_root = |
---|
5300 | 5901 | debugfs_create_dir(name, lpfc_debugfs_root); |
---|
5301 | | - if (!phba->hba_debugfs_root) { |
---|
5302 | | - lpfc_printf_vlog(vport, KERN_ERR, LOG_INIT, |
---|
5303 | | - "0412 Cannot create debugfs hba\n"); |
---|
5304 | | - goto debug_failed; |
---|
5305 | | - } |
---|
5306 | 5902 | atomic_inc(&lpfc_debugfs_hba_count); |
---|
5307 | 5903 | atomic_set(&phba->debugfs_vport_count, 0); |
---|
| 5904 | + |
---|
| 5905 | + /* Multi-XRI pools */ |
---|
| 5906 | + snprintf(name, sizeof(name), "multixripools"); |
---|
| 5907 | + phba->debug_multixri_pools = |
---|
| 5908 | + debugfs_create_file(name, S_IFREG | 0644, |
---|
| 5909 | + phba->hba_debugfs_root, |
---|
| 5910 | + phba, |
---|
| 5911 | + &lpfc_debugfs_op_multixripools); |
---|
| 5912 | + if (IS_ERR(phba->debug_multixri_pools)) { |
---|
| 5913 | + lpfc_printf_vlog(vport, KERN_ERR, LOG_INIT, |
---|
| 5914 | + "0527 Cannot create debugfs multixripools\n"); |
---|
| 5915 | + goto debug_failed; |
---|
| 5916 | + } |
---|
| 5917 | + |
---|
| 5918 | + /* RAS log */ |
---|
| 5919 | + snprintf(name, sizeof(name), "ras_log"); |
---|
| 5920 | + phba->debug_ras_log = |
---|
| 5921 | + debugfs_create_file(name, 0644, |
---|
| 5922 | + phba->hba_debugfs_root, |
---|
| 5923 | + phba, &lpfc_debugfs_ras_log); |
---|
| 5924 | + if (IS_ERR(phba->debug_ras_log)) { |
---|
| 5925 | + lpfc_printf_vlog(vport, KERN_ERR, LOG_INIT, |
---|
| 5926 | + "6148 Cannot create debugfs" |
---|
| 5927 | + " ras_log\n"); |
---|
| 5928 | + goto debug_failed; |
---|
| 5929 | + } |
---|
5308 | 5930 | |
---|
5309 | 5931 | /* Setup hbqinfo */ |
---|
5310 | 5932 | snprintf(name, sizeof(name), "hbqinfo"); |
---|
5311 | 5933 | phba->debug_hbqinfo = |
---|
5312 | | - debugfs_create_file(name, S_IFREG|S_IRUGO|S_IWUSR, |
---|
5313 | | - phba->hba_debugfs_root, |
---|
5314 | | - phba, &lpfc_debugfs_op_hbqinfo); |
---|
5315 | | - if (!phba->debug_hbqinfo) { |
---|
| 5934 | + debugfs_create_file(name, S_IFREG | 0644, |
---|
| 5935 | + phba->hba_debugfs_root, |
---|
| 5936 | + phba, &lpfc_debugfs_op_hbqinfo); |
---|
| 5937 | + |
---|
| 5938 | +#ifdef LPFC_HDWQ_LOCK_STAT |
---|
| 5939 | + /* Setup lockstat */ |
---|
| 5940 | + snprintf(name, sizeof(name), "lockstat"); |
---|
| 5941 | + phba->debug_lockstat = |
---|
| 5942 | + debugfs_create_file(name, S_IFREG | 0644, |
---|
| 5943 | + phba->hba_debugfs_root, |
---|
| 5944 | + phba, &lpfc_debugfs_op_lockstat); |
---|
| 5945 | + if (IS_ERR(phba->debug_lockstat)) { |
---|
5316 | 5946 | lpfc_printf_vlog(vport, KERN_ERR, LOG_INIT, |
---|
5317 | | - "0411 Cannot create debugfs hbqinfo\n"); |
---|
| 5947 | + "4610 Can't create debugfs lockstat\n"); |
---|
5318 | 5948 | goto debug_failed; |
---|
5319 | 5949 | } |
---|
| 5950 | +#endif |
---|
5320 | 5951 | |
---|
5321 | 5952 | /* Setup dumpHBASlim */ |
---|
5322 | 5953 | if (phba->sli_rev < LPFC_SLI_REV4) { |
---|
.. | .. |
---|
5326 | 5957 | S_IFREG|S_IRUGO|S_IWUSR, |
---|
5327 | 5958 | phba->hba_debugfs_root, |
---|
5328 | 5959 | phba, &lpfc_debugfs_op_dumpHBASlim); |
---|
5329 | | - if (!phba->debug_dumpHBASlim) { |
---|
5330 | | - lpfc_printf_vlog(vport, KERN_ERR, LOG_INIT, |
---|
5331 | | - "0413 Cannot create debugfs " |
---|
5332 | | - "dumpHBASlim\n"); |
---|
5333 | | - goto debug_failed; |
---|
5334 | | - } |
---|
5335 | 5960 | } else |
---|
5336 | 5961 | phba->debug_dumpHBASlim = NULL; |
---|
5337 | 5962 | |
---|
.. | .. |
---|
5343 | 5968 | S_IFREG|S_IRUGO|S_IWUSR, |
---|
5344 | 5969 | phba->hba_debugfs_root, |
---|
5345 | 5970 | phba, &lpfc_debugfs_op_dumpHostSlim); |
---|
5346 | | - if (!phba->debug_dumpHostSlim) { |
---|
5347 | | - lpfc_printf_vlog(vport, KERN_ERR, LOG_INIT, |
---|
5348 | | - "0414 Cannot create debugfs " |
---|
5349 | | - "dumpHostSlim\n"); |
---|
5350 | | - goto debug_failed; |
---|
5351 | | - } |
---|
5352 | 5971 | } else |
---|
5353 | 5972 | phba->debug_dumpHostSlim = NULL; |
---|
5354 | | - |
---|
5355 | | - /* Setup dumpData */ |
---|
5356 | | - snprintf(name, sizeof(name), "dumpData"); |
---|
5357 | | - phba->debug_dumpData = |
---|
5358 | | - debugfs_create_file(name, S_IFREG|S_IRUGO|S_IWUSR, |
---|
5359 | | - phba->hba_debugfs_root, |
---|
5360 | | - phba, &lpfc_debugfs_op_dumpData); |
---|
5361 | | - if (!phba->debug_dumpData) { |
---|
5362 | | - lpfc_printf_vlog(vport, KERN_ERR, LOG_INIT, |
---|
5363 | | - "0800 Cannot create debugfs dumpData\n"); |
---|
5364 | | - goto debug_failed; |
---|
5365 | | - } |
---|
5366 | | - |
---|
5367 | | - /* Setup dumpDif */ |
---|
5368 | | - snprintf(name, sizeof(name), "dumpDif"); |
---|
5369 | | - phba->debug_dumpDif = |
---|
5370 | | - debugfs_create_file(name, S_IFREG|S_IRUGO|S_IWUSR, |
---|
5371 | | - phba->hba_debugfs_root, |
---|
5372 | | - phba, &lpfc_debugfs_op_dumpDif); |
---|
5373 | | - if (!phba->debug_dumpDif) { |
---|
5374 | | - lpfc_printf_vlog(vport, KERN_ERR, LOG_INIT, |
---|
5375 | | - "0801 Cannot create debugfs dumpDif\n"); |
---|
5376 | | - goto debug_failed; |
---|
5377 | | - } |
---|
5378 | 5973 | |
---|
5379 | 5974 | /* Setup DIF Error Injections */ |
---|
5380 | 5975 | snprintf(name, sizeof(name), "InjErrLBA"); |
---|
.. | .. |
---|
5382 | 5977 | debugfs_create_file(name, S_IFREG|S_IRUGO|S_IWUSR, |
---|
5383 | 5978 | phba->hba_debugfs_root, |
---|
5384 | 5979 | phba, &lpfc_debugfs_op_dif_err); |
---|
5385 | | - if (!phba->debug_InjErrLBA) { |
---|
5386 | | - lpfc_printf_vlog(vport, KERN_ERR, LOG_INIT, |
---|
5387 | | - "0807 Cannot create debugfs InjErrLBA\n"); |
---|
5388 | | - goto debug_failed; |
---|
5389 | | - } |
---|
5390 | 5980 | phba->lpfc_injerr_lba = LPFC_INJERR_LBA_OFF; |
---|
5391 | 5981 | |
---|
5392 | 5982 | snprintf(name, sizeof(name), "InjErrNPortID"); |
---|
.. | .. |
---|
5394 | 5984 | debugfs_create_file(name, S_IFREG|S_IRUGO|S_IWUSR, |
---|
5395 | 5985 | phba->hba_debugfs_root, |
---|
5396 | 5986 | phba, &lpfc_debugfs_op_dif_err); |
---|
5397 | | - if (!phba->debug_InjErrNPortID) { |
---|
5398 | | - lpfc_printf_vlog(vport, KERN_ERR, LOG_INIT, |
---|
5399 | | - "0809 Cannot create debugfs InjErrNPortID\n"); |
---|
5400 | | - goto debug_failed; |
---|
5401 | | - } |
---|
5402 | 5987 | |
---|
5403 | 5988 | snprintf(name, sizeof(name), "InjErrWWPN"); |
---|
5404 | 5989 | phba->debug_InjErrWWPN = |
---|
5405 | 5990 | debugfs_create_file(name, S_IFREG|S_IRUGO|S_IWUSR, |
---|
5406 | 5991 | phba->hba_debugfs_root, |
---|
5407 | 5992 | phba, &lpfc_debugfs_op_dif_err); |
---|
5408 | | - if (!phba->debug_InjErrWWPN) { |
---|
5409 | | - lpfc_printf_vlog(vport, KERN_ERR, LOG_INIT, |
---|
5410 | | - "0810 Cannot create debugfs InjErrWWPN\n"); |
---|
5411 | | - goto debug_failed; |
---|
5412 | | - } |
---|
5413 | 5993 | |
---|
5414 | 5994 | snprintf(name, sizeof(name), "writeGuardInjErr"); |
---|
5415 | 5995 | phba->debug_writeGuard = |
---|
5416 | 5996 | debugfs_create_file(name, S_IFREG|S_IRUGO|S_IWUSR, |
---|
5417 | 5997 | phba->hba_debugfs_root, |
---|
5418 | 5998 | phba, &lpfc_debugfs_op_dif_err); |
---|
5419 | | - if (!phba->debug_writeGuard) { |
---|
5420 | | - lpfc_printf_vlog(vport, KERN_ERR, LOG_INIT, |
---|
5421 | | - "0802 Cannot create debugfs writeGuard\n"); |
---|
5422 | | - goto debug_failed; |
---|
5423 | | - } |
---|
5424 | 5999 | |
---|
5425 | 6000 | snprintf(name, sizeof(name), "writeAppInjErr"); |
---|
5426 | 6001 | phba->debug_writeApp = |
---|
5427 | 6002 | debugfs_create_file(name, S_IFREG|S_IRUGO|S_IWUSR, |
---|
5428 | 6003 | phba->hba_debugfs_root, |
---|
5429 | 6004 | phba, &lpfc_debugfs_op_dif_err); |
---|
5430 | | - if (!phba->debug_writeApp) { |
---|
5431 | | - lpfc_printf_vlog(vport, KERN_ERR, LOG_INIT, |
---|
5432 | | - "0803 Cannot create debugfs writeApp\n"); |
---|
5433 | | - goto debug_failed; |
---|
5434 | | - } |
---|
5435 | 6005 | |
---|
5436 | 6006 | snprintf(name, sizeof(name), "writeRefInjErr"); |
---|
5437 | 6007 | phba->debug_writeRef = |
---|
5438 | 6008 | debugfs_create_file(name, S_IFREG|S_IRUGO|S_IWUSR, |
---|
5439 | 6009 | phba->hba_debugfs_root, |
---|
5440 | 6010 | phba, &lpfc_debugfs_op_dif_err); |
---|
5441 | | - if (!phba->debug_writeRef) { |
---|
5442 | | - lpfc_printf_vlog(vport, KERN_ERR, LOG_INIT, |
---|
5443 | | - "0804 Cannot create debugfs writeRef\n"); |
---|
5444 | | - goto debug_failed; |
---|
5445 | | - } |
---|
5446 | 6011 | |
---|
5447 | 6012 | snprintf(name, sizeof(name), "readGuardInjErr"); |
---|
5448 | 6013 | phba->debug_readGuard = |
---|
5449 | 6014 | debugfs_create_file(name, S_IFREG|S_IRUGO|S_IWUSR, |
---|
5450 | 6015 | phba->hba_debugfs_root, |
---|
5451 | 6016 | phba, &lpfc_debugfs_op_dif_err); |
---|
5452 | | - if (!phba->debug_readGuard) { |
---|
5453 | | - lpfc_printf_vlog(vport, KERN_ERR, LOG_INIT, |
---|
5454 | | - "0808 Cannot create debugfs readGuard\n"); |
---|
5455 | | - goto debug_failed; |
---|
5456 | | - } |
---|
5457 | 6017 | |
---|
5458 | 6018 | snprintf(name, sizeof(name), "readAppInjErr"); |
---|
5459 | 6019 | phba->debug_readApp = |
---|
5460 | 6020 | debugfs_create_file(name, S_IFREG|S_IRUGO|S_IWUSR, |
---|
5461 | 6021 | phba->hba_debugfs_root, |
---|
5462 | 6022 | phba, &lpfc_debugfs_op_dif_err); |
---|
5463 | | - if (!phba->debug_readApp) { |
---|
5464 | | - lpfc_printf_vlog(vport, KERN_ERR, LOG_INIT, |
---|
5465 | | - "0805 Cannot create debugfs readApp\n"); |
---|
5466 | | - goto debug_failed; |
---|
5467 | | - } |
---|
5468 | 6023 | |
---|
5469 | 6024 | snprintf(name, sizeof(name), "readRefInjErr"); |
---|
5470 | 6025 | phba->debug_readRef = |
---|
5471 | 6026 | debugfs_create_file(name, S_IFREG|S_IRUGO|S_IWUSR, |
---|
5472 | 6027 | phba->hba_debugfs_root, |
---|
5473 | 6028 | phba, &lpfc_debugfs_op_dif_err); |
---|
5474 | | - if (!phba->debug_readRef) { |
---|
5475 | | - lpfc_printf_vlog(vport, KERN_ERR, LOG_INIT, |
---|
5476 | | - "0806 Cannot create debugfs readApp\n"); |
---|
5477 | | - goto debug_failed; |
---|
5478 | | - } |
---|
5479 | 6029 | |
---|
5480 | 6030 | /* Setup slow ring trace */ |
---|
5481 | 6031 | if (lpfc_debugfs_max_slow_ring_trc) { |
---|
.. | .. |
---|
5499 | 6049 | debugfs_create_file(name, S_IFREG|S_IRUGO|S_IWUSR, |
---|
5500 | 6050 | phba->hba_debugfs_root, |
---|
5501 | 6051 | phba, &lpfc_debugfs_op_slow_ring_trc); |
---|
5502 | | - if (!phba->debug_slow_ring_trc) { |
---|
5503 | | - lpfc_printf_vlog(vport, KERN_ERR, LOG_INIT, |
---|
5504 | | - "0415 Cannot create debugfs " |
---|
5505 | | - "slow_ring_trace\n"); |
---|
5506 | | - goto debug_failed; |
---|
5507 | | - } |
---|
5508 | 6052 | if (!phba->slow_ring_trc) { |
---|
5509 | 6053 | phba->slow_ring_trc = kmalloc( |
---|
5510 | 6054 | (sizeof(struct lpfc_debugfs_trc) * |
---|
.. | .. |
---|
5527 | 6071 | debugfs_create_file(name, 0644, |
---|
5528 | 6072 | phba->hba_debugfs_root, |
---|
5529 | 6073 | phba, &lpfc_debugfs_op_nvmeio_trc); |
---|
5530 | | - if (!phba->debug_nvmeio_trc) { |
---|
5531 | | - lpfc_printf_vlog(vport, KERN_ERR, LOG_INIT, |
---|
5532 | | - "0574 No create debugfs nvmeio_trc\n"); |
---|
5533 | | - goto debug_failed; |
---|
5534 | | - } |
---|
5535 | 6074 | |
---|
5536 | 6075 | atomic_set(&phba->nvmeio_trc_cnt, 0); |
---|
5537 | 6076 | if (lpfc_debugfs_max_nvmeio_trc) { |
---|
.. | .. |
---|
5579 | 6118 | if (!vport->vport_debugfs_root) { |
---|
5580 | 6119 | vport->vport_debugfs_root = |
---|
5581 | 6120 | debugfs_create_dir(name, phba->hba_debugfs_root); |
---|
5582 | | - if (!vport->vport_debugfs_root) { |
---|
5583 | | - lpfc_printf_vlog(vport, KERN_ERR, LOG_INIT, |
---|
5584 | | - "0417 Can't create debugfs\n"); |
---|
5585 | | - goto debug_failed; |
---|
5586 | | - } |
---|
5587 | 6121 | atomic_inc(&phba->debugfs_vport_count); |
---|
5588 | 6122 | } |
---|
5589 | 6123 | |
---|
.. | .. |
---|
5620 | 6154 | debugfs_create_file(name, S_IFREG|S_IRUGO|S_IWUSR, |
---|
5621 | 6155 | vport->vport_debugfs_root, |
---|
5622 | 6156 | vport, &lpfc_debugfs_op_disc_trc); |
---|
5623 | | - if (!vport->debug_disc_trc) { |
---|
5624 | | - lpfc_printf_vlog(vport, KERN_ERR, LOG_INIT, |
---|
5625 | | - "0419 Cannot create debugfs " |
---|
5626 | | - "discovery_trace\n"); |
---|
5627 | | - goto debug_failed; |
---|
5628 | | - } |
---|
5629 | 6157 | snprintf(name, sizeof(name), "nodelist"); |
---|
5630 | 6158 | vport->debug_nodelist = |
---|
5631 | 6159 | debugfs_create_file(name, S_IFREG|S_IRUGO|S_IWUSR, |
---|
5632 | 6160 | vport->vport_debugfs_root, |
---|
5633 | 6161 | vport, &lpfc_debugfs_op_nodelist); |
---|
5634 | | - if (!vport->debug_nodelist) { |
---|
5635 | | - lpfc_printf_vlog(vport, KERN_ERR, LOG_INIT, |
---|
5636 | | - "2985 Can't create debugfs nodelist\n"); |
---|
5637 | | - goto debug_failed; |
---|
5638 | | - } |
---|
5639 | 6162 | |
---|
5640 | 6163 | snprintf(name, sizeof(name), "nvmestat"); |
---|
5641 | 6164 | vport->debug_nvmestat = |
---|
5642 | 6165 | debugfs_create_file(name, 0644, |
---|
5643 | 6166 | vport->vport_debugfs_root, |
---|
5644 | 6167 | vport, &lpfc_debugfs_op_nvmestat); |
---|
5645 | | - if (!vport->debug_nvmestat) { |
---|
| 6168 | + |
---|
| 6169 | + snprintf(name, sizeof(name), "scsistat"); |
---|
| 6170 | + vport->debug_scsistat = |
---|
| 6171 | + debugfs_create_file(name, 0644, |
---|
| 6172 | + vport->vport_debugfs_root, |
---|
| 6173 | + vport, &lpfc_debugfs_op_scsistat); |
---|
| 6174 | + if (IS_ERR(vport->debug_scsistat)) { |
---|
5646 | 6175 | lpfc_printf_vlog(vport, KERN_ERR, LOG_INIT, |
---|
5647 | | - "0811 Cannot create debugfs nvmestat\n"); |
---|
| 6176 | + "4611 Cannot create debugfs scsistat\n"); |
---|
5648 | 6177 | goto debug_failed; |
---|
5649 | 6178 | } |
---|
5650 | 6179 | |
---|
5651 | | - snprintf(name, sizeof(name), "nvmektime"); |
---|
5652 | | - vport->debug_nvmektime = |
---|
| 6180 | + snprintf(name, sizeof(name), "ioktime"); |
---|
| 6181 | + vport->debug_ioktime = |
---|
5653 | 6182 | debugfs_create_file(name, 0644, |
---|
5654 | 6183 | vport->vport_debugfs_root, |
---|
5655 | | - vport, &lpfc_debugfs_op_nvmektime); |
---|
5656 | | - if (!vport->debug_nvmektime) { |
---|
| 6184 | + vport, &lpfc_debugfs_op_ioktime); |
---|
| 6185 | + if (IS_ERR(vport->debug_ioktime)) { |
---|
5657 | 6186 | lpfc_printf_vlog(vport, KERN_ERR, LOG_INIT, |
---|
5658 | | - "0815 Cannot create debugfs nvmektime\n"); |
---|
| 6187 | + "0815 Cannot create debugfs ioktime\n"); |
---|
5659 | 6188 | goto debug_failed; |
---|
5660 | 6189 | } |
---|
5661 | 6190 | |
---|
5662 | | - snprintf(name, sizeof(name), "cpucheck"); |
---|
5663 | | - vport->debug_cpucheck = |
---|
| 6191 | + snprintf(name, sizeof(name), "hdwqstat"); |
---|
| 6192 | + vport->debug_hdwqstat = |
---|
5664 | 6193 | debugfs_create_file(name, 0644, |
---|
5665 | 6194 | vport->vport_debugfs_root, |
---|
5666 | | - vport, &lpfc_debugfs_op_cpucheck); |
---|
5667 | | - if (!vport->debug_cpucheck) { |
---|
5668 | | - lpfc_printf_vlog(vport, KERN_ERR, LOG_INIT, |
---|
5669 | | - "0819 Cannot create debugfs cpucheck\n"); |
---|
5670 | | - goto debug_failed; |
---|
5671 | | - } |
---|
| 6195 | + vport, &lpfc_debugfs_op_hdwqstat); |
---|
5672 | 6196 | |
---|
5673 | 6197 | /* |
---|
5674 | 6198 | * The following section is for additional directories/files for the |
---|
.. | .. |
---|
5688 | 6212 | if (!phba->idiag_root) { |
---|
5689 | 6213 | phba->idiag_root = |
---|
5690 | 6214 | debugfs_create_dir(name, phba->hba_debugfs_root); |
---|
5691 | | - if (!phba->idiag_root) { |
---|
5692 | | - lpfc_printf_vlog(vport, KERN_ERR, LOG_INIT, |
---|
5693 | | - "2922 Can't create idiag debugfs\n"); |
---|
5694 | | - goto debug_failed; |
---|
5695 | | - } |
---|
5696 | 6215 | /* Initialize iDiag data structure */ |
---|
5697 | 6216 | memset(&idiag, 0, sizeof(idiag)); |
---|
5698 | 6217 | } |
---|
.. | .. |
---|
5703 | 6222 | phba->idiag_pci_cfg = |
---|
5704 | 6223 | debugfs_create_file(name, S_IFREG|S_IRUGO|S_IWUSR, |
---|
5705 | 6224 | phba->idiag_root, phba, &lpfc_idiag_op_pciCfg); |
---|
5706 | | - if (!phba->idiag_pci_cfg) { |
---|
5707 | | - lpfc_printf_vlog(vport, KERN_ERR, LOG_INIT, |
---|
5708 | | - "2923 Can't create idiag debugfs\n"); |
---|
5709 | | - goto debug_failed; |
---|
5710 | | - } |
---|
5711 | 6225 | idiag.offset.last_rd = 0; |
---|
5712 | 6226 | } |
---|
5713 | 6227 | |
---|
.. | .. |
---|
5717 | 6231 | phba->idiag_bar_acc = |
---|
5718 | 6232 | debugfs_create_file(name, S_IFREG|S_IRUGO|S_IWUSR, |
---|
5719 | 6233 | phba->idiag_root, phba, &lpfc_idiag_op_barAcc); |
---|
5720 | | - if (!phba->idiag_bar_acc) { |
---|
5721 | | - lpfc_printf_vlog(vport, KERN_ERR, LOG_INIT, |
---|
5722 | | - "3056 Can't create idiag debugfs\n"); |
---|
5723 | | - goto debug_failed; |
---|
5724 | | - } |
---|
5725 | 6234 | idiag.offset.last_rd = 0; |
---|
5726 | 6235 | } |
---|
5727 | 6236 | |
---|
.. | .. |
---|
5731 | 6240 | phba->idiag_que_info = |
---|
5732 | 6241 | debugfs_create_file(name, S_IFREG|S_IRUGO, |
---|
5733 | 6242 | phba->idiag_root, phba, &lpfc_idiag_op_queInfo); |
---|
5734 | | - if (!phba->idiag_que_info) { |
---|
5735 | | - lpfc_printf_vlog(vport, KERN_ERR, LOG_INIT, |
---|
5736 | | - "2924 Can't create idiag debugfs\n"); |
---|
5737 | | - goto debug_failed; |
---|
5738 | | - } |
---|
5739 | 6243 | } |
---|
5740 | 6244 | |
---|
5741 | 6245 | /* iDiag access PCI function queue */ |
---|
.. | .. |
---|
5744 | 6248 | phba->idiag_que_acc = |
---|
5745 | 6249 | debugfs_create_file(name, S_IFREG|S_IRUGO|S_IWUSR, |
---|
5746 | 6250 | phba->idiag_root, phba, &lpfc_idiag_op_queAcc); |
---|
5747 | | - if (!phba->idiag_que_acc) { |
---|
5748 | | - lpfc_printf_vlog(vport, KERN_ERR, LOG_INIT, |
---|
5749 | | - "2926 Can't create idiag debugfs\n"); |
---|
5750 | | - goto debug_failed; |
---|
5751 | | - } |
---|
5752 | 6251 | } |
---|
5753 | 6252 | |
---|
5754 | 6253 | /* iDiag access PCI function doorbell registers */ |
---|
.. | .. |
---|
5757 | 6256 | phba->idiag_drb_acc = |
---|
5758 | 6257 | debugfs_create_file(name, S_IFREG|S_IRUGO|S_IWUSR, |
---|
5759 | 6258 | phba->idiag_root, phba, &lpfc_idiag_op_drbAcc); |
---|
5760 | | - if (!phba->idiag_drb_acc) { |
---|
5761 | | - lpfc_printf_vlog(vport, KERN_ERR, LOG_INIT, |
---|
5762 | | - "2927 Can't create idiag debugfs\n"); |
---|
5763 | | - goto debug_failed; |
---|
5764 | | - } |
---|
5765 | 6259 | } |
---|
5766 | 6260 | |
---|
5767 | 6261 | /* iDiag access PCI function control registers */ |
---|
.. | .. |
---|
5770 | 6264 | phba->idiag_ctl_acc = |
---|
5771 | 6265 | debugfs_create_file(name, S_IFREG|S_IRUGO|S_IWUSR, |
---|
5772 | 6266 | phba->idiag_root, phba, &lpfc_idiag_op_ctlAcc); |
---|
5773 | | - if (!phba->idiag_ctl_acc) { |
---|
5774 | | - lpfc_printf_vlog(vport, KERN_ERR, LOG_INIT, |
---|
5775 | | - "2981 Can't create idiag debugfs\n"); |
---|
5776 | | - goto debug_failed; |
---|
5777 | | - } |
---|
5778 | 6267 | } |
---|
5779 | 6268 | |
---|
5780 | 6269 | /* iDiag access mbox commands */ |
---|
.. | .. |
---|
5783 | 6272 | phba->idiag_mbx_acc = |
---|
5784 | 6273 | debugfs_create_file(name, S_IFREG|S_IRUGO|S_IWUSR, |
---|
5785 | 6274 | phba->idiag_root, phba, &lpfc_idiag_op_mbxAcc); |
---|
5786 | | - if (!phba->idiag_mbx_acc) { |
---|
5787 | | - lpfc_printf_vlog(vport, KERN_ERR, LOG_INIT, |
---|
5788 | | - "2980 Can't create idiag debugfs\n"); |
---|
5789 | | - goto debug_failed; |
---|
5790 | | - } |
---|
5791 | 6275 | } |
---|
5792 | 6276 | |
---|
5793 | 6277 | /* iDiag extents access commands */ |
---|
.. | .. |
---|
5799 | 6283 | S_IFREG|S_IRUGO|S_IWUSR, |
---|
5800 | 6284 | phba->idiag_root, phba, |
---|
5801 | 6285 | &lpfc_idiag_op_extAcc); |
---|
5802 | | - if (!phba->idiag_ext_acc) { |
---|
5803 | | - lpfc_printf_vlog(vport, KERN_ERR, LOG_INIT, |
---|
5804 | | - "2986 Cant create " |
---|
5805 | | - "idiag debugfs\n"); |
---|
5806 | | - goto debug_failed; |
---|
5807 | | - } |
---|
5808 | 6286 | } |
---|
5809 | 6287 | } |
---|
5810 | 6288 | |
---|
.. | .. |
---|
5842 | 6320 | debugfs_remove(vport->debug_nvmestat); /* nvmestat */ |
---|
5843 | 6321 | vport->debug_nvmestat = NULL; |
---|
5844 | 6322 | |
---|
5845 | | - debugfs_remove(vport->debug_nvmektime); /* nvmektime */ |
---|
5846 | | - vport->debug_nvmektime = NULL; |
---|
| 6323 | + debugfs_remove(vport->debug_scsistat); /* scsistat */ |
---|
| 6324 | + vport->debug_scsistat = NULL; |
---|
5847 | 6325 | |
---|
5848 | | - debugfs_remove(vport->debug_cpucheck); /* cpucheck */ |
---|
5849 | | - vport->debug_cpucheck = NULL; |
---|
| 6326 | + debugfs_remove(vport->debug_ioktime); /* ioktime */ |
---|
| 6327 | + vport->debug_ioktime = NULL; |
---|
| 6328 | + |
---|
| 6329 | + debugfs_remove(vport->debug_hdwqstat); /* hdwqstat */ |
---|
| 6330 | + vport->debug_hdwqstat = NULL; |
---|
5850 | 6331 | |
---|
5851 | 6332 | if (vport->vport_debugfs_root) { |
---|
5852 | 6333 | debugfs_remove(vport->vport_debugfs_root); /* vportX */ |
---|
.. | .. |
---|
5856 | 6337 | |
---|
5857 | 6338 | if (atomic_read(&phba->debugfs_vport_count) == 0) { |
---|
5858 | 6339 | |
---|
| 6340 | + debugfs_remove(phba->debug_multixri_pools); /* multixripools*/ |
---|
| 6341 | + phba->debug_multixri_pools = NULL; |
---|
| 6342 | + |
---|
5859 | 6343 | debugfs_remove(phba->debug_hbqinfo); /* hbqinfo */ |
---|
5860 | 6344 | phba->debug_hbqinfo = NULL; |
---|
5861 | 6345 | |
---|
| 6346 | + debugfs_remove(phba->debug_ras_log); |
---|
| 6347 | + phba->debug_ras_log = NULL; |
---|
| 6348 | + |
---|
| 6349 | +#ifdef LPFC_HDWQ_LOCK_STAT |
---|
| 6350 | + debugfs_remove(phba->debug_lockstat); /* lockstat */ |
---|
| 6351 | + phba->debug_lockstat = NULL; |
---|
| 6352 | +#endif |
---|
5862 | 6353 | debugfs_remove(phba->debug_dumpHBASlim); /* HBASlim */ |
---|
5863 | 6354 | phba->debug_dumpHBASlim = NULL; |
---|
5864 | 6355 | |
---|
5865 | 6356 | debugfs_remove(phba->debug_dumpHostSlim); /* HostSlim */ |
---|
5866 | 6357 | phba->debug_dumpHostSlim = NULL; |
---|
5867 | | - |
---|
5868 | | - debugfs_remove(phba->debug_dumpData); /* dumpData */ |
---|
5869 | | - phba->debug_dumpData = NULL; |
---|
5870 | | - |
---|
5871 | | - debugfs_remove(phba->debug_dumpDif); /* dumpDif */ |
---|
5872 | | - phba->debug_dumpDif = NULL; |
---|
5873 | 6358 | |
---|
5874 | 6359 | debugfs_remove(phba->debug_InjErrLBA); /* InjErrLBA */ |
---|
5875 | 6360 | phba->debug_InjErrLBA = NULL; |
---|
.. | .. |
---|
5991 | 6476 | lpfc_debug_dump_wq(phba, DUMP_ELS, 0); |
---|
5992 | 6477 | lpfc_debug_dump_wq(phba, DUMP_NVMELS, 0); |
---|
5993 | 6478 | |
---|
5994 | | - for (idx = 0; idx < phba->cfg_fcp_io_channel; idx++) |
---|
5995 | | - lpfc_debug_dump_wq(phba, DUMP_FCP, idx); |
---|
5996 | | - |
---|
5997 | | - for (idx = 0; idx < phba->cfg_nvme_io_channel; idx++) |
---|
5998 | | - lpfc_debug_dump_wq(phba, DUMP_NVME, idx); |
---|
| 6479 | + for (idx = 0; idx < phba->cfg_hdw_queue; idx++) |
---|
| 6480 | + lpfc_debug_dump_wq(phba, DUMP_IO, idx); |
---|
5999 | 6481 | |
---|
6000 | 6482 | lpfc_debug_dump_hdr_rq(phba); |
---|
6001 | 6483 | lpfc_debug_dump_dat_rq(phba); |
---|
.. | .. |
---|
6006 | 6488 | lpfc_debug_dump_cq(phba, DUMP_ELS, 0); |
---|
6007 | 6489 | lpfc_debug_dump_cq(phba, DUMP_NVMELS, 0); |
---|
6008 | 6490 | |
---|
6009 | | - for (idx = 0; idx < phba->cfg_fcp_io_channel; idx++) |
---|
6010 | | - lpfc_debug_dump_cq(phba, DUMP_FCP, idx); |
---|
6011 | | - |
---|
6012 | | - for (idx = 0; idx < phba->cfg_nvme_io_channel; idx++) |
---|
6013 | | - lpfc_debug_dump_cq(phba, DUMP_NVME, idx); |
---|
| 6491 | + for (idx = 0; idx < phba->cfg_hdw_queue; idx++) |
---|
| 6492 | + lpfc_debug_dump_cq(phba, DUMP_IO, idx); |
---|
6014 | 6493 | |
---|
6015 | 6494 | /* |
---|
6016 | 6495 | * Dump Event Queues (EQs) |
---|
6017 | 6496 | */ |
---|
6018 | | - for (idx = 0; idx < phba->io_channel_irqs; idx++) |
---|
| 6497 | + for (idx = 0; idx < phba->cfg_hdw_queue; idx++) |
---|
6019 | 6498 | lpfc_debug_dump_hba_eq(phba, idx); |
---|
6020 | 6499 | } |
---|