[PATCH net-next] net: devmem: drop iterator type check

Stanislav Fomichev
2025-05-16T22:54:44Z

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