From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.3 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE, SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2FF2CC433B4 for ; Fri, 21 May 2021 00:59:10 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 100F261090 for ; Fri, 21 May 2021 00:59:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235599AbhEUBAb (ORCPT ); Thu, 20 May 2021 21:00:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56878 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235596AbhEUBAb (ORCPT ); Thu, 20 May 2021 21:00:31 -0400 Received: from mail-wm1-x32a.google.com (mail-wm1-x32a.google.com [IPv6:2a00:1450:4864:20::32a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C9F1AC061574; Thu, 20 May 2021 17:59:08 -0700 (PDT) Received: by mail-wm1-x32a.google.com with SMTP id f19-20020a05600c1553b02901794fafcfefso5785933wmg.2; Thu, 20 May 2021 17:59:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=81twvJtD4IdoBkhuE/rquKU5rdFlaCgjOtn16ICABe8=; b=k8c0yx+hPiXp4RpSnCuJIQ0kDx9K5lKjNiQIZnPacZ9XwlVTOseeZqrX/86a+ZfT6C cGZOSQpl7AjaGEvDJHV17uAUprUsH670W6k6XWMHrb6AmjBGKsTbaOizTK4L7fubxPfG eb8+fpNh95QaL1721lcFE7FJvyR7bw4ujmvCr6GTSah7HtGNw8WQEKrk2yGDaCkoFjJz ZM3/axh2ZNth1ibS8meC2axCtMiWBBHkLgNitpI5FdCUBJtEWw7WaZUlyfThq3UGkQgP N7Ihwf9+0Hk7EJC01COYXNx1faSUDbidylqgTtPw5vS8g5rTaSmGa4heWTvFyH4izOSW +ryQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=81twvJtD4IdoBkhuE/rquKU5rdFlaCgjOtn16ICABe8=; b=S/sS4piBTsvBCRI5INChzauMMijEqBIiAt/holXZjaifZQbotI1BFYP5DSU9xrcUvZ f08mQO0/+PXZ/P595i5wUj401lDVkx1ImC9yPbqnJbu1pwxEeyr/Y2O5Z176Vu19lMxc QqUCafULcFHnOtMWvNlOqSYeY+G0Fm54bAsUGwjwZJlNGc0Td6gdic7n9BHh7tTtpurL FLJ6GaeUeSSuRvbjqfMiyEuMPD/CG07OkWMVZK7GLU5KAgxDQhrLa3X07qXlDyFRageW 5xFUIvEwTjt8hKQFHsuaerxQtNd/8AZJPY4+L6+eN5exUdBk2kmwoNiVC3LFtR6ptqet pzzA== X-Gm-Message-State: AOAM530n2tAF/5Stq9DGQ76ymY2QJ3GDQTSgKa+tYtFzgJk3HW1Wr7Dr PiLG/1VeLokQGKWLGj/mEbE= X-Google-Smtp-Source: ABdhPJzWzmTs5nBvHSB1jgReCMUyK4MWcPlVurAyiqEDO2p1iccOK2DvcrwaVNLlyvTT2p2BWetC3A== X-Received: by 2002:a05:600c:4f0f:: with SMTP id l15mr6253608wmq.143.1621558747505; Thu, 20 May 2021 17:59:07 -0700 (PDT) Received: from [192.168.8.197] ([85.255.236.182]) by smtp.gmail.com with ESMTPSA id i1sm4225081wmb.46.2021.05.20.17.59.06 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 20 May 2021 17:59:07 -0700 (PDT) Subject: Re: [RFC v2 00/23] io_uring BPF requests To: Song Liu Cc: "io-uring@vger.kernel.org" , Networking , "bpf@vger.kernel.org" , "linux-kernel@vger.kernel.org" , Jens Axboe , Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko , Martin Lau , Yonghong Song , John Fastabend , KP Singh , Horst Schirmeier , "Franz-B . Tuneke" , Christian Dietrich References: <0A3E3601-76CC-4196-8246-CCAEB8C8AED3@fb.com> From: Pavel Begunkov Message-ID: Date: Fri, 21 May 2021 01:58:59 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.10.1 MIME-Version: 1.0 In-Reply-To: <0A3E3601-76CC-4196-8246-CCAEB8C8AED3@fb.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: io-uring@vger.kernel.org On 5/21/21 1:35 AM, Song Liu wrote: >> On May 19, 2021, at 7:13 AM, Pavel Begunkov wrote: >> The main problem solved is feeding completion information of other >> requests in a form of CQEs back into BPF. I decided to wire up support >> for multiple completion queues (aka CQs) and give BPF programs access to >> them, so leaving userspace in control over synchronisation that should >> be much more flexible that the link-based approach. >> >> For instance, there can be a separate CQ for each BPF program, so no >> extra sync is needed, and communication can be done by submitting a >> request targeting a neighboring CQ or submitting a CQE there directly >> (see test3 below). CQ is choosen by sqe->cq_idx, so everyone can >> cross-fire if willing. >> > > [...] > >> bpf: add IOURING program type >> io_uring: implement bpf prog registration >> io_uring: add support for bpf requests >> io_uring: enable BPF to submit SQEs >> io_uring: enable bpf to submit CQEs >> io_uring: enable bpf to reap CQEs >> libbpf: support io_uring >> io_uring: pass user_data to bpf executor >> bpf: Add bpf_copy_to_user() helper >> io_uring: wire bpf copy to user >> io_uring: don't wait on CQ exclusively >> io_uring: enable bpf reqs to wait for CQs > > Besides the a few comments, these BPF related patches look sane to me. > Please consider add some selftests (tools/testing/selftests/bpf). The comments are noted. Thanks Song -- Pavel Begunkov