Lines Matching refs:type
18 bool dmar_latency_enabled(struct intel_iommu *iommu, enum latency_type type)
22 return lstat && lstat[type].enabled;
25 int dmar_latency_enable(struct intel_iommu *iommu, enum latency_type type)
31 if (dmar_latency_enabled(iommu, type))
46 if (!lstat[type].enabled) {
47 lstat[type].enabled = true;
48 lstat[type].counter[COUNTS_MIN] = UINT_MAX;
57 void dmar_latency_disable(struct intel_iommu *iommu, enum latency_type type)
62 if (!dmar_latency_enabled(iommu, type))
66 memset(&lstat[type], 0, sizeof(*lstat) * DMAR_LATENCY_NUM);
70 void dmar_latency_update(struct intel_iommu *iommu, enum latency_type type, u64 latency)
76 if (!dmar_latency_enabled(iommu, type))
81 lstat[type].counter[COUNTS_10e2]++;
83 lstat[type].counter[COUNTS_10e3]++;
85 lstat[type].counter[COUNTS_10e4]++;
87 lstat[type].counter[COUNTS_10e5]++;
89 lstat[type].counter[COUNTS_10e6]++;
91 lstat[type].counter[COUNTS_10e7]++;
93 lstat[type].counter[COUNTS_10e8_plus]++;
95 min = lstat[type].counter[COUNTS_MIN];
96 max = lstat[type].counter[COUNTS_MAX];
97 lstat[type].counter[COUNTS_MIN] = min_t(u64, min, latency);
98 lstat[type].counter[COUNTS_MAX] = max_t(u64, max, latency);
99 lstat[type].counter[COUNTS_SUM] += latency;
100 lstat[type].samples++;