Commit 53a983f5 authored by Jian Shen's avatar Jian Shen Committed by Jiantao Xiao
Browse files

net: hns3: fix statistics issue when disable page pool

driver inclusion
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I8ISOD


CVE: NA

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

It shouldn't update the page pool statistics when page pool
is disabled, which may cause statistics overlap.

Fixes: 59de65f6 ("net: hns3: add support for page_pool_get_stats")
Signed-off-by: default avatarJian Shen <shenjian15@huawei.com>
parent 77b19549
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -681,6 +681,9 @@ static u64 *hns3_ethtool_pp_stats(struct hnae3_handle *handle, u64 *data)
	struct page_pool *page_pool;
	int i;

	if (!hns3_is_page_pool_enabled())
		return data;

	for (i = 0; i < ring_num; i++) {
		page_pool = priv->ring[i + ring_num].page_pool;
		if (page_pool)