Message ID | 1643933373-6590-5-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 5f822b0..180e48b 100644 --- a/net/core/page_pool.c +++ b/net/core/page_pool.c @@ -26,6 +26,19 @@ #define BIAS_MAX LONG_MAX +#ifdef CONFIG_PAGE_POOL_STATS +/* + * this_cpu_inc_alloc_stat is intended to be used in softirq context + */ +#define this_cpu_inc_alloc_stat(pool, __stat) \ + do { \ + struct page_pool_stats __percpu *s = pool->stats; \ + __this_cpu_inc(s->alloc.__stat); \ + } while (0) +#else +#define this_cpu_inc_alloc_stat(pool, __stat) +#endif + static int page_pool_init(struct page_pool *pool, const struct page_pool_params *params) {
Add macro incrementing per pool per cpu stats. Signed-off-by: Joe Damato <jdamato@fastly.com> --- net/core/page_pool.c | 13 +++++++++++++ 1 file changed, 13 insertions(+)