summaryrefslogtreecommitdiff
path: root/net/core
diff options
context:
space:
mode:
authorJie Wang <wangjie125@huawei.com>2022-05-12 14:56:31 +0800
committerDavid S. Miller <davem@davemloft.net>2022-05-13 11:28:55 +0100
commit0f6deac3a07958195173119627502350925dce78 (patch)
tree8e82d1824f8e50521538e5c2846e156e17b62b1f /net/core
parenta19cef450bb6b1365c3bd5c82952f95b76688143 (diff)
downloadlinux-0f6deac3a07958195173119627502350925dce78.tar.gz
net: page_pool: add page allocation stats for two fast page allocate path
Currently If use page pool allocation stats to analysis a RX performance degradation problem. These stats only count for pages allocate from page_pool_alloc_pages. But nic drivers such as hns3 use page_pool_dev_alloc_frag to allocate pages, so page stats in this API should also be counted. Signed-off-by: Jie Wang <wangjie125@huawei.com> Signed-off-by: Guangbin Huang <huangguangbin2@huawei.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/core')
-rw-r--r--net/core/page_pool.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/net/core/page_pool.c b/net/core/page_pool.c
index bdbadfaee867..f18e6e771993 100644
--- a/net/core/page_pool.c
+++ b/net/core/page_pool.c
@@ -704,8 +704,10 @@ struct page *page_pool_alloc_frag(struct page_pool *pool,
if (page && *offset + size > max_size) {
page = page_pool_drain_frag(pool, page);
- if (page)
+ if (page) {
+ alloc_stat_inc(pool, fast);
goto frag_reset;
+ }
}
if (!page) {
@@ -727,6 +729,7 @@ frag_reset:
pool->frag_users++;
pool->frag_offset = *offset + size;
+ alloc_stat_inc(pool, fast);
return page;
}
EXPORT_SYMBOL(page_pool_alloc_frag);