[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20241107212309.3097362-6-almasrymina@google.com>
Date: Thu, 7 Nov 2024 21:23:09 +0000
From: Mina Almasry <almasrymina@...gle.com>
To: netdev@...r.kernel.org, Jakub Kicinski <kuba@...nel.org>,
Mina Almasry <almasrymina@...gle.com>, Pavel Begunkov <asml.silence@...il.com>,
Willem de Bruijn <willemb@...gle.com>, Kaiyuan Zhang <kaiyuanz@...gle.com>,
Samiullah Khawaja <skhawaja@...gle.com>, linux-kernel@...r.kernel.org
Cc: "David S. Miller" <davem@...emloft.net>, Eric Dumazet <edumazet@...gle.com>,
Paolo Abeni <pabeni@...hat.com>, Simon Horman <horms@...nel.org>,
Jesper Dangaard Brouer <hawk@...nel.org>, Ilias Apalodimas <ilias.apalodimas@...aro.org>
Subject: [PATCH net-next v2 5/5] netmem: add netmem_prefetch
prefect(page) is a common thing to be called from drivers. Add
netmem_prefetch that can be called on generic netmem. Skips the prefetch
for net_iovs.
Signed-off-by: Mina Almasry <almasrymina@...gle.com>
---
include/net/netmem.h | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/include/net/netmem.h b/include/net/netmem.h
index 8a6e20be4b9d..923c47147aa8 100644
--- a/include/net/netmem.h
+++ b/include/net/netmem.h
@@ -171,4 +171,11 @@ static inline unsigned long netmem_get_dma_addr(netmem_ref netmem)
return __netmem_clear_lsb(netmem)->dma_addr;
}
+static inline void netmem_prefetch(netmem_ref netmem)
+{
+ if (netmem_is_net_iov(netmem))
+ return;
+
+ prefetch(netmem_to_page(netmem));
+}
#endif /* _NET_NETMEM_H */
--
2.47.0.277.g8800431eea-goog
Powered by blists - more mailing lists