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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 221BFC46467 for ; Tue, 3 Jan 2023 11:46:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233233AbjACLp7 (ORCPT ); Tue, 3 Jan 2023 06:45:59 -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) Precedence: bulk List-ID: X-Mailing-List: bpf@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.