diff options
| author | David S. Miller <davem@davemloft.net> | 2022-04-15 12:43:48 +0300 |
|---|---|---|
| committer | David S. Miller <davem@davemloft.net> | 2022-04-15 12:43:48 +0300 |
| commit | 4867d750b227fa1affb171cd257dd9dde48d7d32 (patch) | |
| tree | bf6c91452e8bda9c83c0a37fdade0f67b4ac7e28 /include | |
| parent | edf45f007a31e86738f6be3065591ddad94477d1 (diff) | |
| parent | b3fc79225f055af7ef48b47a90752c31cc062e6e (diff) | |
| download | linux-4867d750b227fa1affb171cd257dd9dde48d7d32.tar.xz | |
Merge branch 'mneta-page_pool_get_stats'
Lorenzo Bianconi says:
====================
net: mvneta: add support for page_pool_get_stats
Introduce page_pool stats ethtool APIs in order to avoid driver duplicated
code.
Changes since v4:
- rebase on top of net-next
Changes since v3:
- get rid of wrong for loop in page_pool_ethtool_stats_get()
- add API stubs when page_pool_stats are not compiled in
Changes since v2:
- remove enum list of page_pool stats in page_pool.h
- remove leftover change in mvneta.c for ethtool_stats array allocation
Changes since v1:
- move stats accounting to page_pool code
- move stats string management to page_pool code
====================
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include')
| -rw-r--r-- | include/net/page_pool.h | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/include/net/page_pool.h b/include/net/page_pool.h index ea5fb70e5101..813c93499f20 100644 --- a/include/net/page_pool.h +++ b/include/net/page_pool.h @@ -117,6 +117,10 @@ struct page_pool_stats { struct page_pool_recycle_stats recycle_stats; }; +int page_pool_ethtool_stats_get_count(void); +u8 *page_pool_ethtool_stats_get_strings(u8 *data); +u64 *page_pool_ethtool_stats_get(u64 *data, void *stats); + /* * Drivers that wish to harvest page pool stats and report them to users * (perhaps via ethtool, debugfs, or another mechanism) can allocate a @@ -124,6 +128,23 @@ struct page_pool_stats { */ bool page_pool_get_stats(struct page_pool *pool, struct page_pool_stats *stats); +#else + +static inline int page_pool_ethtool_stats_get_count(void) +{ + return 0; +} + +static inline u8 *page_pool_ethtool_stats_get_strings(u8 *data) +{ + return data; +} + +static inline u64 *page_pool_ethtool_stats_get(u64 *data, void *stats) +{ + return data; +} + #endif struct page_pool { |
