netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next] memory-provider: fix compilation issue without SYSFS
@ 2024-09-12 10:25 Matthieu Baerts (NGI0)
  2024-09-12 12:49 ` Mina Almasry
  0 siblings, 1 reply; 5+ messages in thread
From: Matthieu Baerts (NGI0) @ 2024-09-12 10:25 UTC (permalink / raw)
  To: mptcp, David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	Kaiyuan Zhang, Mina Almasry, Willem de Bruijn, Pavel Begunkov
  Cc: netdev, linux-kernel, Matthieu Baerts (NGI0)

When CONFIG_SYSFS is not set, the kernel fails to compile:

     net/core/page_pool_user.c:368:45: error: implicit declaration of function 'get_netdev_rx_queue_index' [-Werror=implicit-function-declaration]
      368 |                 if (pool->slow.queue_idx == get_netdev_rx_queue_index(rxq)) {
          |                                             ^~~~~~~~~~~~~~~~~~~~~~~~~

When CONFIG_SYSFS is not set, get_netdev_rx_queue_index() is not defined
as well. In this case, page_pool_check_memory_provider() cannot check
the memory provider, and a success answer can be returned instead.

Fixes: 0f9214046893 ("memory-provider: dmabuf devmem memory provider")
Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
---
 net/core/page_pool_user.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/net/core/page_pool_user.c b/net/core/page_pool_user.c
index 48335766c1bf..a98c0a76b33f 100644
--- a/net/core/page_pool_user.c
+++ b/net/core/page_pool_user.c
@@ -353,6 +353,7 @@ void page_pool_unlist(struct page_pool *pool)
 int page_pool_check_memory_provider(struct net_device *dev,
 				    struct netdev_rx_queue *rxq)
 {
+#ifdef CONFIG_SYSFS
 	struct net_devmem_dmabuf_binding *binding = rxq->mp_params.mp_priv;
 	struct page_pool *pool;
 	struct hlist_node *n;
@@ -372,6 +373,9 @@ int page_pool_check_memory_provider(struct net_device *dev,
 	}
 	mutex_unlock(&page_pools_lock);
 	return -ENODATA;
+#else
+	return 0;
+#endif
 }
 
 static void page_pool_unreg_netdev_wipe(struct net_device *netdev)

---
base-commit: 3cfb5aa10cb78571e214e48a3a6e42c11d5288a1
change-id: 20240912-net-next-fix-get_netdev_rx_queue_index-a1034d1b962a

Best regards,
-- 
Matthieu Baerts (NGI0) <matttbe@kernel.org>


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2024-09-13  3:10 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-09-12 10:25 [PATCH net-next] memory-provider: fix compilation issue without SYSFS Matthieu Baerts (NGI0)
2024-09-12 12:49 ` Mina Almasry
2024-09-12 15:26   ` Matthieu Baerts
2024-09-12 18:21     ` Mina Almasry
2024-09-13  3:10       ` Jakub Kicinski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).