Message ID | 1643499540-8351-4-git-send-email-jdamato@fastly.com (mailing list archive) |
---|---|
State | Superseded |
Delegated to: | Netdev Maintainers |
Headers | show |
Series | page_pool: Add page_pool stat counters | expand |
diff --git a/net/core/page_pool.c b/net/core/page_pool.c index 7e33590..b1a2599 100644 --- a/net/core/page_pool.c +++ b/net/core/page_pool.c @@ -29,6 +29,15 @@ #ifdef CONFIG_PAGE_POOL_STATS DEFINE_PER_CPU_ALIGNED(struct page_pool_stats, page_pool_stats); EXPORT_PER_CPU_SYMBOL(page_pool_stats); + +#define page_pool_stat_alloc_inc(__stat) \ + do { \ + struct page_pool_stats *pps = this_cpu_ptr(&page_pool_stats); \ + pps->alloc.__stat++; \ + } while (0) + +#else +#define page_pool_stat_alloc_inc(stat) #endif static int page_pool_init(struct page_pool *pool,
Add simple wrapper macro for incrementing page pool stats. This wrapper is intended to be used in softirq context. Signed-off-by: Joe Damato <jdamato@fastly.com> --- net/core/page_pool.c | 9 +++++++++ 1 file changed, 9 insertions(+)