aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4/tcp.c
diff options
context:
space:
mode:
authorPavel Begunkov <[email protected]>2025-02-04 21:56:19 +0000
committerJakub Kicinski <[email protected]>2025-02-07 00:27:31 +0000
commit69e39537b66232103633f685b208f293bf9a15b5 (patch)
treeca848f5a85135fb942d389e8b1c0610327e74a6b /net/ipv4/tcp.c
parentnet: page_pool: add a mp hook to unregister_netdevice* (diff)
downloadkernel-69e39537b66232103633f685b208f293bf9a15b5.tar.gz
kernel-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 <[email protected]> Reviewed-by: Jakub Kicinski <[email protected]> Signed-off-by: Pavel Begunkov <[email protected]> Signed-off-by: David Wei <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
Diffstat (limited to 'net/ipv4/tcp.c')
-rw-r--r--net/ipv4/tcp.c5
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;