netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stanislav Fomichev <stfomichev@gmail.com>
To: netdev@vger.kernel.org
Cc: davem@davemloft.net, edumazet@google.com, kuba@kernel.org,
	pabeni@redhat.com, horms@kernel.org, sagi@grimberg.me,
	willemb@google.com, asml.silence@gmail.com,
	almasrymina@google.com, stfomichev@gmail.com,
	kaiyuanz@google.com, linux-kernel@vger.kernel.org
Subject: [PATCH net-next] net: devmem: drop iterator type check
Date: Fri, 16 May 2025 15:54:41 -0700	[thread overview]
Message-ID: <20250516225441.527020-1-stfomichev@gmail.com> (raw)

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


             reply	other threads:[~2025-05-16 22:54 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-05-16 22:54 Stanislav Fomichev [this message]
2025-05-17  4:45 ` [PATCH net-next] net: devmem: drop iterator type check 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250516225441.527020-1-stfomichev@gmail.com \
    --to=stfomichev@gmail.com \
    --cc=almasrymina@google.com \
    --cc=asml.silence@gmail.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=horms@kernel.org \
    --cc=kaiyuanz@google.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=sagi@grimberg.me \
    --cc=willemb@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).