Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp17902453rwd; Tue, 27 Jun 2023 08:58:00 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5vl6j030olby55CVp77MpjKdDyltCEq2rp2KkUDAAi2mKPgYHVhBCK15ugc+NK/148XHYa X-Received: by 2002:a05:6a00:c91:b0:677:bdc:cd6b with SMTP id a17-20020a056a000c9100b006770bdccd6bmr6830283pfv.19.1687881480132; Tue, 27 Jun 2023 08:58:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687881480; cv=none; d=google.com; s=arc-20160816; b=PJCv5INg7xzFI3eoB31uVo/BZT7ANb/LEK4iP2phjbPW6lDKNYePcis4wBWmfYVJJb VaRX2w5FxELmUCMPlwg9xZYpe4CpKz4PKiXGHC9i7ioHSh4qEN+dkwwlrsbdnh+ud2V0 v3e4euLAWIgyKHZ3dQCLaZQwNGn4cuEW4Sp+/a3BAnuOroO8A/5YEg5CS9EXkMxsKonP enp8ObarUj7JxqudnvyDZpBcKL5K7ZgAxYiJMfZiQbtCgD8TXVzu8C80JzV1dKcMgCI0 qJrovrwTV8Z6vzDqnOMbocwk3BJ2VdYOA1J7YXVVJbY78unWhrrfE3VSe44VUv5OrumW GGkg== 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-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=J99gX9nEpJzNqhw6eDsQhFvsL/2DqRGHUOKZr0Ry84s=; fh=ruQKp9YDU0glxA78uma90lmBiHfr9e4lBXtkgAQXjFA=; b=qNjAp7MCytVjiJoEb+hFP+FwE0tbHxiIHLH/6zgIWu1fzy+9ZTSi/sA46Id0P5bDqA hwhoTwcCHXQW7oFHNqh+n3dnDrwJE871Cm8tB0CYzXNkyi1Cw0y1IEmkCeAYzOmj4gzS TGbltp+UsnDNTlCBdz6uu/wVE9Gn97o68t4Fc/nzQAZ9mBTlzKCTXz2S1XLgHGSF+o/0 dgcU7a5o3AhJT79vgHbdNdfwW/E+mr3LdTIMzVIUGsg+fCJzfGm523+iWcWahY4Pevon YpvOEx8jyCDdJCzumAr0dgPp0Jg1gbBqtqoFqu0E1SUfVn9+X1uplpynxY3lXmsJaFH7 55UQ== 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 o1-20020a056a0015c100b006662fba14a9si7447606pfu.73.2023.06.27.08.57.47; Tue, 27 Jun 2023 08:58:00 -0700 (PDT) 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 S229578AbjF0PpB (ORCPT + 99 others); Tue, 27 Jun 2023 11:45:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53810 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231268AbjF0Por (ORCPT ); Tue, 27 Jun 2023 11:44:47 -0400 Received: from Chamillionaire.breakpoint.cc (Chamillionaire.breakpoint.cc [IPv6:2a0a:51c0:0:237:300::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C34E4E68; Tue, 27 Jun 2023 08:44:45 -0700 (PDT) Received: from fw by Chamillionaire.breakpoint.cc with local (Exim 4.92) (envelope-from ) id 1qEArv-00056u-Ur; Tue, 27 Jun 2023 17:44:39 +0200 Date: Tue, 27 Jun 2023 17:44:39 +0200 From: Florian Westphal To: Toke =?iso-8859-15?Q?H=F8iland-J=F8rgensen?= Cc: Daniel Xu , bpf@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, coreteam@netfilter.org, netfilter-devel@vger.kernel.org, fw@strlen.de, daniel@iogearbox.net, dsahern@kernel.org Subject: Re: [PATCH bpf-next 0/7] Support defragmenting IPv(4|6) packets in BPF Message-ID: <20230627154439.GA18285@breakpoint.cc> References: <874jmthtiu.fsf@toke.dk> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <874jmthtiu.fsf@toke.dk> 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,T_SCC_BODY_TEXT_LINE 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 Toke H?iland-J?rgensen wrote: > > The basic idea is we bump a refcnt on the netfilter defrag module and > > then run the bpf prog after the defrag module runs. This allows bpf > > progs to transparently see full, reassembled packets. The nice thing > > about this is that progs don't have to carry around logic to detect > > fragments. > > One high-level comment after glancing through the series: Instead of > allocating a flag specifically for the defrag module, why not support > loading (and holding) arbitrary netfilter modules in the UAPI? How would that work/look like? defrag (and conntrack) need special handling because loading these modules has no effect on the datapath. Traditionally, yes, loading was enough, but now with netns being ubiquitous we don't want these to get enabled unless needed. Ignoring bpf, this happens when user adds nftables/iptables rules that check for conntrack state, use some form of NAT or use e.g. tproxy. For bpf a flag during link attachment seemed like the best way to go. At the moment I only see two flags for this, namely "need defrag" and "need conntrack". For conntrack, we MIGHT be able to not need a flag but maybe verifier could "guess" based on kfuncs used. But for defrag, I don't think its good to add a dummy do-nothing kfunc just for expressing the dependency on bpf prog side.