]> git.baikalelectronics.ru Git - kernel.git/commit
net: hns3: fix one incorrect value of page pool info when queried by debugfs
authorHao Chen <chenhao288@hisilicon.com>
Fri, 26 Nov 2021 12:03:17 +0000 (20:03 +0800)
committerJakub Kicinski <kuba@kernel.org>
Fri, 26 Nov 2021 19:36:29 +0000 (11:36 -0800)
commit04532dd1c048acb6f1debd0e25978b25b6128594
treec28a3ddd1d0fd128ca6af47c6e27458ff5f530f2
parent3e2577a526401c380f7b91997086da1df009600e
net: hns3: fix one incorrect value of page pool info when queried by debugfs

Currently, when user queries page pool info by debugfs command
"cat page_pool_info", the cnt of allocated page for page pool may be
incorrect because of memory inconsistency problem caused by compiler
optimization.

So this patch uses READ_ONCE() to read value of pages_state_hold_cnt to
fix this problem.

Fixes: d9b045254de9 ("net: hns3: debugfs add support dumping page pool info")
Signed-off-by: Hao Chen <chenhao288@hisilicon.com>
Signed-off-by: Guangbin Huang <huangguangbin2@huawei.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/hisilicon/hns3/hns3_debugfs.c