* [PATCH net-next v2] net: devmem: return EMSGSIZE on type mismatch
@ 2026-08-10 20:11 Mina Almasry
2026-08-11 0:20 ` Stanislav Fomichev
0 siblings, 1 reply; 2+ messages in thread
From: Mina Almasry @ 2026-08-10 20:11 UTC (permalink / raw)
To: netdev, linux-kernel
Cc: Mina Almasry, David S. Miller, Eric Dumazet, Jakub Kicinski,
Paolo Abeni, Simon Horman, Bobby Eshleman, Pavel Begunkov,
Ralf Lici, Will Deacon, Stanislav Fomichev, Bobby Eshleman
When a devmem payload mixes with a standard page payload, return
-EMSGSIZE instead of -EFAULT. This enables tcp_sendmsg to seamlessly
fall back to creating a new segment instead of failing the socket send.
Fixes: bd61848900bff ("net: devmem: Implement TX path")
Cc: Pavel Begunkov <asml.silence@gmail.com>
Cc: Stanislav Fomichev <sdf@fomichev.me>
Cc: Bobby Eshleman <bobbyeshleman@gmail.com>
Signed-off-by: Mina Almasry <almasrymina@google.com>
Reviewed-by: Pavel Begunkov <asml.silence@gmail.com>
Reviewed-by: Bobby Eshleman <bobbyeshleman@meta.com>
---
v2: Sent to net-next instead of net (Jakub). Otherwise no changes.
v1: https://lore.kernel.org/r/20260801125308.1342897-2-almasrymina@google.com
---
net/core/datagram.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/net/core/datagram.c b/net/core/datagram.c
index 173b5d97bd409..6f8ffd61bcab4 100644
--- a/net/core/datagram.c
+++ b/net/core/datagram.c
@@ -638,7 +638,7 @@ int zerocopy_fill_skb_from_iter(struct sk_buff *skb,
int frag = skb_shinfo(skb)->nr_frags;
if (!skb_frags_readable(skb))
- return -EFAULT;
+ return -EMSGSIZE;
while (length && iov_iter_count(from)) {
struct page *head, *last_head = NULL;
@@ -713,7 +713,7 @@ zerocopy_fill_skb_from_devmem(struct sk_buff *skb, struct iov_iter *from,
struct net_iov *niov;
if (i && skb_frags_readable(skb))
- return -EFAULT;
+ return -EMSGSIZE;
/* Devmem filling works by taking an IOVEC from the user where the
* iov_addrs are interpreted as an offset in bytes into the dma-buf to
base-commit: 001b5d347d8ba39b2dccaefcc57967b18caec8fe
--
2.55.0.679.g6767b8d81c-goog
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: [PATCH net-next v2] net: devmem: return EMSGSIZE on type mismatch
2026-08-10 20:11 [PATCH net-next v2] net: devmem: return EMSGSIZE on type mismatch Mina Almasry
@ 2026-08-11 0:20 ` Stanislav Fomichev
0 siblings, 0 replies; 2+ messages in thread
From: Stanislav Fomichev @ 2026-08-11 0:20 UTC (permalink / raw)
To: Mina Almasry
Cc: netdev, linux-kernel, David S. Miller, Eric Dumazet,
Jakub Kicinski, Paolo Abeni, Simon Horman, Bobby Eshleman,
Pavel Begunkov, Ralf Lici, Will Deacon, Stanislav Fomichev,
Bobby Eshleman
On 08/10, Mina Almasry wrote:
> When a devmem payload mixes with a standard page payload, return
> -EMSGSIZE instead of -EFAULT. This enables tcp_sendmsg to seamlessly
> fall back to creating a new segment instead of failing the socket send.
>
> Fixes: bd61848900bff ("net: devmem: Implement TX path")
> Cc: Pavel Begunkov <asml.silence@gmail.com>
> Cc: Stanislav Fomichev <sdf@fomichev.me>
> Cc: Bobby Eshleman <bobbyeshleman@gmail.com>
> Signed-off-by: Mina Almasry <almasrymina@google.com>
> Reviewed-by: Pavel Begunkov <asml.silence@gmail.com>
> Reviewed-by: Bobby Eshleman <bobbyeshleman@meta.com>
Acked-by: Stanislav Fomichev <sdf@fomichev.me>
(matches my original suggestion on
https://lore.kernel.org/netdev/ameLB_goNrMbscXO@devvm7509.cco0.facebook.com/)
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-08-11 0:20 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-10 20:11 [PATCH net-next v2] net: devmem: return EMSGSIZE on type mismatch Mina Almasry
2026-08-11 0:20 ` Stanislav Fomichev
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox