From: Jakub Kicinski <kuba@kernel.org>
To: zijianzhang@bytedance.com
Cc: netdev@vger.kernel.org, edumazet@google.com,
willemdebruijn.kernel@gmail.com, cong.wang@bytedance.com,
xiaochun.lu@bytedance.com
Subject: Re: [PATCH net-next v6 2/4] sock: support copy cmsg to userspace in TX path
Date: Thu, 27 Jun 2024 14:51:40 -0700 [thread overview]
Message-ID: <20240627145140.675bbf86@kernel.org> (raw)
In-Reply-To: <20240626193403.3854451-3-zijianzhang@bytedance.com>
On Wed, 26 Jun 2024 19:34:01 +0000 zijianzhang@bytedance.com wrote:
> From: Zijian Zhang <zijianzhang@bytedance.com>
>
> Since ____sys_sendmsg creates a kernel copy of msg_control and passes
> that to the callees, put_cmsg will write into this kernel buffer. If
> people want to piggyback some information like timestamps upon returning
> of sendmsg. ____sys_sendmsg will have to copy_to_user to the original buf,
> which is not supported. As a result, users typically have to call recvmsg
> on the ERRMSG_QUEUE of the socket, incurring extra system call overhead.
>
> This commit supports copying cmsg to userspace in TX path by introducing
> a flag MSG_CMSG_COPY_TO_USER in struct msghdr to guide the copy logic
> upon returning of ___sys_sendmsg.
sparse complains about the annotations:
net/socket.c:2635:30: warning: incorrect type in assignment (different address spaces)
net/socket.c:2635:30: expected void *msg_control
net/socket.c:2635:30: got void [noderef] __user *[noderef] __user msg_control
net/socket.c:2629:49: warning: dereference of noderef expression
--
pw-bot: cr
next prev parent reply other threads:[~2024-06-27 21:51 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-26 19:33 [PATCH net-next v6 0/4] net: A lightweight zero-copy notification zijianzhang
2024-06-26 19:34 ` [PATCH net-next v6 1/4] selftests: fix OOM problem in msg_zerocopy selftest zijianzhang
2024-06-30 14:37 ` Willem de Bruijn
2024-06-26 19:34 ` [PATCH net-next v6 2/4] sock: support copy cmsg to userspace in TX path zijianzhang
2024-06-27 21:51 ` Jakub Kicinski [this message]
2024-06-28 3:11 ` kernel test robot
2024-06-30 14:43 ` Willem de Bruijn
2024-07-01 19:46 ` [External] " Zijian Zhang
2024-07-03 0:10 ` Willem de Bruijn
2024-06-26 19:34 ` [PATCH net-next v6 3/4] sock: add MSG_ZEROCOPY notification mechanism based on msg_control zijianzhang
2024-06-30 14:44 ` Willem de Bruijn
2024-07-01 19:58 ` Zijian Zhang
2024-06-26 19:34 ` [PATCH net-next v6 4/4] selftests: add MSG_ZEROCOPY msg_control notification test zijianzhang
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=20240627145140.675bbf86@kernel.org \
--to=kuba@kernel.org \
--cc=cong.wang@bytedance.com \
--cc=edumazet@google.com \
--cc=netdev@vger.kernel.org \
--cc=willemdebruijn.kernel@gmail.com \
--cc=xiaochun.lu@bytedance.com \
--cc=zijianzhang@bytedance.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.