Commit 5766c797 authored by Guangbin Huang's avatar Guangbin Huang Committed by Zheng Zengkai
Browse files

drivers/perf: hisi: add driver for HNS3 PMU

mainline inclusion
from mainline-arm64-upstream
commit 66637ab1
category: feature
bugzilla: https://gitee.com/openeuler/kernel/issues/I5KAX7
CVE: NA

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=66637ab137b4



----------------------------------------------------------------------

HNS3(HiSilicon Network System 3) PMU is RCiEP device in HiSilicon SoC NIC,
supports collection of performance statistics such as bandwidth, latency,
packet rate and interrupt rate.

NIC of each SICL has one PMU device for it. Driver registers each PMU
device to perf, and exports information of supported events, filter mode of
each event, bdf range, hardware clock frequency, identifier and so on via
sysfs.

Each PMU device has its own registers of control, counters and interrupt,
and it supports 8 hardware events, each hardward event has its own
registers for configuration, counters and interrupt.

Filter options contains:
config       - select event
port         - select physical port of nic
tc           - select tc(must be used with port)
func         - select PF/VF
queue        - select queue of PF/VF(must be used with func)
intr         - select interrupt number(must be used with func)
global       - select all functions of IO DIE

Signed-off-by: default avatarGuangbin Huang <huangguangbin2@huawei.com>
Reviewed-by: default avatarJohn Garry <john.garry@huawei.com>
Reviewed-by: default avatarShaokun Zhang <zhangshaokun@hisilicon.com>
Link: https://lore.kernel.org/r/20220628063419.38514-3-huangguangbin2@huawei.com


Signed-off-by: default avatarWill Deacon <will@kernel.org>
Signed-off-by: default avatarJiantao Xiao <xoiaojiantao1@h-partners.com>
Signed-off-by: default avatarJunhao He <hejunhao3@huawei.com>
Signed-off-by: default avatarJiantao Xiao <xiaojiantao1@h-partners.com>
Reviewed-by: default avatarXiongfeng Wang <wangxiongfeng2@huawei.com>
Reviewed-by: default avatarYang Jihong <yangjihong1@huawei.com>
Reviewed-by: default avatarJian Shen <shenjian15@huawei.com>
Signed-off-by: default avatarZheng Zengkai <zhengzengkai@huawei.com>
parent 36b83702
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -8007,6 +8007,12 @@ F: Documentation/ABI/testing/sysfs-devices-hisi_ptt
F:      Documentation/trace/hisi-ptt.rst
F:      drivers/hwtracing/ptt/
HISILICON HNS3 PMU DRIVER
M:	Guangbin Huang <huangguangbin2@huawei.com>
S:	Supported
F:	Documentation/admin-guide/perf/hns3-pmu.rst
F:	drivers/perf/hisilicon/hns3_pmu.c
HISILICON QM AND ZIP Controller DRIVER
M:	Zhou Wang <wangzhou1@hisilicon.com>
L:	linux-crypto@vger.kernel.org
+10 −0
Original line number Diff line number Diff line
@@ -14,3 +14,13 @@ config HISI_PCIE_PMU
	  RCiEP devices.
	  Adds the PCIe PMU into perf events system for monitoring latency,
	  bandwidth etc.

config HNS3_PMU
	tristate "HNS3 PERF PMU"
	depends on ARM64 || COMPILE_TEST
	depends on PCI
	help
	  Provide support for HNS3 performance monitoring unit (PMU) RCiEP
	  devices.
	  Adds the HNS3 PMU into perf events system for monitoring latency,
	  bandwidth etc.
+1 −0
Original line number Diff line number Diff line
@@ -6,3 +6,4 @@ obj-$(CONFIG_HISI_PMU) += hisi_uncore_pmu.o hisi_uncore_l3c_pmu.o \
			  hisi_uncore_lpddrc_pmu.o

obj-$(CONFIG_HISI_PCIE_PMU) += hisi_pcie_pmu.o
obj-$(CONFIG_HNS3_PMU) += hns3_pmu.o
+1672 −0

File added.

Preview size limit exceeded, changes collapsed.