summaryrefslogtreecommitdiff
path: root/drivers/iommu
diff options
context:
space:
mode:
authorJoerg Roedel <joerg.roedel@amd.com>2011-12-01 16:53:47 +0100
committerHiroshi DOYU <hdoyu@nvidia.com>2012-01-23 11:11:41 +0200
commitb485e361e1d043a90b1e03704b732e9b0aeec5e4 (patch)
treeb38e4554c290a29967e8c2e54a808cd18da6549d /drivers/iommu
parent85cbac345ddd3d591e1b42ad95381efbf22340d4 (diff)
iommu/amd: Add stat counter for IOMMUv2 events
Add some interesting statistic counters for events when IOMMUv2 is active. Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
Diffstat (limited to 'drivers/iommu')
-rw-r--r--drivers/iommu/amd_iommu.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/drivers/iommu/amd_iommu.c b/drivers/iommu/amd_iommu.c
index 1d18ea889efb..32fc99c701e6 100644
--- a/drivers/iommu/amd_iommu.c
+++ b/drivers/iommu/amd_iommu.c
@@ -377,6 +377,11 @@ DECLARE_STATS_COUNTER(domain_flush_single);
DECLARE_STATS_COUNTER(domain_flush_all);
DECLARE_STATS_COUNTER(alloced_io_mem);
DECLARE_STATS_COUNTER(total_map_requests);
+DECLARE_STATS_COUNTER(complete_ppr);
+DECLARE_STATS_COUNTER(invalidate_iotlb);
+DECLARE_STATS_COUNTER(invalidate_iotlb_all);
+DECLARE_STATS_COUNTER(pri_requests);
+
static struct dentry *stats_dir;
static struct dentry *de_fflush;
@@ -411,6 +416,10 @@ static void amd_iommu_stats_init(void)
amd_iommu_stats_add(&domain_flush_all);
amd_iommu_stats_add(&alloced_io_mem);
amd_iommu_stats_add(&total_map_requests);
+ amd_iommu_stats_add(&complete_ppr);
+ amd_iommu_stats_add(&invalidate_iotlb);
+ amd_iommu_stats_add(&invalidate_iotlb_all);
+ amd_iommu_stats_add(&pri_requests);
}
#endif
@@ -527,6 +536,8 @@ static void iommu_handle_ppr_entry(struct amd_iommu *iommu, u32 head)
volatile u64 *raw;
int i;
+ INC_STATS_COUNTER(pri_requests);
+
raw = (u64 *)(iommu->ppr_log + head);
/*
@@ -3393,6 +3404,8 @@ out:
static int __amd_iommu_flush_page(struct protection_domain *domain, int pasid,
u64 address)
{
+ INC_STATS_COUNTER(invalidate_iotlb);
+
return __flush_pasid(domain, pasid, address, false);
}
@@ -3413,6 +3426,8 @@ EXPORT_SYMBOL(amd_iommu_flush_page);
static int __amd_iommu_flush_tlb(struct protection_domain *domain, int pasid)
{
+ INC_STATS_COUNTER(invalidate_iotlb_all);
+
return __flush_pasid(domain, pasid, CMD_INV_IOMMU_ALL_PAGES_ADDRESS,
true);
}
@@ -3532,6 +3547,8 @@ int amd_iommu_complete_ppr(struct pci_dev *pdev, int pasid,
struct amd_iommu *iommu;
struct iommu_cmd cmd;
+ INC_STATS_COUNTER(complete_ppr);
+
dev_data = get_dev_data(&pdev->dev);
iommu = amd_iommu_rlookup_table[dev_data->devid];