Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 76647C433FE for ; Tue, 11 Jan 2022 13:52:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241173AbiAKNwA (ORCPT ); Tue, 11 Jan 2022 08:52:00 -0500 Received: from out30-133.freemail.mail.aliyun.com ([115.124.30.133]:54518 "EHLO out30-133.freemail.mail.aliyun.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241076AbiAKNv7 (ORCPT ); Tue, 11 Jan 2022 08:51:59 -0500 X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R181e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=e01e04357;MF=haoxu@linux.alibaba.com;NM=1;PH=DS;RN=11;SR=0;TI=SMTPD_---0V1Zvkwx_1641909115; Received: from B-25KNML85-0107.local(mailfrom:haoxu@linux.alibaba.com fp:SMTPD_---0V1Zvkwx_1641909115) by smtp.aliyun-inc.com(127.0.0.1); Tue, 11 Jan 2022 21:51:56 +0800 Subject: Re: [RFC v2 02/19] skbuff: pass a struct ubuf_info in msghdr To: Pavel Begunkov , io-uring@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Jakub Kicinski , Jonathan Lemon , "David S . Miller" , Willem de Bruijn , Eric Dumazet , David Ahern , Jens Axboe References: <7dae2f61ee9a1ad38822870764fcafad43a3fe4e.1640029579.git.asml.silence@gmail.com> From: Hao Xu Message-ID: Date: Tue, 11 Jan 2022 21:51:55 +0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:78.0) Gecko/20100101 Thunderbird/78.14.0 MIME-Version: 1.0 In-Reply-To: <7dae2f61ee9a1ad38822870764fcafad43a3fe4e.1640029579.git.asml.silence@gmail.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 在 2021/12/21 下午11:35, Pavel Begunkov 写道: > Instead of the net stack managing ubuf_info, allow to pass it in from > outside in a struct msghdr (in-kernel structure), so io_uring can make > use of it. > > Signed-off-by: Pavel Begunkov > --- Hi Pavel, I've some confusions here since I have a lack of network knowledge. The first one is why do we make ubuf_info visible for io_uring. Why not just follow the old MSG_ZEROCOPY logic? The second one, my understanding about the buffer lifecycle is that the kernel side informs the userspace by a cqe generated by the ubuf_info callback that all the buffers attaching to the same notifier is now free to use when all the data is sent, then why is the flush in 13/19 needed as it is at the submission period? Regards, Hao