]> www.infradead.org Git - users/dwmw2/linux.git/commit
net: hibmcge: fix the share of irq statistics among different network ports issue
authorJijie Shao <shaojijie@huawei.com>
Thu, 10 Apr 2025 02:13:23 +0000 (10:13 +0800)
committerJakub Kicinski <kuba@kernel.org>
Sat, 12 Apr 2025 03:17:36 +0000 (20:17 -0700)
commit4ad3df755a96012f792c7fa2aa62317db3cba82b
treebac8f72109918743f7a638edb42f0e678d574066
parent9afaaa54e3eb9b64fc07c06741897800e98ac253
net: hibmcge: fix the share of irq statistics among different network ports issue

hbg_irqs is a global array which contains irq statistics.
However, the irq statistics of different network ports
point to the same global array. As a result, the statistics are incorrect.

This patch allocates a statistics array for each network port
to prevent the statistics of different network ports
from affecting each other.

irq statistics are removed from hbg_irq_info. Therefore,
all data in hbg_irq_info remains unchanged. Therefore,
the input parameter of some functions is changed to const.

Fixes: 4d089035fa19 ("net: hibmcge: Add interrupt supported in this module")
Signed-off-by: Jijie Shao <shaojijie@huawei.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Link: https://patch.msgid.link/20250410021327.590362-4-shaojijie@huawei.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/hisilicon/hibmcge/hbg_common.h
drivers/net/ethernet/hisilicon/hibmcge/hbg_debugfs.c
drivers/net/ethernet/hisilicon/hibmcge/hbg_diagnose.c
drivers/net/ethernet/hisilicon/hibmcge/hbg_irq.c
drivers/net/ethernet/hisilicon/hibmcge/hbg_main.c