[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <d53adec9-10d5-41e2-8065-3826029f6134@bytedance.com>
Date: Wed, 24 Jul 2024 18:11:06 -0700
From: Zijian Zhang <zijianzhang@...edance.com>
To: Willem de Bruijn <willemdebruijn.kernel@...il.com>, netdev@...r.kernel.org
Cc: edumazet@...gle.com, cong.wang@...edance.com, xiaochun.lu@...edance.com
Subject: Re: [PATCH net-next v7 1/3] sock: support copying cmsgs to the user
space in sendmsg
On 7/9/24 9:40 AM, Willem de Bruijn wrote:
> zijianzhang@ wrote:
>> From: Zijian Zhang <zijianzhang@...edance.com>
>>
>> Users can pass msg_control as a placeholder to recvmsg, and get some info
>> from the kernel upon returning of it, but it's not available for sendmsg.
>> Recvmsg uses put_cmsg to copy info back to the user, while ____sys_sendmsg
>> creates a kernel copy of msg_control and passes that to the callees,
>> put_cmsg in sendmsg path will write into this kernel buffer.
>>
>> If users want to get info after returning of sendmsg, they typically have
>> to call recvmsg on the ERRMSG_QUEUE of the socket, incurring extra system
>
> nit: error queue or MSG_ERRQUEUE
>
>> call overhead. This commit supports copying cmsg from the kernel space to
>> the user space upon returning of sendmsg to mitigate this overhead.
>>
>> Signed-off-by: Zijian Zhang <zijianzhang@...edance.com>
>> Signed-off-by: Xiaochun Lu <xiaochun.lu@...edance.com>
>
> Overall this approach follows what I had in mind, thanks.
>
> Looking forward to the discussion with a wider audience at netdevconf
> next week.
After wider exposure to netdev, besides the comments in this email
series, I want to align the next step with you :)
Shall I also make this a config and add conditional compilation in the
hot path?
>> ---
>> include/linux/socket.h | 6 +++++
>> include/net/sock.h | 2 +-
>> net/core/sock.c | 6 +++--
>> net/ipv4/ip_sockglue.c | 2 +-
>> net/ipv6/datagram.c | 2 +-
>> net/socket.c | 54 ++++++++++++++++++++++++++++++++++++++----
>> 6 files changed, 62 insertions(+), 10 deletions(-)
>>
Powered by blists - more mailing lists