Commit 857922b1 authored by Lucas Stach's avatar Lucas Stach Committed by Jakub Kicinski

net: fec: allow to build without PAGE_POOL_STATS

Commit 6970ef27 ("net: fec: add xdp and page pool statistics") selected
CONFIG_PAGE_POOL_STATS from the FEC driver symbol, making it impossible
to build without the page pool statistics when this driver is enabled. The
help text of those statistics mentions increased overhead. Allow the user
to choose between usefulness of the statistics and the added overhead.
Signed-off-by: default avatarLucas Stach <l.stach@pengutronix.de>
Reviewed-by: default avatarAndrew Lunn <andrew@lunn.ch>
Link: https://lore.kernel.org/r/20230616191832.2944130-1-l.stach@pengutronix.deSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent b6d972f6
...@@ -29,7 +29,7 @@ config FEC ...@@ -29,7 +29,7 @@ config FEC
select CRC32 select CRC32
select PHYLIB select PHYLIB
select PAGE_POOL select PAGE_POOL
select PAGE_POOL_STATS imply PAGE_POOL_STATS
imply NET_SELFTESTS imply NET_SELFTESTS
help help
Say Y here if you want to use the built-in 10/100 Fast ethernet Say Y here if you want to use the built-in 10/100 Fast ethernet
......
...@@ -2789,6 +2789,7 @@ static void fec_enet_get_xdp_stats(struct fec_enet_private *fep, u64 *data) ...@@ -2789,6 +2789,7 @@ static void fec_enet_get_xdp_stats(struct fec_enet_private *fep, u64 *data)
static void fec_enet_page_pool_stats(struct fec_enet_private *fep, u64 *data) static void fec_enet_page_pool_stats(struct fec_enet_private *fep, u64 *data)
{ {
#ifdef CONFIG_PAGE_POOL_STATS
struct page_pool_stats stats = {}; struct page_pool_stats stats = {};
struct fec_enet_priv_rx_q *rxq; struct fec_enet_priv_rx_q *rxq;
int i; int i;
...@@ -2803,6 +2804,7 @@ static void fec_enet_page_pool_stats(struct fec_enet_private *fep, u64 *data) ...@@ -2803,6 +2804,7 @@ static void fec_enet_page_pool_stats(struct fec_enet_private *fep, u64 *data)
} }
page_pool_ethtool_stats_get(data, &stats); page_pool_ethtool_stats_get(data, &stats);
#endif
} }
static void fec_enet_get_ethtool_stats(struct net_device *dev, static void fec_enet_get_ethtool_stats(struct net_device *dev,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment