Received: by 2002:a05:6358:16cc:b0:ea:6187:17c9 with SMTP id r12csp11768615rwl; Tue, 3 Jan 2023 04:34:56 -0800 (PST) X-Google-Smtp-Source: AMrXdXudrp7ZnUfk30Fy5q1AVRvOdHPhuVIAPhVn8/IkT6dwXkHT5sLYHNnwXgRxXKrnNm8ji9L3 X-Received: by 2002:a17:907:a08d:b0:7c1:6986:2b7c with SMTP id hu13-20020a170907a08d00b007c169862b7cmr33990318ejc.8.1672749295904; Tue, 03 Jan 2023 04:34:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672749295; cv=none; d=google.com; s=arc-20160816; b=RVQdR+WmnLIcHUQA+tpS3wnsp3pmnT7gRKxwoSqok5A0huSTVz6FDB7USMJToCmwV1 PouHyeNM5lqwWcKL5baCacBJGP4ROWau4TUDtWvxxkM2hPKGiGabTBrZNYxtoMoXLvbh cDdy99p7roD9ptFzGP5ZeiOchT1qVas/aolLDNVTdz1WoYCUc6ERp0/iV6cgYyb1E2Sp 6ekyKA7uR+lv6IfArFFi1FXE1qh/uBENKGo6A6w8+vQLl6fZvyTTnOrJ05Wm8fZGyNw7 J+Ggw5r2BJz/AIQtoPbeIMClG3kXOd16QpW4taJFJGJgfrmxntasCcgoINGToTJTwdTq f1Zg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=E7tZq8RqZwfeXlrYWffwyNO6c06P4AlFQbteBeEGdjM=; b=sQAahRniDHzus+K+O1ogUsPqOR5POgO5SjkcEFXoVcbk/MsYtFlc0V7xgJh7t4HM51 I7IUaIOp7bazz3p2Px0Acse1AWNBtaS0a1Bbjae7jd8sp4ijaJdi1EIX9nm9qYBP+U3m cWTyTLfWMf88MqC25yJFtREpnscG8k3pTl11eb9XLNl3jPhoUzybT09NjOI+oGYFUj9R d3rpATsELuiKMibI7uLEgVwcXmAACXHpkvdCJBarFyLkfXgR6u2Zywr7woEonpfw/SIa FacryAMzZ7prFwsYWDiihEJL0u99KIpcg4cB0HwKcB2jK2AFU/dLY/y0Oi3ahEgffbff 2+fg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id hb20-20020a170907161400b007ae76a4e35fsi29001442ejc.5.2023.01.03.04.34.41; Tue, 03 Jan 2023 04:34:55 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237029AbjACLqC (ORCPT + 60 others); Tue, 3 Jan 2023 06:46:02 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41886 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233312AbjACLpy (ORCPT ); Tue, 3 Jan 2023 06:45:54 -0500 Received: from Chamillionaire.breakpoint.cc (Chamillionaire.breakpoint.cc [IPv6:2a0a:51c0:0:237:300::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BE659A441; Tue, 3 Jan 2023 03:45:53 -0800 (PST) Received: from fw by Chamillionaire.breakpoint.cc with local (Exim 4.92) (envelope-from ) id 1pCfjg-0003WK-LK; Tue, 03 Jan 2023 12:45:40 +0100 Date: Tue, 3 Jan 2023 12:45:40 +0100 From: Florian Westphal To: Quentin Deslandes Cc: Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko , Martin KaFai Lau , Song Liu , Yonghong Song , John Fastabend , KP Singh , Stanislav Fomichev , Hao Luo , Jiri Olsa , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Mykola Lysenko , Shuah Khan , Dmitrii Banshchikov , linux-kernel@vger.kernel.org, bpf@vger.kernel.org, linux-kselftest@vger.kernel.org, netdev@vger.kernel.org, Kernel Team Subject: Re: [PATCH bpf-next v3 00/16] bpfilter Message-ID: <20230103114540.GB13151@breakpoint.cc> References: <20221224000402.476079-1-qde@naccy.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20221224000402.476079-1-qde@naccy.de> User-Agent: Mutt/1.10.1 (2018-07-13) X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_PASS,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Quentin Deslandes wrote: > The patchset is based on the patches from David S. Miller [1], > Daniel Borkmann [2], and Dmitrii Banshchikov [3]. > > Note: I've partially sent this patchset earlier due to a > mistake on my side, sorry for then noise. > > The main goal of the patchset is to prepare bpfilter for > iptables' configuration blob parsing and code generation. > > The patchset introduces data structures and code for matches, > targets, rules and tables. Beside that the code generation > is introduced. > > The first version of the code generation supports only "inline" > mode - all chains and their rules emit instructions in linear > approach. > > Things that are not implemented yet: > 1) The process of switching from the previous BPF programs to the > new set isn't atomic. You can't make this atomic from userspace perspective, the get/setsockopt API of iptables uses a read-modify-write model. Tentatively I'd try to extend libnftnl and generate bpf code there, since its used by both iptables(-nft) and nftables we'd automatically get support for both. I was planning to look into "attach bpf progs to raw netfilter hooks" in Q1 2023, once the initial nf-bpf-codegen is merged.