| .. | .. |
|---|
| 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 | + |
|---|
| 2163 | + memset(mybuf, 0, sizeof(mybuf)); |
|---|
| 2164 | + |
|---|
| 2165 | + if (copy_from_user(mybuf, buf, nbytes)) |
|---|
| 2166 | + return -EFAULT; |
|---|
| 2167 | + pbuf = &mybuf[0]; |
|---|
| 2168 | + |
|---|
| 2169 | + if ((strncmp(pbuf, "reset", strlen("reset")) == 0) || |
|---|
| 2170 | + (strncmp(pbuf, "zero", strlen("zero")) == 0)) { |
|---|
| 2171 | + for (i = 0; i < phba->cfg_hdw_queue; i++) { |
|---|
| 2172 | + qp = &phba->sli4_hba.hdwq[i]; |
|---|
| 2173 | + qp->lock_conflict.alloc_xri_get = 0; |
|---|
| 2174 | + qp->lock_conflict.alloc_xri_put = 0; |
|---|
| 2175 | + qp->lock_conflict.free_xri = 0; |
|---|
| 2176 | + qp->lock_conflict.wq_access = 0; |
|---|
| 2177 | + qp->lock_conflict.alloc_pvt_pool = 0; |
|---|
| 2178 | + qp->lock_conflict.mv_from_pvt_pool = 0; |
|---|
| 2179 | + qp->lock_conflict.mv_to_pub_pool = 0; |
|---|
| 2180 | + qp->lock_conflict.mv_to_pvt_pool = 0; |
|---|
| 2181 | + qp->lock_conflict.free_pvt_pool = 0; |
|---|
| 2182 | + qp->lock_conflict.free_pub_pool = 0; |
|---|
| 2183 | + qp->lock_conflict.wq_access = 0; |
|---|
| 2184 | + } |
|---|
| 2185 | + } |
|---|
| 2186 | + return nbytes; |
|---|
| 2187 | +} |
|---|
| 2188 | +#endif |
|---|
| 2189 | + |
|---|
| 2190 | +static int lpfc_debugfs_ras_log_data(struct lpfc_hba *phba, |
|---|
| 2191 | + char *buffer, int size) |
|---|
| 2192 | +{ |
|---|
| 2193 | + int copied = 0; |
|---|
| 2194 | + struct lpfc_dmabuf *dmabuf, *next; |
|---|
| 2195 | + |
|---|
| 2196 | + memset(buffer, 0, size); |
|---|
| 2197 | + |
|---|
| 2198 | + spin_lock_irq(&phba->hbalock); |
|---|
| 2199 | + if (phba->ras_fwlog.state != ACTIVE) { |
|---|
| 2200 | + spin_unlock_irq(&phba->hbalock); |
|---|
| 2201 | + return -EINVAL; |
|---|
| 2202 | + } |
|---|
| 2203 | + spin_unlock_irq(&phba->hbalock); |
|---|
| 2204 | + |
|---|
| 2205 | + list_for_each_entry_safe(dmabuf, next, |
|---|
| 2206 | + &phba->ras_fwlog.fwlog_buff_list, list) { |
|---|
| 2207 | + /* Check if copying will go over size and a '\0' char */ |
|---|
| 2208 | + if ((copied + LPFC_RAS_MAX_ENTRY_SIZE) >= (size - 1)) { |
|---|
| 2209 | + memcpy(buffer + copied, dmabuf->virt, |
|---|
| 2210 | + size - copied - 1); |
|---|
| 2211 | + copied += size - copied - 1; |
|---|
| 2212 | + break; |
|---|
| 2213 | + } |
|---|
| 2214 | + memcpy(buffer + copied, dmabuf->virt, LPFC_RAS_MAX_ENTRY_SIZE); |
|---|
| 2215 | + copied += LPFC_RAS_MAX_ENTRY_SIZE; |
|---|
| 2216 | + } |
|---|
| 2217 | + return copied; |
|---|
| 2218 | +} |
|---|
| 2219 | + |
|---|
| 2220 | +static int |
|---|
| 2221 | +lpfc_debugfs_ras_log_release(struct inode *inode, struct file *file) |
|---|
| 2222 | +{ |
|---|
| 2223 | + struct lpfc_debug *debug = file->private_data; |
|---|
| 2224 | + |
|---|
| 2225 | + vfree(debug->buffer); |
|---|
| 2226 | + kfree(debug); |
|---|
| 2227 | + |
|---|
| 2228 | + return 0; |
|---|
| 2229 | +} |
|---|
| 2230 | + |
|---|
| 2231 | +/** |
|---|
| 2232 | + * lpfc_debugfs_ras_log_open - Open the RAS log debugfs buffer |
|---|
| 2233 | + * @inode: The inode pointer that contains a vport pointer. |
|---|
| 2234 | + * @file: The file pointer to attach the log output. |
|---|
| 2235 | + * |
|---|
| 2236 | + * Description: |
|---|
| 2237 | + * This routine is the entry point for the debugfs open file operation. It gets |
|---|
| 2238 | + * the vport from the i_private field in @inode, allocates the necessary buffer |
|---|
| 2239 | + * for the log, fills the buffer from the in-memory log for this vport, and then |
|---|
| 2240 | + * returns a pointer to that log in the private_data field in @file. |
|---|
| 2241 | + * |
|---|
| 2242 | + * Returns: |
|---|
| 2243 | + * This function returns zero if successful. On error it will return a negative |
|---|
| 2244 | + * error value. |
|---|
| 2245 | + **/ |
|---|
| 2246 | +static int |
|---|
| 2247 | +lpfc_debugfs_ras_log_open(struct inode *inode, struct file *file) |
|---|
| 2248 | +{ |
|---|
| 2249 | + struct lpfc_hba *phba = inode->i_private; |
|---|
| 2250 | + struct lpfc_debug *debug; |
|---|
| 2251 | + int size; |
|---|
| 2252 | + int rc = -ENOMEM; |
|---|
| 2253 | + |
|---|
| 2254 | + spin_lock_irq(&phba->hbalock); |
|---|
| 2255 | + if (phba->ras_fwlog.state != ACTIVE) { |
|---|
| 2256 | + spin_unlock_irq(&phba->hbalock); |
|---|
| 2257 | + rc = -EINVAL; |
|---|
| 2258 | + goto out; |
|---|
| 2259 | + } |
|---|
| 2260 | + spin_unlock_irq(&phba->hbalock); |
|---|
| 2261 | + debug = kmalloc(sizeof(*debug), GFP_KERNEL); |
|---|
| 2262 | + if (!debug) |
|---|
| 2263 | + goto out; |
|---|
| 2264 | + |
|---|
| 2265 | + size = LPFC_RAS_MIN_BUFF_POST_SIZE * phba->cfg_ras_fwlog_buffsize; |
|---|
| 2266 | + debug->buffer = vmalloc(size); |
|---|
| 2267 | + if (!debug->buffer) |
|---|
| 2268 | + goto free_debug; |
|---|
| 2269 | + |
|---|
| 2270 | + debug->len = lpfc_debugfs_ras_log_data(phba, debug->buffer, size); |
|---|
| 2271 | + if (debug->len < 0) { |
|---|
| 2272 | + rc = -EINVAL; |
|---|
| 2273 | + goto free_buffer; |
|---|
| 2274 | + } |
|---|
| 2275 | + file->private_data = debug; |
|---|
| 2276 | + |
|---|
| 2277 | + return 0; |
|---|
| 2278 | + |
|---|
| 2279 | +free_buffer: |
|---|
| 2280 | + vfree(debug->buffer); |
|---|
| 2281 | +free_debug: |
|---|
| 2282 | + kfree(debug); |
|---|
| 1620 | 2283 | out: |
|---|
| 1621 | 2284 | return rc; |
|---|
| 1622 | 2285 | } |
|---|
| .. | .. |
|---|
| 1705 | 2368 | return rc; |
|---|
| 1706 | 2369 | } |
|---|
| 1707 | 2370 | |
|---|
| 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 | 2371 | static ssize_t |
|---|
| 1792 | 2372 | lpfc_debugfs_dif_err_read(struct file *file, char __user *buf, |
|---|
| 1793 | 2373 | size_t nbytes, loff_t *ppos) |
|---|
| .. | .. |
|---|
| 1846 | 2426 | return -EFAULT; |
|---|
| 1847 | 2427 | |
|---|
| 1848 | 2428 | if (dent == phba->debug_InjErrLBA) { |
|---|
| 1849 | | - if ((buf[0] == 'o') && (buf[1] == 'f') && (buf[2] == 'f')) |
|---|
| 2429 | + if ((dstbuf[0] == 'o') && (dstbuf[1] == 'f') && |
|---|
| 2430 | + (dstbuf[2] == 'f')) |
|---|
| 1850 | 2431 | tmp = (uint64_t)(-1); |
|---|
| 1851 | 2432 | } |
|---|
| 1852 | 2433 | |
|---|
| .. | .. |
|---|
| 2000 | 2581 | return 0; |
|---|
| 2001 | 2582 | } |
|---|
| 2002 | 2583 | |
|---|
| 2003 | | -static int |
|---|
| 2004 | | -lpfc_debugfs_dumpDataDif_release(struct inode *inode, struct file *file) |
|---|
| 2584 | +/** |
|---|
| 2585 | + * lpfc_debugfs_multixripools_write - Clear multi-XRI pools statistics |
|---|
| 2586 | + * @file: The file pointer to read from. |
|---|
| 2587 | + * @buf: The buffer to copy the user data from. |
|---|
| 2588 | + * @nbytes: The number of bytes to get. |
|---|
| 2589 | + * @ppos: The position in the file to start reading from. |
|---|
| 2590 | + * |
|---|
| 2591 | + * Description: |
|---|
| 2592 | + * This routine clears multi-XRI pools statistics when buf contains "clear". |
|---|
| 2593 | + * |
|---|
| 2594 | + * Return Value: |
|---|
| 2595 | + * It returns the @nbytges passing in from debugfs user space when successful. |
|---|
| 2596 | + * In case of error conditions, it returns proper error code back to the user |
|---|
| 2597 | + * space. |
|---|
| 2598 | + **/ |
|---|
| 2599 | +static ssize_t |
|---|
| 2600 | +lpfc_debugfs_multixripools_write(struct file *file, const char __user *buf, |
|---|
| 2601 | + size_t nbytes, loff_t *ppos) |
|---|
| 2005 | 2602 | { |
|---|
| 2006 | 2603 | struct lpfc_debug *debug = file->private_data; |
|---|
| 2604 | + struct lpfc_hba *phba = (struct lpfc_hba *)debug->i_private; |
|---|
| 2605 | + char mybuf[64]; |
|---|
| 2606 | + char *pbuf; |
|---|
| 2607 | + u32 i; |
|---|
| 2608 | + u32 hwq_count; |
|---|
| 2609 | + struct lpfc_sli4_hdw_queue *qp; |
|---|
| 2610 | + struct lpfc_multixri_pool *multixri_pool; |
|---|
| 2007 | 2611 | |
|---|
| 2008 | | - debug->buffer = NULL; |
|---|
| 2009 | | - kfree(debug); |
|---|
| 2612 | + if (nbytes > sizeof(mybuf) - 1) |
|---|
| 2613 | + nbytes = sizeof(mybuf) - 1; |
|---|
| 2010 | 2614 | |
|---|
| 2011 | | - return 0; |
|---|
| 2615 | + memset(mybuf, 0, sizeof(mybuf)); |
|---|
| 2616 | + |
|---|
| 2617 | + if (copy_from_user(mybuf, buf, nbytes)) |
|---|
| 2618 | + return -EFAULT; |
|---|
| 2619 | + pbuf = &mybuf[0]; |
|---|
| 2620 | + |
|---|
| 2621 | + if ((strncmp(pbuf, "clear", strlen("clear"))) == 0) { |
|---|
| 2622 | + hwq_count = phba->cfg_hdw_queue; |
|---|
| 2623 | + for (i = 0; i < hwq_count; i++) { |
|---|
| 2624 | + qp = &phba->sli4_hba.hdwq[i]; |
|---|
| 2625 | + multixri_pool = qp->p_multixri_pool; |
|---|
| 2626 | + if (!multixri_pool) |
|---|
| 2627 | + continue; |
|---|
| 2628 | + |
|---|
| 2629 | + qp->empty_io_bufs = 0; |
|---|
| 2630 | + multixri_pool->pbl_empty_count = 0; |
|---|
| 2631 | +#ifdef LPFC_MXP_STAT |
|---|
| 2632 | + multixri_pool->above_limit_count = 0; |
|---|
| 2633 | + multixri_pool->below_limit_count = 0; |
|---|
| 2634 | + multixri_pool->stat_max_hwm = 0; |
|---|
| 2635 | + multixri_pool->local_pbl_hit_count = 0; |
|---|
| 2636 | + multixri_pool->other_pbl_hit_count = 0; |
|---|
| 2637 | + |
|---|
| 2638 | + multixri_pool->stat_pbl_count = 0; |
|---|
| 2639 | + multixri_pool->stat_pvt_count = 0; |
|---|
| 2640 | + multixri_pool->stat_busy_count = 0; |
|---|
| 2641 | + multixri_pool->stat_snapshot_taken = 0; |
|---|
| 2642 | +#endif |
|---|
| 2643 | + } |
|---|
| 2644 | + return strlen(pbuf); |
|---|
| 2645 | + } |
|---|
| 2646 | + |
|---|
| 2647 | + return -EINVAL; |
|---|
| 2012 | 2648 | } |
|---|
| 2013 | | - |
|---|
| 2014 | 2649 | |
|---|
| 2015 | 2650 | static int |
|---|
| 2016 | 2651 | lpfc_debugfs_nvmestat_open(struct inode *inode, struct file *file) |
|---|
| .. | .. |
|---|
| 2055 | 2690 | if (!phba->targetport) |
|---|
| 2056 | 2691 | return -ENXIO; |
|---|
| 2057 | 2692 | |
|---|
| 2058 | | - if (nbytes > 64) |
|---|
| 2059 | | - nbytes = 64; |
|---|
| 2693 | + if (nbytes > sizeof(mybuf) - 1) |
|---|
| 2694 | + nbytes = sizeof(mybuf) - 1; |
|---|
| 2060 | 2695 | |
|---|
| 2061 | 2696 | memset(mybuf, 0, sizeof(mybuf)); |
|---|
| 2062 | 2697 | |
|---|
| .. | .. |
|---|
| 2101 | 2736 | } |
|---|
| 2102 | 2737 | |
|---|
| 2103 | 2738 | static int |
|---|
| 2104 | | -lpfc_debugfs_nvmektime_open(struct inode *inode, struct file *file) |
|---|
| 2739 | +lpfc_debugfs_scsistat_open(struct inode *inode, struct file *file) |
|---|
| 2105 | 2740 | { |
|---|
| 2106 | 2741 | struct lpfc_vport *vport = inode->i_private; |
|---|
| 2107 | 2742 | struct lpfc_debug *debug; |
|---|
| .. | .. |
|---|
| 2112 | 2747 | goto out; |
|---|
| 2113 | 2748 | |
|---|
| 2114 | 2749 | /* Round to page boundary */ |
|---|
| 2115 | | - debug->buffer = kmalloc(LPFC_NVMEKTIME_SIZE, GFP_KERNEL); |
|---|
| 2750 | + debug->buffer = kzalloc(LPFC_SCSISTAT_SIZE, GFP_KERNEL); |
|---|
| 2116 | 2751 | if (!debug->buffer) { |
|---|
| 2117 | 2752 | kfree(debug); |
|---|
| 2118 | 2753 | goto out; |
|---|
| 2119 | 2754 | } |
|---|
| 2120 | 2755 | |
|---|
| 2121 | | - debug->len = lpfc_debugfs_nvmektime_data(vport, debug->buffer, |
|---|
| 2122 | | - LPFC_NVMEKTIME_SIZE); |
|---|
| 2756 | + debug->len = lpfc_debugfs_scsistat_data(vport, debug->buffer, |
|---|
| 2757 | + LPFC_SCSISTAT_SIZE); |
|---|
| 2123 | 2758 | |
|---|
| 2124 | 2759 | debug->i_private = inode->i_private; |
|---|
| 2125 | 2760 | file->private_data = debug; |
|---|
| .. | .. |
|---|
| 2130 | 2765 | } |
|---|
| 2131 | 2766 | |
|---|
| 2132 | 2767 | static ssize_t |
|---|
| 2133 | | -lpfc_debugfs_nvmektime_write(struct file *file, const char __user *buf, |
|---|
| 2134 | | - size_t nbytes, loff_t *ppos) |
|---|
| 2768 | +lpfc_debugfs_scsistat_write(struct file *file, const char __user *buf, |
|---|
| 2769 | + size_t nbytes, loff_t *ppos) |
|---|
| 2770 | +{ |
|---|
| 2771 | + struct lpfc_debug *debug = file->private_data; |
|---|
| 2772 | + struct lpfc_vport *vport = (struct lpfc_vport *)debug->i_private; |
|---|
| 2773 | + struct lpfc_hba *phba = vport->phba; |
|---|
| 2774 | + char mybuf[6] = {0}; |
|---|
| 2775 | + int i; |
|---|
| 2776 | + |
|---|
| 2777 | + if (copy_from_user(mybuf, buf, (nbytes >= sizeof(mybuf)) ? |
|---|
| 2778 | + (sizeof(mybuf) - 1) : nbytes)) |
|---|
| 2779 | + return -EFAULT; |
|---|
| 2780 | + |
|---|
| 2781 | + if ((strncmp(&mybuf[0], "reset", strlen("reset")) == 0) || |
|---|
| 2782 | + (strncmp(&mybuf[0], "zero", strlen("zero")) == 0)) { |
|---|
| 2783 | + for (i = 0; i < phba->cfg_hdw_queue; i++) { |
|---|
| 2784 | + memset(&phba->sli4_hba.hdwq[i].scsi_cstat, 0, |
|---|
| 2785 | + sizeof(phba->sli4_hba.hdwq[i].scsi_cstat)); |
|---|
| 2786 | + } |
|---|
| 2787 | + } |
|---|
| 2788 | + |
|---|
| 2789 | + return nbytes; |
|---|
| 2790 | +} |
|---|
| 2791 | + |
|---|
| 2792 | +static int |
|---|
| 2793 | +lpfc_debugfs_ioktime_open(struct inode *inode, struct file *file) |
|---|
| 2794 | +{ |
|---|
| 2795 | + struct lpfc_vport *vport = inode->i_private; |
|---|
| 2796 | + struct lpfc_debug *debug; |
|---|
| 2797 | + int rc = -ENOMEM; |
|---|
| 2798 | + |
|---|
| 2799 | + debug = kmalloc(sizeof(*debug), GFP_KERNEL); |
|---|
| 2800 | + if (!debug) |
|---|
| 2801 | + goto out; |
|---|
| 2802 | + |
|---|
| 2803 | + /* Round to page boundary */ |
|---|
| 2804 | + debug->buffer = kmalloc(LPFC_IOKTIME_SIZE, GFP_KERNEL); |
|---|
| 2805 | + if (!debug->buffer) { |
|---|
| 2806 | + kfree(debug); |
|---|
| 2807 | + goto out; |
|---|
| 2808 | + } |
|---|
| 2809 | + |
|---|
| 2810 | + debug->len = lpfc_debugfs_ioktime_data(vport, debug->buffer, |
|---|
| 2811 | + LPFC_IOKTIME_SIZE); |
|---|
| 2812 | + |
|---|
| 2813 | + debug->i_private = inode->i_private; |
|---|
| 2814 | + file->private_data = debug; |
|---|
| 2815 | + |
|---|
| 2816 | + rc = 0; |
|---|
| 2817 | +out: |
|---|
| 2818 | + return rc; |
|---|
| 2819 | +} |
|---|
| 2820 | + |
|---|
| 2821 | +static ssize_t |
|---|
| 2822 | +lpfc_debugfs_ioktime_write(struct file *file, const char __user *buf, |
|---|
| 2823 | + size_t nbytes, loff_t *ppos) |
|---|
| 2135 | 2824 | { |
|---|
| 2136 | 2825 | struct lpfc_debug *debug = file->private_data; |
|---|
| 2137 | 2826 | struct lpfc_vport *vport = (struct lpfc_vport *)debug->i_private; |
|---|
| .. | .. |
|---|
| 2139 | 2828 | char mybuf[64]; |
|---|
| 2140 | 2829 | char *pbuf; |
|---|
| 2141 | 2830 | |
|---|
| 2142 | | - if (nbytes > 64) |
|---|
| 2143 | | - nbytes = 64; |
|---|
| 2831 | + if (nbytes > sizeof(mybuf) - 1) |
|---|
| 2832 | + nbytes = sizeof(mybuf) - 1; |
|---|
| 2144 | 2833 | |
|---|
| 2145 | 2834 | memset(mybuf, 0, sizeof(mybuf)); |
|---|
| 2146 | 2835 | |
|---|
| .. | .. |
|---|
| 2267 | 2956 | char mybuf[64]; |
|---|
| 2268 | 2957 | char *pbuf; |
|---|
| 2269 | 2958 | |
|---|
| 2270 | | - if (nbytes > 63) |
|---|
| 2271 | | - nbytes = 63; |
|---|
| 2959 | + if (nbytes > sizeof(mybuf) - 1) |
|---|
| 2960 | + nbytes = sizeof(mybuf) - 1; |
|---|
| 2272 | 2961 | |
|---|
| 2273 | 2962 | memset(mybuf, 0, sizeof(mybuf)); |
|---|
| 2274 | 2963 | |
|---|
| .. | .. |
|---|
| 2333 | 3022 | } |
|---|
| 2334 | 3023 | |
|---|
| 2335 | 3024 | static int |
|---|
| 2336 | | -lpfc_debugfs_cpucheck_open(struct inode *inode, struct file *file) |
|---|
| 3025 | +lpfc_debugfs_hdwqstat_open(struct inode *inode, struct file *file) |
|---|
| 2337 | 3026 | { |
|---|
| 2338 | 3027 | struct lpfc_vport *vport = inode->i_private; |
|---|
| 2339 | 3028 | struct lpfc_debug *debug; |
|---|
| .. | .. |
|---|
| 2344 | 3033 | goto out; |
|---|
| 2345 | 3034 | |
|---|
| 2346 | 3035 | /* Round to page boundary */ |
|---|
| 2347 | | - debug->buffer = kmalloc(LPFC_CPUCHECK_SIZE, GFP_KERNEL); |
|---|
| 3036 | + debug->buffer = kcalloc(1, LPFC_SCSISTAT_SIZE, GFP_KERNEL); |
|---|
| 2348 | 3037 | if (!debug->buffer) { |
|---|
| 2349 | 3038 | kfree(debug); |
|---|
| 2350 | 3039 | goto out; |
|---|
| 2351 | 3040 | } |
|---|
| 2352 | 3041 | |
|---|
| 2353 | | - debug->len = lpfc_debugfs_cpucheck_data(vport, debug->buffer, |
|---|
| 2354 | | - LPFC_NVMEKTIME_SIZE); |
|---|
| 3042 | + debug->len = lpfc_debugfs_hdwqstat_data(vport, debug->buffer, |
|---|
| 3043 | + LPFC_SCSISTAT_SIZE); |
|---|
| 2355 | 3044 | |
|---|
| 2356 | 3045 | debug->i_private = inode->i_private; |
|---|
| 2357 | 3046 | file->private_data = debug; |
|---|
| .. | .. |
|---|
| 2362 | 3051 | } |
|---|
| 2363 | 3052 | |
|---|
| 2364 | 3053 | static ssize_t |
|---|
| 2365 | | -lpfc_debugfs_cpucheck_write(struct file *file, const char __user *buf, |
|---|
| 3054 | +lpfc_debugfs_hdwqstat_write(struct file *file, const char __user *buf, |
|---|
| 2366 | 3055 | size_t nbytes, loff_t *ppos) |
|---|
| 2367 | 3056 | { |
|---|
| 2368 | 3057 | struct lpfc_debug *debug = file->private_data; |
|---|
| 2369 | 3058 | struct lpfc_vport *vport = (struct lpfc_vport *)debug->i_private; |
|---|
| 2370 | 3059 | struct lpfc_hba *phba = vport->phba; |
|---|
| 3060 | + struct lpfc_hdwq_stat *c_stat; |
|---|
| 2371 | 3061 | char mybuf[64]; |
|---|
| 2372 | 3062 | char *pbuf; |
|---|
| 2373 | 3063 | int i; |
|---|
| 2374 | 3064 | |
|---|
| 2375 | | - if (nbytes > 64) |
|---|
| 2376 | | - nbytes = 64; |
|---|
| 3065 | + if (nbytes > sizeof(mybuf) - 1) |
|---|
| 3066 | + nbytes = sizeof(mybuf) - 1; |
|---|
| 2377 | 3067 | |
|---|
| 2378 | 3068 | memset(mybuf, 0, sizeof(mybuf)); |
|---|
| 2379 | 3069 | |
|---|
| .. | .. |
|---|
| 2383 | 3073 | |
|---|
| 2384 | 3074 | if ((strncmp(pbuf, "on", sizeof("on") - 1) == 0)) { |
|---|
| 2385 | 3075 | if (phba->nvmet_support) |
|---|
| 2386 | | - phba->cpucheck_on |= LPFC_CHECK_NVMET_IO; |
|---|
| 3076 | + phba->hdwqstat_on |= LPFC_CHECK_NVMET_IO; |
|---|
| 2387 | 3077 | else |
|---|
| 2388 | | - phba->cpucheck_on |= LPFC_CHECK_NVME_IO; |
|---|
| 3078 | + phba->hdwqstat_on |= (LPFC_CHECK_NVME_IO | |
|---|
| 3079 | + LPFC_CHECK_SCSI_IO); |
|---|
| 2389 | 3080 | return strlen(pbuf); |
|---|
| 2390 | | - } else if ((strncmp(pbuf, "rcv", |
|---|
| 2391 | | - sizeof("rcv") - 1) == 0)) { |
|---|
| 3081 | + } else if ((strncmp(pbuf, "nvme_on", sizeof("nvme_on") - 1) == 0)) { |
|---|
| 2392 | 3082 | if (phba->nvmet_support) |
|---|
| 2393 | | - phba->cpucheck_on |= LPFC_CHECK_NVMET_RCV; |
|---|
| 3083 | + phba->hdwqstat_on |= LPFC_CHECK_NVMET_IO; |
|---|
| 2394 | 3084 | else |
|---|
| 2395 | | - return -EINVAL; |
|---|
| 3085 | + phba->hdwqstat_on |= LPFC_CHECK_NVME_IO; |
|---|
| 3086 | + return strlen(pbuf); |
|---|
| 3087 | + } else if ((strncmp(pbuf, "scsi_on", sizeof("scsi_on") - 1) == 0)) { |
|---|
| 3088 | + if (!phba->nvmet_support) |
|---|
| 3089 | + phba->hdwqstat_on |= LPFC_CHECK_SCSI_IO; |
|---|
| 3090 | + return strlen(pbuf); |
|---|
| 3091 | + } else if ((strncmp(pbuf, "nvme_off", sizeof("nvme_off") - 1) == 0)) { |
|---|
| 3092 | + phba->hdwqstat_on &= ~(LPFC_CHECK_NVME_IO | |
|---|
| 3093 | + LPFC_CHECK_NVMET_IO); |
|---|
| 3094 | + return strlen(pbuf); |
|---|
| 3095 | + } else if ((strncmp(pbuf, "scsi_off", sizeof("scsi_off") - 1) == 0)) { |
|---|
| 3096 | + phba->hdwqstat_on &= ~LPFC_CHECK_SCSI_IO; |
|---|
| 2396 | 3097 | return strlen(pbuf); |
|---|
| 2397 | 3098 | } else if ((strncmp(pbuf, "off", |
|---|
| 2398 | 3099 | sizeof("off") - 1) == 0)) { |
|---|
| 2399 | | - phba->cpucheck_on = LPFC_CHECK_OFF; |
|---|
| 3100 | + phba->hdwqstat_on = LPFC_CHECK_OFF; |
|---|
| 2400 | 3101 | return strlen(pbuf); |
|---|
| 2401 | 3102 | } else if ((strncmp(pbuf, "zero", |
|---|
| 2402 | 3103 | 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; |
|---|
| 3104 | + for_each_present_cpu(i) { |
|---|
| 3105 | + c_stat = per_cpu_ptr(phba->sli4_hba.c_stat, i); |
|---|
| 3106 | + c_stat->xmt_io = 0; |
|---|
| 3107 | + c_stat->cmpl_io = 0; |
|---|
| 3108 | + c_stat->rcv_io = 0; |
|---|
| 2410 | 3109 | } |
|---|
| 2411 | 3110 | return strlen(pbuf); |
|---|
| 2412 | 3111 | } |
|---|
| .. | .. |
|---|
| 3169 | 3868 | (unsigned long long)qp->q_cnt_4); |
|---|
| 3170 | 3869 | len += scnprintf(pbuffer + len, LPFC_QUE_INFO_GET_BUF_SIZE - len, |
|---|
| 3171 | 3870 | "\t\tWQID[%02d], QE-CNT[%04d], QE-SZ[%04d], " |
|---|
| 3172 | | - "HST-IDX[%04d], PRT-IDX[%04d], PST[%03d]", |
|---|
| 3871 | + "HST-IDX[%04d], PRT-IDX[%04d], NTFI[%03d]", |
|---|
| 3173 | 3872 | qp->queue_id, qp->entry_count, |
|---|
| 3174 | 3873 | qp->entry_size, qp->host_index, |
|---|
| 3175 | | - qp->hba_index, qp->entry_repost); |
|---|
| 3874 | + qp->hba_index, qp->notify_interval); |
|---|
| 3176 | 3875 | len += scnprintf(pbuffer + len, |
|---|
| 3177 | 3876 | LPFC_QUE_INFO_GET_BUF_SIZE - len, "\n"); |
|---|
| 3178 | 3877 | return len; |
|---|
| .. | .. |
|---|
| 3185 | 3884 | struct lpfc_queue *qp; |
|---|
| 3186 | 3885 | int qidx; |
|---|
| 3187 | 3886 | |
|---|
| 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]; |
|---|
| 3887 | + for (qidx = 0; qidx < phba->cfg_hdw_queue; qidx++) { |
|---|
| 3888 | + qp = phba->sli4_hba.hdwq[qidx].io_wq; |
|---|
| 3198 | 3889 | if (qp->assoc_qid != cq_id) |
|---|
| 3199 | 3890 | continue; |
|---|
| 3200 | 3891 | *len = __lpfc_idiag_print_wq(qp, wqtype, pbuffer, *len); |
|---|
| .. | .. |
|---|
| 3220 | 3911 | qp->q_cnt_3, (unsigned long long)qp->q_cnt_4); |
|---|
| 3221 | 3912 | len += scnprintf(pbuffer + len, LPFC_QUE_INFO_GET_BUF_SIZE - len, |
|---|
| 3222 | 3913 | "\tCQID[%02d], QE-CNT[%04d], QE-SZ[%04d], " |
|---|
| 3223 | | - "HST-IDX[%04d], PRT-IDX[%04d], PST[%03d]", |
|---|
| 3914 | + "HST-IDX[%04d], NTFI[%03d], PLMT[%03d]", |
|---|
| 3224 | 3915 | qp->queue_id, qp->entry_count, |
|---|
| 3225 | 3916 | qp->entry_size, qp->host_index, |
|---|
| 3226 | | - qp->hba_index, qp->entry_repost); |
|---|
| 3917 | + qp->notify_interval, qp->max_proc_limit); |
|---|
| 3227 | 3918 | |
|---|
| 3228 | | - len += scnprintf(pbuffer + len, LPFC_QUE_INFO_GET_BUF_SIZE - len, "\n"); |
|---|
| 3919 | + len += scnprintf(pbuffer + len, LPFC_QUE_INFO_GET_BUF_SIZE - len, |
|---|
| 3920 | + "\n"); |
|---|
| 3229 | 3921 | |
|---|
| 3230 | 3922 | return len; |
|---|
| 3231 | 3923 | } |
|---|
| .. | .. |
|---|
| 3246 | 3938 | qp->q_cnt_3, (unsigned long long)qp->q_cnt_4); |
|---|
| 3247 | 3939 | len += scnprintf(pbuffer + len, LPFC_QUE_INFO_GET_BUF_SIZE - len, |
|---|
| 3248 | 3940 | "\t\tHQID[%02d], QE-CNT[%04d], QE-SZ[%04d], " |
|---|
| 3249 | | - "HST-IDX[%04d], PRT-IDX[%04d], PST[%03d]\n", |
|---|
| 3941 | + "HST-IDX[%04d], PRT-IDX[%04d], NTFI[%03d]\n", |
|---|
| 3250 | 3942 | qp->queue_id, qp->entry_count, qp->entry_size, |
|---|
| 3251 | | - qp->host_index, qp->hba_index, qp->entry_repost); |
|---|
| 3943 | + qp->host_index, qp->hba_index, qp->notify_interval); |
|---|
| 3252 | 3944 | len += scnprintf(pbuffer + len, LPFC_QUE_INFO_GET_BUF_SIZE - len, |
|---|
| 3253 | 3945 | "\t\tDQID[%02d], QE-CNT[%04d], QE-SZ[%04d], " |
|---|
| 3254 | | - "HST-IDX[%04d], PRT-IDX[%04d], PST[%03d]\n", |
|---|
| 3946 | + "HST-IDX[%04d], PRT-IDX[%04d], NTFI[%03d]\n", |
|---|
| 3255 | 3947 | datqp->queue_id, datqp->entry_count, |
|---|
| 3256 | 3948 | datqp->entry_size, datqp->host_index, |
|---|
| 3257 | | - datqp->hba_index, datqp->entry_repost); |
|---|
| 3949 | + datqp->hba_index, datqp->notify_interval); |
|---|
| 3258 | 3950 | return len; |
|---|
| 3259 | 3951 | } |
|---|
| 3260 | 3952 | |
|---|
| .. | .. |
|---|
| 3263 | 3955 | int *len, int max_cnt, int eqidx, int eq_id) |
|---|
| 3264 | 3956 | { |
|---|
| 3265 | 3957 | struct lpfc_queue *qp; |
|---|
| 3266 | | - int qidx, rc; |
|---|
| 3958 | + int rc; |
|---|
| 3267 | 3959 | |
|---|
| 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; |
|---|
| 3960 | + qp = phba->sli4_hba.hdwq[eqidx].io_cq; |
|---|
| 3272 | 3961 | |
|---|
| 3273 | | - *len = __lpfc_idiag_print_cq(qp, "FCP", pbuffer, *len); |
|---|
| 3962 | + *len = __lpfc_idiag_print_cq(qp, "IO", pbuffer, *len); |
|---|
| 3274 | 3963 | |
|---|
| 3275 | | - /* Reset max counter */ |
|---|
| 3276 | | - qp->CQ_max_cqe = 0; |
|---|
| 3964 | + /* Reset max counter */ |
|---|
| 3965 | + qp->CQ_max_cqe = 0; |
|---|
| 3277 | 3966 | |
|---|
| 3278 | | - if (*len >= max_cnt) |
|---|
| 3279 | | - return 1; |
|---|
| 3967 | + if (*len >= max_cnt) |
|---|
| 3968 | + return 1; |
|---|
| 3280 | 3969 | |
|---|
| 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 | | - } |
|---|
| 3970 | + rc = lpfc_idiag_wqs_for_cq(phba, "IO", pbuffer, len, |
|---|
| 3971 | + max_cnt, qp->queue_id); |
|---|
| 3972 | + if (rc) |
|---|
| 3973 | + return 1; |
|---|
| 3305 | 3974 | |
|---|
| 3306 | 3975 | if ((eqidx < phba->cfg_nvmet_mrq) && phba->nvmet_support) { |
|---|
| 3307 | 3976 | /* NVMET CQset */ |
|---|
| .. | .. |
|---|
| 3341 | 4010 | (unsigned long long)qp->q_cnt_4, qp->q_mode); |
|---|
| 3342 | 4011 | len += scnprintf(pbuffer + len, LPFC_QUE_INFO_GET_BUF_SIZE - len, |
|---|
| 3343 | 4012 | "EQID[%02d], QE-CNT[%04d], QE-SZ[%04d], " |
|---|
| 3344 | | - "HST-IDX[%04d], PRT-IDX[%04d], PST[%03d]", |
|---|
| 4013 | + "HST-IDX[%04d], NTFI[%03d], PLMT[%03d], AFFIN[%03d]", |
|---|
| 3345 | 4014 | 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"); |
|---|
| 4015 | + qp->host_index, qp->notify_interval, |
|---|
| 4016 | + qp->max_proc_limit, qp->chann); |
|---|
| 4017 | + len += scnprintf(pbuffer + len, LPFC_QUE_INFO_GET_BUF_SIZE - len, |
|---|
| 4018 | + "\n"); |
|---|
| 3348 | 4019 | |
|---|
| 3349 | 4020 | return len; |
|---|
| 3350 | 4021 | } |
|---|
| .. | .. |
|---|
| 3390 | 4061 | spin_lock_irq(&phba->hbalock); |
|---|
| 3391 | 4062 | |
|---|
| 3392 | 4063 | /* Fast-path event queue */ |
|---|
| 3393 | | - if (phba->sli4_hba.hba_eq && phba->io_channel_irqs) { |
|---|
| 4064 | + if (phba->sli4_hba.hdwq && phba->cfg_hdw_queue) { |
|---|
| 3394 | 4065 | |
|---|
| 3395 | 4066 | 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 | 4067 | 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; |
|---|
| 4068 | + if (phba->lpfc_idiag_last_eq >= phba->cfg_hdw_queue) |
|---|
| 4069 | + phba->lpfc_idiag_last_eq = 0; |
|---|
| 3404 | 4070 | |
|---|
| 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); |
|---|
| 4071 | + len += scnprintf(pbuffer + len, |
|---|
| 4072 | + LPFC_QUE_INFO_GET_BUF_SIZE - len, |
|---|
| 4073 | + "HDWQ %d out of %d HBA HDWQs\n", |
|---|
| 4074 | + x, phba->cfg_hdw_queue); |
|---|
| 3408 | 4075 | |
|---|
| 3409 | 4076 | /* Fast-path EQ */ |
|---|
| 3410 | | - qp = phba->sli4_hba.hba_eq[x]; |
|---|
| 4077 | + qp = phba->sli4_hba.hdwq[x].hba_eq; |
|---|
| 3411 | 4078 | if (!qp) |
|---|
| 3412 | 4079 | goto out; |
|---|
| 3413 | 4080 | |
|---|
| .. | .. |
|---|
| 3482 | 4149 | goto out; |
|---|
| 3483 | 4150 | } |
|---|
| 3484 | 4151 | |
|---|
| 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 | 4152 | spin_unlock_irq(&phba->hbalock); |
|---|
| 3515 | 4153 | return simple_read_from_buffer(buf, nbytes, ppos, pbuffer, len); |
|---|
| 3516 | 4154 | |
|---|
| .. | .. |
|---|
| 3575 | 4213 | "QE-INDEX[%04d]:\n", index); |
|---|
| 3576 | 4214 | |
|---|
| 3577 | 4215 | offset = 0; |
|---|
| 3578 | | - pentry = pque->qe[index].address; |
|---|
| 4216 | + pentry = lpfc_sli4_qe(pque, index); |
|---|
| 3579 | 4217 | while (esize > 0) { |
|---|
| 3580 | 4218 | len += scnprintf(pbuffer+len, LPFC_QUE_ACC_BUF_SIZE-len, |
|---|
| 3581 | 4219 | "%08x ", *pentry); |
|---|
| .. | .. |
|---|
| 3728 | 4366 | switch (quetp) { |
|---|
| 3729 | 4367 | case LPFC_IDIAG_EQ: |
|---|
| 3730 | 4368 | /* 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]; |
|---|
| 4369 | + if (phba->sli4_hba.hdwq) { |
|---|
| 4370 | + for (qidx = 0; qidx < phba->cfg_hdw_queue; qidx++) { |
|---|
| 4371 | + qp = phba->sli4_hba.hdwq[qidx].hba_eq; |
|---|
| 3734 | 4372 | if (qp && qp->queue_id == queid) { |
|---|
| 3735 | 4373 | /* Sanity check */ |
|---|
| 3736 | 4374 | rc = lpfc_idiag_que_param_check(qp, |
|---|
| .. | .. |
|---|
| 3779 | 4417 | goto pass_check; |
|---|
| 3780 | 4418 | } |
|---|
| 3781 | 4419 | /* FCP complete queue */ |
|---|
| 3782 | | - if (phba->sli4_hba.fcp_cq) { |
|---|
| 3783 | | - for (qidx = 0; qidx < phba->cfg_fcp_io_channel; |
|---|
| 4420 | + if (phba->sli4_hba.hdwq) { |
|---|
| 4421 | + for (qidx = 0; qidx < phba->cfg_hdw_queue; |
|---|
| 3784 | 4422 | qidx++) { |
|---|
| 3785 | | - qp = phba->sli4_hba.fcp_cq[qidx]; |
|---|
| 4423 | + qp = phba->sli4_hba.hdwq[qidx].io_cq; |
|---|
| 3786 | 4424 | if (qp && qp->queue_id == queid) { |
|---|
| 3787 | 4425 | /* Sanity check */ |
|---|
| 3788 | 4426 | rc = lpfc_idiag_que_param_check( |
|---|
| .. | .. |
|---|
| 3793 | 4431 | goto pass_check; |
|---|
| 3794 | 4432 | } |
|---|
| 3795 | 4433 | } |
|---|
| 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 | 4434 | } |
|---|
| 3816 | 4435 | goto error_out; |
|---|
| 3817 | 4436 | break; |
|---|
| .. | .. |
|---|
| 3852 | 4471 | idiag.ptr_private = phba->sli4_hba.nvmels_wq; |
|---|
| 3853 | 4472 | goto pass_check; |
|---|
| 3854 | 4473 | } |
|---|
| 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]; |
|---|
| 4474 | + |
|---|
| 4475 | + if (phba->sli4_hba.hdwq) { |
|---|
| 4476 | + /* FCP/SCSI work queue */ |
|---|
| 4477 | + for (qidx = 0; qidx < phba->cfg_hdw_queue; qidx++) { |
|---|
| 4478 | + qp = phba->sli4_hba.hdwq[qidx].io_wq; |
|---|
| 3876 | 4479 | if (qp && qp->queue_id == queid) { |
|---|
| 3877 | 4480 | /* Sanity check */ |
|---|
| 3878 | 4481 | rc = lpfc_idiag_que_param_check( |
|---|
| .. | .. |
|---|
| 3885 | 4488 | } |
|---|
| 3886 | 4489 | } |
|---|
| 3887 | 4490 | |
|---|
| 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 | 4491 | goto error_out; |
|---|
| 3909 | 4492 | break; |
|---|
| 3910 | 4493 | case LPFC_IDIAG_RQ: |
|---|
| .. | .. |
|---|
| 3951 | 4534 | pque = (struct lpfc_queue *)idiag.ptr_private; |
|---|
| 3952 | 4535 | if (offset > pque->entry_size/sizeof(uint32_t) - 1) |
|---|
| 3953 | 4536 | goto error_out; |
|---|
| 3954 | | - pentry = pque->qe[index].address; |
|---|
| 4537 | + pentry = lpfc_sli4_qe(pque, index); |
|---|
| 3955 | 4538 | pentry += offset; |
|---|
| 3956 | 4539 | if (idiag.cmd.opcode == LPFC_IDIAG_CMD_QUEACC_WR) |
|---|
| 3957 | 4540 | *pentry = value; |
|---|
| .. | .. |
|---|
| 3972 | 4555 | * lpfc_idiag_drbacc_read_reg - idiag debugfs read a doorbell register |
|---|
| 3973 | 4556 | * @phba: The pointer to hba structure. |
|---|
| 3974 | 4557 | * @pbuffer: The pointer to the buffer to copy the data to. |
|---|
| 3975 | | - * @len: The lenght of bytes to copied. |
|---|
| 4558 | + * @len: The length of bytes to copied. |
|---|
| 3976 | 4559 | * @drbregid: The id to doorbell registers. |
|---|
| 3977 | 4560 | * |
|---|
| 3978 | 4561 | * Description: |
|---|
| .. | .. |
|---|
| 4182 | 4765 | * lpfc_idiag_ctlacc_read_reg - idiag debugfs read a control registers |
|---|
| 4183 | 4766 | * @phba: The pointer to hba structure. |
|---|
| 4184 | 4767 | * @pbuffer: The pointer to the buffer to copy the data to. |
|---|
| 4185 | | - * @len: The lenght of bytes to copied. |
|---|
| 4768 | + * @len: The length of bytes to copied. |
|---|
| 4186 | 4769 | * @drbregid: The id to doorbell registers. |
|---|
| 4187 | 4770 | * |
|---|
| 4188 | 4771 | * Description: |
|---|
| .. | .. |
|---|
| 4869 | 5452 | .release = lpfc_debugfs_release, |
|---|
| 4870 | 5453 | }; |
|---|
| 4871 | 5454 | |
|---|
| 5455 | +#undef lpfc_debugfs_op_multixripools |
|---|
| 5456 | +static const struct file_operations lpfc_debugfs_op_multixripools = { |
|---|
| 5457 | + .owner = THIS_MODULE, |
|---|
| 5458 | + .open = lpfc_debugfs_multixripools_open, |
|---|
| 5459 | + .llseek = lpfc_debugfs_lseek, |
|---|
| 5460 | + .read = lpfc_debugfs_read, |
|---|
| 5461 | + .write = lpfc_debugfs_multixripools_write, |
|---|
| 5462 | + .release = lpfc_debugfs_release, |
|---|
| 5463 | +}; |
|---|
| 5464 | + |
|---|
| 4872 | 5465 | #undef lpfc_debugfs_op_hbqinfo |
|---|
| 4873 | 5466 | static const struct file_operations lpfc_debugfs_op_hbqinfo = { |
|---|
| 4874 | 5467 | .owner = THIS_MODULE, |
|---|
| .. | .. |
|---|
| 4876 | 5469 | .llseek = lpfc_debugfs_lseek, |
|---|
| 4877 | 5470 | .read = lpfc_debugfs_read, |
|---|
| 4878 | 5471 | .release = lpfc_debugfs_release, |
|---|
| 5472 | +}; |
|---|
| 5473 | + |
|---|
| 5474 | +#ifdef LPFC_HDWQ_LOCK_STAT |
|---|
| 5475 | +#undef lpfc_debugfs_op_lockstat |
|---|
| 5476 | +static const struct file_operations lpfc_debugfs_op_lockstat = { |
|---|
| 5477 | + .owner = THIS_MODULE, |
|---|
| 5478 | + .open = lpfc_debugfs_lockstat_open, |
|---|
| 5479 | + .llseek = lpfc_debugfs_lseek, |
|---|
| 5480 | + .read = lpfc_debugfs_read, |
|---|
| 5481 | + .write = lpfc_debugfs_lockstat_write, |
|---|
| 5482 | + .release = lpfc_debugfs_release, |
|---|
| 5483 | +}; |
|---|
| 5484 | +#endif |
|---|
| 5485 | + |
|---|
| 5486 | +#undef lpfc_debugfs_ras_log |
|---|
| 5487 | +static const struct file_operations lpfc_debugfs_ras_log = { |
|---|
| 5488 | + .owner = THIS_MODULE, |
|---|
| 5489 | + .open = lpfc_debugfs_ras_log_open, |
|---|
| 5490 | + .llseek = lpfc_debugfs_lseek, |
|---|
| 5491 | + .read = lpfc_debugfs_read, |
|---|
| 5492 | + .release = lpfc_debugfs_ras_log_release, |
|---|
| 4879 | 5493 | }; |
|---|
| 4880 | 5494 | |
|---|
| 4881 | 5495 | #undef lpfc_debugfs_op_dumpHBASlim |
|---|
| .. | .. |
|---|
| 4906 | 5520 | .release = lpfc_debugfs_release, |
|---|
| 4907 | 5521 | }; |
|---|
| 4908 | 5522 | |
|---|
| 4909 | | -#undef lpfc_debugfs_op_nvmektime |
|---|
| 4910 | | -static const struct file_operations lpfc_debugfs_op_nvmektime = { |
|---|
| 5523 | +#undef lpfc_debugfs_op_scsistat |
|---|
| 5524 | +static const struct file_operations lpfc_debugfs_op_scsistat = { |
|---|
| 4911 | 5525 | .owner = THIS_MODULE, |
|---|
| 4912 | | - .open = lpfc_debugfs_nvmektime_open, |
|---|
| 5526 | + .open = lpfc_debugfs_scsistat_open, |
|---|
| 4913 | 5527 | .llseek = lpfc_debugfs_lseek, |
|---|
| 4914 | 5528 | .read = lpfc_debugfs_read, |
|---|
| 4915 | | - .write = lpfc_debugfs_nvmektime_write, |
|---|
| 5529 | + .write = lpfc_debugfs_scsistat_write, |
|---|
| 5530 | + .release = lpfc_debugfs_release, |
|---|
| 5531 | +}; |
|---|
| 5532 | + |
|---|
| 5533 | +#undef lpfc_debugfs_op_ioktime |
|---|
| 5534 | +static const struct file_operations lpfc_debugfs_op_ioktime = { |
|---|
| 5535 | + .owner = THIS_MODULE, |
|---|
| 5536 | + .open = lpfc_debugfs_ioktime_open, |
|---|
| 5537 | + .llseek = lpfc_debugfs_lseek, |
|---|
| 5538 | + .read = lpfc_debugfs_read, |
|---|
| 5539 | + .write = lpfc_debugfs_ioktime_write, |
|---|
| 4916 | 5540 | .release = lpfc_debugfs_release, |
|---|
| 4917 | 5541 | }; |
|---|
| 4918 | 5542 | |
|---|
| .. | .. |
|---|
| 4926 | 5550 | .release = lpfc_debugfs_release, |
|---|
| 4927 | 5551 | }; |
|---|
| 4928 | 5552 | |
|---|
| 4929 | | -#undef lpfc_debugfs_op_cpucheck |
|---|
| 4930 | | -static const struct file_operations lpfc_debugfs_op_cpucheck = { |
|---|
| 5553 | +#undef lpfc_debugfs_op_hdwqstat |
|---|
| 5554 | +static const struct file_operations lpfc_debugfs_op_hdwqstat = { |
|---|
| 4931 | 5555 | .owner = THIS_MODULE, |
|---|
| 4932 | | - .open = lpfc_debugfs_cpucheck_open, |
|---|
| 5556 | + .open = lpfc_debugfs_hdwqstat_open, |
|---|
| 4933 | 5557 | .llseek = lpfc_debugfs_lseek, |
|---|
| 4934 | 5558 | .read = lpfc_debugfs_read, |
|---|
| 4935 | | - .write = lpfc_debugfs_cpucheck_write, |
|---|
| 5559 | + .write = lpfc_debugfs_hdwqstat_write, |
|---|
| 4936 | 5560 | .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 | 5561 | }; |
|---|
| 4958 | 5562 | |
|---|
| 4959 | 5563 | #undef lpfc_debugfs_op_dif_err |
|---|
| .. | .. |
|---|
| 5058 | 5662 | .write = lpfc_idiag_extacc_write, |
|---|
| 5059 | 5663 | .release = lpfc_idiag_cmd_release, |
|---|
| 5060 | 5664 | }; |
|---|
| 5061 | | - |
|---|
| 5062 | 5665 | #endif |
|---|
| 5063 | 5666 | |
|---|
| 5064 | 5667 | /* lpfc_idiag_mbxacc_dump_bsg_mbox - idiag debugfs dump bsg mailbox command |
|---|
| .. | .. |
|---|
| 5283 | 5886 | if (!lpfc_debugfs_root) { |
|---|
| 5284 | 5887 | lpfc_debugfs_root = debugfs_create_dir("lpfc", NULL); |
|---|
| 5285 | 5888 | 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 | 5889 | } |
|---|
| 5292 | 5890 | if (!lpfc_debugfs_start_time) |
|---|
| 5293 | 5891 | lpfc_debugfs_start_time = jiffies; |
|---|
| .. | .. |
|---|
| 5298 | 5896 | pport_setup = true; |
|---|
| 5299 | 5897 | phba->hba_debugfs_root = |
|---|
| 5300 | 5898 | 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 | 5899 | atomic_inc(&lpfc_debugfs_hba_count); |
|---|
| 5307 | 5900 | atomic_set(&phba->debugfs_vport_count, 0); |
|---|
| 5901 | + |
|---|
| 5902 | + /* Multi-XRI pools */ |
|---|
| 5903 | + snprintf(name, sizeof(name), "multixripools"); |
|---|
| 5904 | + phba->debug_multixri_pools = |
|---|
| 5905 | + debugfs_create_file(name, S_IFREG | 0644, |
|---|
| 5906 | + phba->hba_debugfs_root, |
|---|
| 5907 | + phba, |
|---|
| 5908 | + &lpfc_debugfs_op_multixripools); |
|---|
| 5909 | + if (!phba->debug_multixri_pools) { |
|---|
| 5910 | + lpfc_printf_vlog(vport, KERN_ERR, LOG_INIT, |
|---|
| 5911 | + "0527 Cannot create debugfs multixripools\n"); |
|---|
| 5912 | + goto debug_failed; |
|---|
| 5913 | + } |
|---|
| 5914 | + |
|---|
| 5915 | + /* RAS log */ |
|---|
| 5916 | + snprintf(name, sizeof(name), "ras_log"); |
|---|
| 5917 | + phba->debug_ras_log = |
|---|
| 5918 | + debugfs_create_file(name, 0644, |
|---|
| 5919 | + phba->hba_debugfs_root, |
|---|
| 5920 | + phba, &lpfc_debugfs_ras_log); |
|---|
| 5921 | + if (!phba->debug_ras_log) { |
|---|
| 5922 | + lpfc_printf_vlog(vport, KERN_ERR, LOG_INIT, |
|---|
| 5923 | + "6148 Cannot create debugfs" |
|---|
| 5924 | + " ras_log\n"); |
|---|
| 5925 | + goto debug_failed; |
|---|
| 5926 | + } |
|---|
| 5308 | 5927 | |
|---|
| 5309 | 5928 | /* Setup hbqinfo */ |
|---|
| 5310 | 5929 | snprintf(name, sizeof(name), "hbqinfo"); |
|---|
| 5311 | 5930 | 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) { |
|---|
| 5931 | + debugfs_create_file(name, S_IFREG | 0644, |
|---|
| 5932 | + phba->hba_debugfs_root, |
|---|
| 5933 | + phba, &lpfc_debugfs_op_hbqinfo); |
|---|
| 5934 | + |
|---|
| 5935 | +#ifdef LPFC_HDWQ_LOCK_STAT |
|---|
| 5936 | + /* Setup lockstat */ |
|---|
| 5937 | + snprintf(name, sizeof(name), "lockstat"); |
|---|
| 5938 | + phba->debug_lockstat = |
|---|
| 5939 | + debugfs_create_file(name, S_IFREG | 0644, |
|---|
| 5940 | + phba->hba_debugfs_root, |
|---|
| 5941 | + phba, &lpfc_debugfs_op_lockstat); |
|---|
| 5942 | + if (!phba->debug_lockstat) { |
|---|
| 5316 | 5943 | lpfc_printf_vlog(vport, KERN_ERR, LOG_INIT, |
|---|
| 5317 | | - "0411 Cannot create debugfs hbqinfo\n"); |
|---|
| 5944 | + "4610 Can't create debugfs lockstat\n"); |
|---|
| 5318 | 5945 | goto debug_failed; |
|---|
| 5319 | 5946 | } |
|---|
| 5947 | +#endif |
|---|
| 5320 | 5948 | |
|---|
| 5321 | 5949 | /* Setup dumpHBASlim */ |
|---|
| 5322 | 5950 | if (phba->sli_rev < LPFC_SLI_REV4) { |
|---|
| .. | .. |
|---|
| 5326 | 5954 | S_IFREG|S_IRUGO|S_IWUSR, |
|---|
| 5327 | 5955 | phba->hba_debugfs_root, |
|---|
| 5328 | 5956 | 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 | 5957 | } else |
|---|
| 5336 | 5958 | phba->debug_dumpHBASlim = NULL; |
|---|
| 5337 | 5959 | |
|---|
| .. | .. |
|---|
| 5343 | 5965 | S_IFREG|S_IRUGO|S_IWUSR, |
|---|
| 5344 | 5966 | phba->hba_debugfs_root, |
|---|
| 5345 | 5967 | 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 | 5968 | } else |
|---|
| 5353 | 5969 | 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 | 5970 | |
|---|
| 5379 | 5971 | /* Setup DIF Error Injections */ |
|---|
| 5380 | 5972 | snprintf(name, sizeof(name), "InjErrLBA"); |
|---|
| .. | .. |
|---|
| 5382 | 5974 | debugfs_create_file(name, S_IFREG|S_IRUGO|S_IWUSR, |
|---|
| 5383 | 5975 | phba->hba_debugfs_root, |
|---|
| 5384 | 5976 | 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 | 5977 | phba->lpfc_injerr_lba = LPFC_INJERR_LBA_OFF; |
|---|
| 5391 | 5978 | |
|---|
| 5392 | 5979 | snprintf(name, sizeof(name), "InjErrNPortID"); |
|---|
| .. | .. |
|---|
| 5394 | 5981 | debugfs_create_file(name, S_IFREG|S_IRUGO|S_IWUSR, |
|---|
| 5395 | 5982 | phba->hba_debugfs_root, |
|---|
| 5396 | 5983 | 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 | 5984 | |
|---|
| 5403 | 5985 | snprintf(name, sizeof(name), "InjErrWWPN"); |
|---|
| 5404 | 5986 | phba->debug_InjErrWWPN = |
|---|
| 5405 | 5987 | debugfs_create_file(name, S_IFREG|S_IRUGO|S_IWUSR, |
|---|
| 5406 | 5988 | phba->hba_debugfs_root, |
|---|
| 5407 | 5989 | 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 | 5990 | |
|---|
| 5414 | 5991 | snprintf(name, sizeof(name), "writeGuardInjErr"); |
|---|
| 5415 | 5992 | phba->debug_writeGuard = |
|---|
| 5416 | 5993 | debugfs_create_file(name, S_IFREG|S_IRUGO|S_IWUSR, |
|---|
| 5417 | 5994 | phba->hba_debugfs_root, |
|---|
| 5418 | 5995 | 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 | 5996 | |
|---|
| 5425 | 5997 | snprintf(name, sizeof(name), "writeAppInjErr"); |
|---|
| 5426 | 5998 | phba->debug_writeApp = |
|---|
| 5427 | 5999 | debugfs_create_file(name, S_IFREG|S_IRUGO|S_IWUSR, |
|---|
| 5428 | 6000 | phba->hba_debugfs_root, |
|---|
| 5429 | 6001 | 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 | 6002 | |
|---|
| 5436 | 6003 | snprintf(name, sizeof(name), "writeRefInjErr"); |
|---|
| 5437 | 6004 | phba->debug_writeRef = |
|---|
| 5438 | 6005 | debugfs_create_file(name, S_IFREG|S_IRUGO|S_IWUSR, |
|---|
| 5439 | 6006 | phba->hba_debugfs_root, |
|---|
| 5440 | 6007 | 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 | 6008 | |
|---|
| 5447 | 6009 | snprintf(name, sizeof(name), "readGuardInjErr"); |
|---|
| 5448 | 6010 | phba->debug_readGuard = |
|---|
| 5449 | 6011 | debugfs_create_file(name, S_IFREG|S_IRUGO|S_IWUSR, |
|---|
| 5450 | 6012 | phba->hba_debugfs_root, |
|---|
| 5451 | 6013 | 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 | 6014 | |
|---|
| 5458 | 6015 | snprintf(name, sizeof(name), "readAppInjErr"); |
|---|
| 5459 | 6016 | phba->debug_readApp = |
|---|
| 5460 | 6017 | debugfs_create_file(name, S_IFREG|S_IRUGO|S_IWUSR, |
|---|
| 5461 | 6018 | phba->hba_debugfs_root, |
|---|
| 5462 | 6019 | 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 | 6020 | |
|---|
| 5469 | 6021 | snprintf(name, sizeof(name), "readRefInjErr"); |
|---|
| 5470 | 6022 | phba->debug_readRef = |
|---|
| 5471 | 6023 | debugfs_create_file(name, S_IFREG|S_IRUGO|S_IWUSR, |
|---|
| 5472 | 6024 | phba->hba_debugfs_root, |
|---|
| 5473 | 6025 | 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 | 6026 | |
|---|
| 5480 | 6027 | /* Setup slow ring trace */ |
|---|
| 5481 | 6028 | if (lpfc_debugfs_max_slow_ring_trc) { |
|---|
| .. | .. |
|---|
| 5499 | 6046 | debugfs_create_file(name, S_IFREG|S_IRUGO|S_IWUSR, |
|---|
| 5500 | 6047 | phba->hba_debugfs_root, |
|---|
| 5501 | 6048 | 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 | 6049 | if (!phba->slow_ring_trc) { |
|---|
| 5509 | 6050 | phba->slow_ring_trc = kmalloc( |
|---|
| 5510 | 6051 | (sizeof(struct lpfc_debugfs_trc) * |
|---|
| .. | .. |
|---|
| 5527 | 6068 | debugfs_create_file(name, 0644, |
|---|
| 5528 | 6069 | phba->hba_debugfs_root, |
|---|
| 5529 | 6070 | 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 | 6071 | |
|---|
| 5536 | 6072 | atomic_set(&phba->nvmeio_trc_cnt, 0); |
|---|
| 5537 | 6073 | if (lpfc_debugfs_max_nvmeio_trc) { |
|---|
| .. | .. |
|---|
| 5579 | 6115 | if (!vport->vport_debugfs_root) { |
|---|
| 5580 | 6116 | vport->vport_debugfs_root = |
|---|
| 5581 | 6117 | 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 | 6118 | atomic_inc(&phba->debugfs_vport_count); |
|---|
| 5588 | 6119 | } |
|---|
| 5589 | 6120 | |
|---|
| .. | .. |
|---|
| 5620 | 6151 | debugfs_create_file(name, S_IFREG|S_IRUGO|S_IWUSR, |
|---|
| 5621 | 6152 | vport->vport_debugfs_root, |
|---|
| 5622 | 6153 | 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 | 6154 | snprintf(name, sizeof(name), "nodelist"); |
|---|
| 5630 | 6155 | vport->debug_nodelist = |
|---|
| 5631 | 6156 | debugfs_create_file(name, S_IFREG|S_IRUGO|S_IWUSR, |
|---|
| 5632 | 6157 | vport->vport_debugfs_root, |
|---|
| 5633 | 6158 | 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 | 6159 | |
|---|
| 5640 | 6160 | snprintf(name, sizeof(name), "nvmestat"); |
|---|
| 5641 | 6161 | vport->debug_nvmestat = |
|---|
| 5642 | 6162 | debugfs_create_file(name, 0644, |
|---|
| 5643 | 6163 | vport->vport_debugfs_root, |
|---|
| 5644 | 6164 | vport, &lpfc_debugfs_op_nvmestat); |
|---|
| 5645 | | - if (!vport->debug_nvmestat) { |
|---|
| 6165 | + |
|---|
| 6166 | + snprintf(name, sizeof(name), "scsistat"); |
|---|
| 6167 | + vport->debug_scsistat = |
|---|
| 6168 | + debugfs_create_file(name, 0644, |
|---|
| 6169 | + vport->vport_debugfs_root, |
|---|
| 6170 | + vport, &lpfc_debugfs_op_scsistat); |
|---|
| 6171 | + if (!vport->debug_scsistat) { |
|---|
| 5646 | 6172 | lpfc_printf_vlog(vport, KERN_ERR, LOG_INIT, |
|---|
| 5647 | | - "0811 Cannot create debugfs nvmestat\n"); |
|---|
| 6173 | + "4611 Cannot create debugfs scsistat\n"); |
|---|
| 5648 | 6174 | goto debug_failed; |
|---|
| 5649 | 6175 | } |
|---|
| 5650 | 6176 | |
|---|
| 5651 | | - snprintf(name, sizeof(name), "nvmektime"); |
|---|
| 5652 | | - vport->debug_nvmektime = |
|---|
| 6177 | + snprintf(name, sizeof(name), "ioktime"); |
|---|
| 6178 | + vport->debug_ioktime = |
|---|
| 5653 | 6179 | debugfs_create_file(name, 0644, |
|---|
| 5654 | 6180 | vport->vport_debugfs_root, |
|---|
| 5655 | | - vport, &lpfc_debugfs_op_nvmektime); |
|---|
| 5656 | | - if (!vport->debug_nvmektime) { |
|---|
| 6181 | + vport, &lpfc_debugfs_op_ioktime); |
|---|
| 6182 | + if (!vport->debug_ioktime) { |
|---|
| 5657 | 6183 | lpfc_printf_vlog(vport, KERN_ERR, LOG_INIT, |
|---|
| 5658 | | - "0815 Cannot create debugfs nvmektime\n"); |
|---|
| 6184 | + "0815 Cannot create debugfs ioktime\n"); |
|---|
| 5659 | 6185 | goto debug_failed; |
|---|
| 5660 | 6186 | } |
|---|
| 5661 | 6187 | |
|---|
| 5662 | | - snprintf(name, sizeof(name), "cpucheck"); |
|---|
| 5663 | | - vport->debug_cpucheck = |
|---|
| 6188 | + snprintf(name, sizeof(name), "hdwqstat"); |
|---|
| 6189 | + vport->debug_hdwqstat = |
|---|
| 5664 | 6190 | debugfs_create_file(name, 0644, |
|---|
| 5665 | 6191 | 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 | | - } |
|---|
| 6192 | + vport, &lpfc_debugfs_op_hdwqstat); |
|---|
| 5672 | 6193 | |
|---|
| 5673 | 6194 | /* |
|---|
| 5674 | 6195 | * The following section is for additional directories/files for the |
|---|
| .. | .. |
|---|
| 5688 | 6209 | if (!phba->idiag_root) { |
|---|
| 5689 | 6210 | phba->idiag_root = |
|---|
| 5690 | 6211 | 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 | 6212 | /* Initialize iDiag data structure */ |
|---|
| 5697 | 6213 | memset(&idiag, 0, sizeof(idiag)); |
|---|
| 5698 | 6214 | } |
|---|
| .. | .. |
|---|
| 5703 | 6219 | phba->idiag_pci_cfg = |
|---|
| 5704 | 6220 | debugfs_create_file(name, S_IFREG|S_IRUGO|S_IWUSR, |
|---|
| 5705 | 6221 | 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 | 6222 | idiag.offset.last_rd = 0; |
|---|
| 5712 | 6223 | } |
|---|
| 5713 | 6224 | |
|---|
| .. | .. |
|---|
| 5717 | 6228 | phba->idiag_bar_acc = |
|---|
| 5718 | 6229 | debugfs_create_file(name, S_IFREG|S_IRUGO|S_IWUSR, |
|---|
| 5719 | 6230 | 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 | 6231 | idiag.offset.last_rd = 0; |
|---|
| 5726 | 6232 | } |
|---|
| 5727 | 6233 | |
|---|
| .. | .. |
|---|
| 5731 | 6237 | phba->idiag_que_info = |
|---|
| 5732 | 6238 | debugfs_create_file(name, S_IFREG|S_IRUGO, |
|---|
| 5733 | 6239 | 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 | 6240 | } |
|---|
| 5740 | 6241 | |
|---|
| 5741 | 6242 | /* iDiag access PCI function queue */ |
|---|
| .. | .. |
|---|
| 5744 | 6245 | phba->idiag_que_acc = |
|---|
| 5745 | 6246 | debugfs_create_file(name, S_IFREG|S_IRUGO|S_IWUSR, |
|---|
| 5746 | 6247 | 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 | 6248 | } |
|---|
| 5753 | 6249 | |
|---|
| 5754 | 6250 | /* iDiag access PCI function doorbell registers */ |
|---|
| .. | .. |
|---|
| 5757 | 6253 | phba->idiag_drb_acc = |
|---|
| 5758 | 6254 | debugfs_create_file(name, S_IFREG|S_IRUGO|S_IWUSR, |
|---|
| 5759 | 6255 | 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 | 6256 | } |
|---|
| 5766 | 6257 | |
|---|
| 5767 | 6258 | /* iDiag access PCI function control registers */ |
|---|
| .. | .. |
|---|
| 5770 | 6261 | phba->idiag_ctl_acc = |
|---|
| 5771 | 6262 | debugfs_create_file(name, S_IFREG|S_IRUGO|S_IWUSR, |
|---|
| 5772 | 6263 | 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 | 6264 | } |
|---|
| 5779 | 6265 | |
|---|
| 5780 | 6266 | /* iDiag access mbox commands */ |
|---|
| .. | .. |
|---|
| 5783 | 6269 | phba->idiag_mbx_acc = |
|---|
| 5784 | 6270 | debugfs_create_file(name, S_IFREG|S_IRUGO|S_IWUSR, |
|---|
| 5785 | 6271 | 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 | 6272 | } |
|---|
| 5792 | 6273 | |
|---|
| 5793 | 6274 | /* iDiag extents access commands */ |
|---|
| .. | .. |
|---|
| 5799 | 6280 | S_IFREG|S_IRUGO|S_IWUSR, |
|---|
| 5800 | 6281 | phba->idiag_root, phba, |
|---|
| 5801 | 6282 | &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 | 6283 | } |
|---|
| 5809 | 6284 | } |
|---|
| 5810 | 6285 | |
|---|
| .. | .. |
|---|
| 5842 | 6317 | debugfs_remove(vport->debug_nvmestat); /* nvmestat */ |
|---|
| 5843 | 6318 | vport->debug_nvmestat = NULL; |
|---|
| 5844 | 6319 | |
|---|
| 5845 | | - debugfs_remove(vport->debug_nvmektime); /* nvmektime */ |
|---|
| 5846 | | - vport->debug_nvmektime = NULL; |
|---|
| 6320 | + debugfs_remove(vport->debug_scsistat); /* scsistat */ |
|---|
| 6321 | + vport->debug_scsistat = NULL; |
|---|
| 5847 | 6322 | |
|---|
| 5848 | | - debugfs_remove(vport->debug_cpucheck); /* cpucheck */ |
|---|
| 5849 | | - vport->debug_cpucheck = NULL; |
|---|
| 6323 | + debugfs_remove(vport->debug_ioktime); /* ioktime */ |
|---|
| 6324 | + vport->debug_ioktime = NULL; |
|---|
| 6325 | + |
|---|
| 6326 | + debugfs_remove(vport->debug_hdwqstat); /* hdwqstat */ |
|---|
| 6327 | + vport->debug_hdwqstat = NULL; |
|---|
| 5850 | 6328 | |
|---|
| 5851 | 6329 | if (vport->vport_debugfs_root) { |
|---|
| 5852 | 6330 | debugfs_remove(vport->vport_debugfs_root); /* vportX */ |
|---|
| .. | .. |
|---|
| 5856 | 6334 | |
|---|
| 5857 | 6335 | if (atomic_read(&phba->debugfs_vport_count) == 0) { |
|---|
| 5858 | 6336 | |
|---|
| 6337 | + debugfs_remove(phba->debug_multixri_pools); /* multixripools*/ |
|---|
| 6338 | + phba->debug_multixri_pools = NULL; |
|---|
| 6339 | + |
|---|
| 5859 | 6340 | debugfs_remove(phba->debug_hbqinfo); /* hbqinfo */ |
|---|
| 5860 | 6341 | phba->debug_hbqinfo = NULL; |
|---|
| 5861 | 6342 | |
|---|
| 6343 | + debugfs_remove(phba->debug_ras_log); |
|---|
| 6344 | + phba->debug_ras_log = NULL; |
|---|
| 6345 | + |
|---|
| 6346 | +#ifdef LPFC_HDWQ_LOCK_STAT |
|---|
| 6347 | + debugfs_remove(phba->debug_lockstat); /* lockstat */ |
|---|
| 6348 | + phba->debug_lockstat = NULL; |
|---|
| 6349 | +#endif |
|---|
| 5862 | 6350 | debugfs_remove(phba->debug_dumpHBASlim); /* HBASlim */ |
|---|
| 5863 | 6351 | phba->debug_dumpHBASlim = NULL; |
|---|
| 5864 | 6352 | |
|---|
| 5865 | 6353 | debugfs_remove(phba->debug_dumpHostSlim); /* HostSlim */ |
|---|
| 5866 | 6354 | 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 | 6355 | |
|---|
| 5874 | 6356 | debugfs_remove(phba->debug_InjErrLBA); /* InjErrLBA */ |
|---|
| 5875 | 6357 | phba->debug_InjErrLBA = NULL; |
|---|
| .. | .. |
|---|
| 5991 | 6473 | lpfc_debug_dump_wq(phba, DUMP_ELS, 0); |
|---|
| 5992 | 6474 | lpfc_debug_dump_wq(phba, DUMP_NVMELS, 0); |
|---|
| 5993 | 6475 | |
|---|
| 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); |
|---|
| 6476 | + for (idx = 0; idx < phba->cfg_hdw_queue; idx++) |
|---|
| 6477 | + lpfc_debug_dump_wq(phba, DUMP_IO, idx); |
|---|
| 5999 | 6478 | |
|---|
| 6000 | 6479 | lpfc_debug_dump_hdr_rq(phba); |
|---|
| 6001 | 6480 | lpfc_debug_dump_dat_rq(phba); |
|---|
| .. | .. |
|---|
| 6006 | 6485 | lpfc_debug_dump_cq(phba, DUMP_ELS, 0); |
|---|
| 6007 | 6486 | lpfc_debug_dump_cq(phba, DUMP_NVMELS, 0); |
|---|
| 6008 | 6487 | |
|---|
| 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); |
|---|
| 6488 | + for (idx = 0; idx < phba->cfg_hdw_queue; idx++) |
|---|
| 6489 | + lpfc_debug_dump_cq(phba, DUMP_IO, idx); |
|---|
| 6014 | 6490 | |
|---|
| 6015 | 6491 | /* |
|---|
| 6016 | 6492 | * Dump Event Queues (EQs) |
|---|
| 6017 | 6493 | */ |
|---|
| 6018 | | - for (idx = 0; idx < phba->io_channel_irqs; idx++) |
|---|
| 6494 | + for (idx = 0; idx < phba->cfg_hdw_queue; idx++) |
|---|
| 6019 | 6495 | lpfc_debug_dump_hba_eq(phba, idx); |
|---|
| 6020 | 6496 | } |
|---|