All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stanislav Fomichev <stfomichev@gmail.com>
To: Al Viro <viro@zeniv.linux.org.uk>
Cc: netdev@vger.kernel.org, davem@davemloft.net, edumazet@google.com,
	kuba@kernel.org, pabeni@redhat.com, horms@kernel.org,
	willemb@google.com, sagi@grimberg.me, asml.silence@gmail.com,
	almasrymina@google.com, kaiyuanz@google.com,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH net-next] net: devmem: remove min_t(iter_iov_len) in sendmsg
Date: Fri, 16 May 2025 20:53:09 -0700	[thread overview]
Message-ID: <aCgIJSgv-yQzaHLl@mini-arch> (raw)
In-Reply-To: <20250517033951.GY2023217@ZenIV>

On 05/17, Al Viro wrote:
> On Fri, May 16, 2025 at 07:17:23PM -0700, Stanislav Fomichev wrote:
> > > Wait, in the same commit there's
> > > +       if (iov_iter_type(from) != ITER_IOVEC)
> > > +               return -EFAULT;
> > > 
> > > shortly prior to the loop iter_iov_{addr,len}() are used.  What am I missing now?
> > 
> > Yeah, I want to remove that part as well:
> > 
> > https://lore.kernel.org/netdev/20250516225441.527020-1-stfomichev@gmail.com/T/#u
> > 
> > Otherwise, sendmsg() with a single IOV is not accepted, which makes not
> > sense.
> 
> Wait a minute.  What's there to prevent a call with two ranges far from each other?

It is perfectly possible to have a call with two disjoint ranges,
net_devmem_get_niov_at should correctly resolve it to the IOVA in the
dmabuf. Not sure I understand why it's an issue, can you pls clarify?

What we want to have here is:

1. sendmsg(msg.msg_iov = [{ .iov_base = .., .iov_len = x }])
2. sendmsg(msg.msg_iov = [{ .iov_base = .., .iov_len = x },
                          { .iov_base = .., .iov_len = y])

Both should be accepted. Currently only (2) works because of that ITER_IOVEC
check. Once I remove it, I hit the issue where iter_iov_len starts to
return too early.

(Documentation/networking/devmem.rst has a bit more info on the sendmsg UAPI
with dmabufs if that's still confusing)

  reply	other threads:[~2025-05-17  3:53 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-05-17  0:04 [PATCH net-next] net: devmem: remove min_t(iter_iov_len) in sendmsg Stanislav Fomichev
2025-05-17  0:09 ` Al Viro
2025-05-17  1:24   ` Stanislav Fomichev
2025-05-17  2:06     ` Al Viro
2025-05-17  2:17       ` Stanislav Fomichev
2025-05-17  3:39         ` Al Viro
2025-05-17  3:53           ` Stanislav Fomichev [this message]
2025-05-17  4:05             ` Al Viro
2025-05-17  4:29               ` Stanislav Fomichev
2025-05-17  4:53                 ` Mina Almasry
2025-05-20 15:10                 ` Pavel Begunkov

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=aCgIJSgv-yQzaHLl@mini-arch \
    --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=viro@zeniv.linux.org.uk \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.