[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <aCgIJSgv-yQzaHLl@mini-arch>
Date: Fri, 16 May 2025 20:53:09 -0700
From: Stanislav Fomichev <stfomichev@...il.com>
To: Al Viro <viro@...iv.linux.org.uk>
Cc: netdev@...r.kernel.org, davem@...emloft.net, edumazet@...gle.com,
kuba@...nel.org, pabeni@...hat.com, horms@...nel.org,
willemb@...gle.com, sagi@...mberg.me, asml.silence@...il.com,
almasrymina@...gle.com, kaiyuanz@...gle.com,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH net-next] net: devmem: remove min_t(iter_iov_len) in
sendmsg
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)
Powered by blists - more mailing lists