summaryrefslogtreecommitdiff
path: root/net/core/netdev_rx_queue.c
diff options
context:
space:
mode:
authorMina Almasry <almasrymina@google.com>2024-09-10 20:14:50 +0300
committerJakub Kicinski <kuba@kernel.org>2024-09-12 06:44:31 +0300
commit0f921404689398943257793f7240db239a23b609 (patch)
treef3d5b954252652f9f0de55644b6c330764784025 /net/core/netdev_rx_queue.c
parent8ab79ed50cf10f338465c296012500de1081646f (diff)
downloadlinux-0f921404689398943257793f7240db239a23b609.tar.xz
memory-provider: dmabuf devmem memory provider
Implement a memory provider that allocates dmabuf devmem in the form of net_iov. The provider receives a reference to the struct netdev_dmabuf_binding via the pool->mp_priv pointer. The driver needs to set this pointer for the provider in the net_iov. The provider obtains a reference on the netdev_dmabuf_binding which guarantees the binding and the underlying mapping remains alive until the provider is destroyed. Usage of PP_FLAG_DMA_MAP is required for this memory provide such that the page_pool can provide the driver with the dma-addrs of the devmem. Support for PP_FLAG_DMA_SYNC_DEV is omitted for simplicity & p.order != 0. Signed-off-by: Willem de Bruijn <willemb@google.com> Signed-off-by: Kaiyuan Zhang <kaiyuanz@google.com> Signed-off-by: Mina Almasry <almasrymina@google.com> Reviewed-by: Pavel Begunkov <asml.silence@gmail.com> Reviewed-by: Jakub Kicinski <kuba@kernel.org> Link: https://patch.msgid.link/20240910171458.219195-7-almasrymina@google.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'net/core/netdev_rx_queue.c')
-rw-r--r--net/core/netdev_rx_queue.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/net/core/netdev_rx_queue.c b/net/core/netdev_rx_queue.c
index da11720a5983..e217a5838c87 100644
--- a/net/core/netdev_rx_queue.c
+++ b/net/core/netdev_rx_queue.c
@@ -4,8 +4,11 @@
#include <net/netdev_queues.h>
#include <net/netdev_rx_queue.h>
+#include "page_pool_priv.h"
+
int netdev_rx_queue_restart(struct net_device *dev, unsigned int rxq_idx)
{
+ struct netdev_rx_queue *rxq = __netif_get_rx_queue(dev, rxq_idx);
void *new_mem, *old_mem;
int err;
@@ -31,6 +34,10 @@ int netdev_rx_queue_restart(struct net_device *dev, unsigned int rxq_idx)
if (err)
goto err_free_old_mem;
+ err = page_pool_check_memory_provider(dev, rxq);
+ if (err)
+ goto err_free_new_queue_mem;
+
err = dev->queue_mgmt_ops->ndo_queue_stop(dev, old_mem, rxq_idx);
if (err)
goto err_free_new_queue_mem;