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=-14.3 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=ham 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 20844C433ED for ; Fri, 21 May 2021 00:43:45 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id EF94A611AB for ; Fri, 21 May 2021 00:43:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235314AbhEUApF (ORCPT ); Thu, 20 May 2021 20:45:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53424 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235175AbhEUApD (ORCPT ); Thu, 20 May 2021 20:45:03 -0400 Received: from mail-wm1-x32f.google.com (mail-wm1-x32f.google.com [IPv6:2a00:1450:4864:20::32f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5EC1FC061574; Thu, 20 May 2021 17:43:40 -0700 (PDT) Received: by mail-wm1-x32f.google.com with SMTP id z130so10176038wmg.2; Thu, 20 May 2021 17:43:40 -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=wzTHc9qf/9Gyj2F7Jjof+103i3haRjLIlfKVYMSi9f0=; b=m1+n9Zpe/GNJi20fwahH90vZPELe8PJfHMnZE5GY/JT0yAPJDy/Tb0arMFLQMBbBKC Fzqs16ct/00k/jVHEdr7lQP7NPDhYoo3J+Ry+wnrPpH4YYJJV06HxwJh/dP4HUTbKq/O DGOZBlz4Mf5KaU9/45r0l6u5aho9HWiswY9Dfp74hPkb24flcut6fmkqKNHaI6AJideK gzkjyZeeWaN/agSXXl7dnQjMj2peUDAmZGLJT7U40BTRYrmTKWfQYxpmGmeE9UATdxQN uqve+49l66WWJiirjBm8z0ra1rp+Vml1z6RTdWXxEHW0T7RyNjSALT98QtDSGyp9XHug fG5Q== 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=wzTHc9qf/9Gyj2F7Jjof+103i3haRjLIlfKVYMSi9f0=; b=WsVY4NYQVdj8ZrynDZL+kzQ/TmhUuF0Kx9AsOFHUL5GznCMvOYfF+KCAT9CjVHFazy /RM96ClLMpSFVvUunE45d8fYCDP5946HI+RbOacYzYsGdiRs6nuaISK4kcWuUUsQZDO3 h+MLv6Nsk1Ep3me6QdMu8OjR7zgenQJvMWH8b2HTUBSRpG1fgtePKl5j3lsAR9RLkKhv LwQnQ1OMuNytlxK1FSRdt04Ge0oAwptunEi2riZjDPUal2NMA1/Ewz2bpRF0wBNRdgP/ eGR6Ut05VbSjW2PyvkHNLbwj7g8QO7teZt6wv3f9YwYzHOoohng9wx0JfYgKZUT7/9HA EPWw== X-Gm-Message-State: AOAM533ZiLvpqny3Zcb3T3khyIeHLGtMVT0XdfqR8pbagG+XnM2XUSuT z/229uOyAX5yiscnHKcGRhk= X-Google-Smtp-Source: ABdhPJyK0Kh76kLnAgOjLQY+kUei7T+tqBnuq8EFjDlzihkAPjP76LNvtOD0tWnU4jygDTYXU6QH9Q== X-Received: by 2002:a05:600c:2dc8:: with SMTP id e8mr4477858wmh.72.1621557819043; Thu, 20 May 2021 17:43:39 -0700 (PDT) Received: from [192.168.8.197] ([85.255.236.182]) by smtp.gmail.com with ESMTPSA id h14sm164161wrq.45.2021.05.20.17.43.37 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 20 May 2021 17:43:38 -0700 (PDT) Subject: Re: [PATCH 13/23] io_uring: implement bpf prog registration 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: From: Pavel Begunkov Message-ID: <2ae0fcbf-fe4a-b2e6-5e7a-4f62c8e91d7e@gmail.com> Date: Fri, 21 May 2021 01:43:30 +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: 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 12:45 AM, Song Liu wrote: >> On May 19, 2021, at 7:13 AM, Pavel Begunkov wrote: >> >> [de]register BPF programs through io_uring_register() with new >> IORING_ATTACH_BPF and IORING_DETACH_BPF commands. >> >> Signed-off-by: Pavel Begunkov >> --- >> fs/io_uring.c | 81 +++++++++++++++++++++++++++++++++++ >> include/uapi/linux/io_uring.h | 2 + >> 2 files changed, 83 insertions(+) >> >> diff --git a/fs/io_uring.c b/fs/io_uring.c >> index 882b16b5e5eb..b13cbcd5c47b 100644 >> --- a/fs/io_uring.c >> +++ b/fs/io_uring.c >> @@ -78,6 +78,7 @@ >> #include >> #include >> #include >> +#include >> >> #define CREATE_TRACE_POINTS >> #include >> @@ -103,6 +104,8 @@ >> #define IORING_MAX_RESTRICTIONS (IORING_RESTRICTION_LAST + \ >> IORING_REGISTER_LAST + IORING_OP_LAST) >> >> +#define IORING_MAX_BPF_PROGS 100 > > Is 100 a realistic number here? Arbitrary test value, will update > >> + >> #define SQE_VALID_FLAGS (IOSQE_FIXED_FILE|IOSQE_IO_DRAIN|IOSQE_IO_LINK| \ >> IOSQE_IO_HARDLINK | IOSQE_ASYNC | \ >> IOSQE_BUFFER_SELECT) >> @@ -266,6 +269,10 @@ struct io_restriction { >> bool registered; >> }; >> > > [...] > -- Pavel Begunkov