diff options
author | 2025-02-04 13:56:19 -0800 | |
---|---|---|
committer | 2025-02-06 16:27:31 -0800 | |
commit | 69e39537b66232103633f685b208f293bf9a15b5 (patch) | |
tree | ca848f5a85135fb942d389e8b1c0610327e74a6b /net/ipv4/tcp.c | |
parent | net: page_pool: add a mp hook to unregister_netdevice* (diff) | |
download | wireguard-linux-69e39537b66232103633f685b208f293bf9a15b5.tar.xz wireguard-linux-69e39537b66232103633f685b208f293bf9a15b5.zip |
net: prepare for non devmem TCP memory providers
There is a good bunch of places in generic paths assuming that the only
page pool memory provider is devmem TCP. As we want to reuse the net_iov
and provider infrastructure, we need to patch it up and explicitly check
the provider type when we branch into devmem TCP code.
Reviewed-by: Mina Almasry <almasrymina@google.com>
Reviewed-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
Signed-off-by: David Wei <dw@davidwei.uk>
Link: https://patch.msgid.link/20250204215622.695511-9-dw@davidwei.uk
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to '')
-rw-r--r-- | net/ipv4/tcp.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c index b872de9a8271..7f43d31c9400 100644 --- a/net/ipv4/tcp.c +++ b/net/ipv4/tcp.c @@ -2476,6 +2476,11 @@ static int tcp_recvmsg_dmabuf(struct sock *sk, const struct sk_buff *skb, } niov = skb_frag_net_iov(frag); + if (!net_is_devmem_iov(niov)) { + err = -ENODEV; + goto out; + } + end = start + skb_frag_size(frag); copy = end - offset; |