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

NTB: Add split BAR output for debugfs stats

When split BAR is enabled, the driver needs to dump out the split BAR
registers rather than the original 64bit BAR registers.

Signed-off-by: Dave Jiang <dave.jiang@intel.com>
Signed-off-by: Jon Mason <jdmason@kudzu.us>

authored by

Dave Jiang and committed by
Jon Mason
bf44fe46 fd839bf8

+68 -15
+68 -15
drivers/ntb/hw/intel/ntb_hw_intel.c
··· 632 632 off += scnprintf(buf + off, buf_size - off, 633 633 "XLAT23 -\t\t%#018llx\n", u.v64); 634 634 635 - u.v64 = ioread64(mmio + bar2_off(ndev->xlat_reg->bar2_xlat, 4)); 636 - off += scnprintf(buf + off, buf_size - off, 637 - "XLAT45 -\t\t%#018llx\n", u.v64); 635 + if (ndev->bar4_split) { 636 + u.v32 = ioread32(mmio + bar2_off(ndev->xlat_reg->bar2_xlat, 4)); 637 + off += scnprintf(buf + off, buf_size - off, 638 + "XLAT4 -\t\t\t%#06x\n", u.v32); 639 + 640 + u.v32 = ioread32(mmio + bar2_off(ndev->xlat_reg->bar2_xlat, 5)); 641 + off += scnprintf(buf + off, buf_size - off, 642 + "XLAT5 -\t\t\t%#06x\n", u.v32); 643 + } else { 644 + u.v64 = ioread64(mmio + bar2_off(ndev->xlat_reg->bar2_xlat, 4)); 645 + off += scnprintf(buf + off, buf_size - off, 646 + "XLAT45 -\t\t%#018llx\n", u.v64); 647 + } 638 648 639 649 u.v64 = ioread64(mmio + bar2_off(ndev->xlat_reg->bar2_limit, 2)); 640 650 off += scnprintf(buf + off, buf_size - off, 641 651 "LMT23 -\t\t\t%#018llx\n", u.v64); 642 652 643 - u.v64 = ioread64(mmio + bar2_off(ndev->xlat_reg->bar2_limit, 4)); 644 - off += scnprintf(buf + off, buf_size - off, 645 - "LMT45 -\t\t\t%#018llx\n", u.v64); 653 + if (ndev->bar4_split) { 654 + u.v32 = ioread32(mmio + bar2_off(ndev->xlat_reg->bar2_limit, 4)); 655 + off += scnprintf(buf + off, buf_size - off, 656 + "LMT4 -\t\t\t%#06x\n", u.v32); 657 + u.v32 = ioread32(mmio + bar2_off(ndev->xlat_reg->bar2_limit, 5)); 658 + off += scnprintf(buf + off, buf_size - off, 659 + "LMT5 -\t\t\t%#06x\n", u.v32); 660 + } else { 661 + u.v64 = ioread64(mmio + bar2_off(ndev->xlat_reg->bar2_limit, 4)); 662 + off += scnprintf(buf + off, buf_size - off, 663 + "LMT45 -\t\t\t%#018llx\n", u.v64); 664 + } 646 665 647 666 if (pdev_is_xeon(ndev->ntb.pdev)) { 648 667 if (ntb_topo_is_b2b(ndev->ntb.topo)) { ··· 672 653 off += scnprintf(buf + off, buf_size - off, 673 654 "B2B XLAT23 -\t\t%#018llx\n", u.v64); 674 655 675 - u.v64 = ioread64(mmio + XEON_PBAR45XLAT_OFFSET); 676 - off += scnprintf(buf + off, buf_size - off, 677 - "B2B XLAT45 -\t\t%#018llx\n", u.v64); 656 + if (ndev->bar4_split) { 657 + u.v32 = ioread32(mmio + XEON_PBAR4XLAT_OFFSET); 658 + off += scnprintf(buf + off, buf_size - off, 659 + "B2B XLAT4 -\t\t%#06x\n", 660 + u.v32); 661 + u.v32 = ioread32(mmio + XEON_PBAR5XLAT_OFFSET); 662 + off += scnprintf(buf + off, buf_size - off, 663 + "B2B XLAT5 -\t\t%#06x\n", 664 + u.v32); 665 + } else { 666 + u.v64 = ioread64(mmio + XEON_PBAR45XLAT_OFFSET); 667 + off += scnprintf(buf + off, buf_size - off, 668 + "B2B XLAT45 -\t\t%#018llx\n", 669 + u.v64); 670 + } 678 671 679 672 u.v64 = ioread64(mmio + XEON_PBAR23LMT_OFFSET); 680 673 off += scnprintf(buf + off, buf_size - off, 681 674 "B2B LMT23 -\t\t%#018llx\n", u.v64); 682 675 683 - u.v64 = ioread64(mmio + XEON_PBAR45LMT_OFFSET); 684 - off += scnprintf(buf + off, buf_size - off, 685 - "B2B LMT45 -\t\t%#018llx\n", u.v64); 676 + if (ndev->bar4_split) { 677 + u.v32 = ioread32(mmio + XEON_PBAR4LMT_OFFSET); 678 + off += scnprintf(buf + off, buf_size - off, 679 + "B2B LMT4 -\t\t%#06x\n", 680 + u.v32); 681 + u.v32 = ioread32(mmio + XEON_PBAR5LMT_OFFSET); 682 + off += scnprintf(buf + off, buf_size - off, 683 + "B2B LMT5 -\t\t%#06x\n", 684 + u.v32); 685 + } else { 686 + u.v64 = ioread64(mmio + XEON_PBAR45LMT_OFFSET); 687 + off += scnprintf(buf + off, buf_size - off, 688 + "B2B LMT45 -\t\t%#018llx\n", 689 + u.v64); 690 + } 686 691 687 692 off += scnprintf(buf + off, buf_size - off, 688 693 "\nNTB Secondary BAR:\n"); ··· 719 676 off += scnprintf(buf + off, buf_size - off, 720 677 "SBAR23 -\t\t%#018llx\n", u.v64); 721 678 722 - u.v64 = ioread64(mmio + XEON_SBAR45BASE_OFFSET); 723 - off += scnprintf(buf + off, buf_size - off, 724 - "SBAR45 -\t\t%#018llx\n", u.v64); 679 + if (ndev->bar4_split) { 680 + u.v32 = ioread32(mmio + XEON_SBAR4BASE_OFFSET); 681 + off += scnprintf(buf + off, buf_size - off, 682 + "SBAR4 -\t\t\t%#06x\n", u.v32); 683 + u.v32 = ioread32(mmio + XEON_SBAR5BASE_OFFSET); 684 + off += scnprintf(buf + off, buf_size - off, 685 + "SBAR5 -\t\t\t%#06x\n", u.v32); 686 + } else { 687 + u.v64 = ioread64(mmio + XEON_SBAR45BASE_OFFSET); 688 + off += scnprintf(buf + off, buf_size - off, 689 + "SBAR45 -\t\t%#018llx\n", 690 + u.v64); 691 + } 725 692 } 726 693 727 694 off += scnprintf(buf + off, buf_size - off,