netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next] net: devmem: drop iterator type check
@ 2025-05-16 22:54 Stanislav Fomichev
  2025-05-17  4:45 ` Mina Almasry
  2025-05-19 10:45 ` Pavel Begunkov
  0 siblings, 2 replies; 7+ messages in thread
From: Stanislav Fomichev @ 2025-05-16 22:54 UTC (permalink / raw)
  To: netdev
  Cc: davem, edumazet, kuba, pabeni, horms, sagi, willemb, asml.silence,
	almasrymina, stfomichev, kaiyuanz, linux-kernel

sendmsg() with a single iov becomes ITER_UBUF, sendmsg() with multiple
iovs becomes ITER_IOVEC. Instead of adjusting the check to include
ITER_UBUF, drop the check completely. The callers are guaranteed
to happen from system call side and we don't need to pay runtime
cost to verify it.

Fixes: bd61848900bf ("net: devmem: Implement TX path")
Signed-off-by: Stanislav Fomichev <stfomichev@gmail.com>
---
 net/core/datagram.c | 7 -------
 1 file changed, 7 deletions(-)

diff --git a/net/core/datagram.c b/net/core/datagram.c
index 9ef5442536f5..e04908276a32 100644
--- a/net/core/datagram.c
+++ b/net/core/datagram.c
@@ -702,13 +702,6 @@ zerocopy_fill_skb_from_devmem(struct sk_buff *skb, struct iov_iter *from,
 	size_t virt_addr, size, off;
 	struct net_iov *niov;
 
-	/* 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
-	 * send from. We do not support other iter types.
-	 */
-	if (iov_iter_type(from) != ITER_IOVEC)
-		return -EFAULT;
-
 	while (length && iov_iter_count(from)) {
 		if (i == MAX_SKB_FRAGS)
 			return -EMSGSIZE;
-- 
2.49.0


^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2025-05-19 15:39 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-05-16 22:54 [PATCH net-next] net: devmem: drop iterator type check Stanislav Fomichev
2025-05-17  4:45 ` Mina Almasry
2025-05-17  4:48   ` Stanislav Fomichev
2025-05-19 10:45 ` Pavel Begunkov
2025-05-19 14:41   ` Stanislav Fomichev
2025-05-19 15:19     ` Pavel Begunkov
2025-05-19 15:39       ` Stanislav Fomichev

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).