Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp3154932rwb; Mon, 15 Aug 2022 19:34:35 -0700 (PDT) X-Google-Smtp-Source: AA6agR4gmlJCYeYxER2Fzamd8YZ01/ianS7BRrPIyooyJZmH+98f2Nt6n+Dvc5R7t1tiO/9qyS6l X-Received: by 2002:a17:907:c18:b0:731:65f6:1f29 with SMTP id ga24-20020a1709070c1800b0073165f61f29mr11665049ejc.577.1660617275081; Mon, 15 Aug 2022 19:34:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660617275; cv=none; d=google.com; s=arc-20160816; b=XuT8j4+lL7dqbqZnieCvPQLbi/NyN1t8BpAVeglirVc2AzAxrWKYhjkPOfu391TFnh fDUAzGyD4MkXD7VfWj78V1QqqNcBopBeeIYktRaDHiAJna+7ikkZ1MdcLxz8d9nKr87m QPMqgU1dVFRZ2fVmwZED+veN3aTfF5c82FUInA/R86uu1gbNiItiAkQyfnuAKZma1tac +WGaCaBPCLfrPr89M+EKOff/y29wYj/UYiXZwlZ/qk3JGRr5ZDrhcriN2n4OrPsAYuhD tGXEV39YotVDYQyy102emX7MYF3fuA3zb1+Qly4/iXDBuj/FqyuSTVZgIMvTi7i7rm9K 3wKg== 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=D4y3531S2a2ErWm092GlZ8pAhUxuavB8XMZ0rkY/3j8=; b=PKYygQIp+QZcr3TL6TB1oJzkTb9U3cUD9+16zgpwtTvliWDerm4Nqxapy8Irm8n5x2 JMHJZvsnpWYRcSWuzvGce+9WaUFOJC+0/P1ueoSjNfSThKmZftFfr2kth7XobADMIp6Q e23Bq+W9NSA4hx177/7BHoad4psR0jLJucIoQp27n5Uj2zTDubE9mmmt2zeA0sS2rkz2 +ptruFBR8IDSc2KsAxW225RDKpzQTC4sHT4QAfKeUQVUOwkbcDoDr8T8/mVNTHMIlTX+ IeXAPG4AXqEvP3Utpps2WOAwaxBwy4I4TEHxk5N1N0yg96vrzT7wNBbsRxxYppCOxqRW 2ZwA== 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 au16-20020a170907093000b00730699ca113si6973150ejc.43.2022.08.15.19.34.09; Mon, 15 Aug 2022 19:34:35 -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 S229876AbiHPCZx (ORCPT + 99 others); Mon, 15 Aug 2022 22:25:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47320 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232362AbiHPCZV (ORCPT ); Mon, 15 Aug 2022 22:25:21 -0400 Received: from Chamillionaire.breakpoint.cc (Chamillionaire.breakpoint.cc [IPv6:2a0a:51c0:0:12e:520::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2469726924E; Mon, 15 Aug 2022 15:40:36 -0700 (PDT) Received: from fw by Chamillionaire.breakpoint.cc with local (Exim 4.92) (envelope-from ) id 1oNikl-00032W-FD; Tue, 16 Aug 2022 00:40:11 +0200 Date: Tue, 16 Aug 2022 00:40:11 +0200 From: Florian Westphal To: Toke =?iso-8859-15?Q?H=F8iland-J=F8rgensen?= Cc: Daniel Xu , bpf@vger.kernel.org, ast@kernel.org, daniel@iogearbox.net, andrii@kernel.org, memxor@gmail.com, pablo@netfilter.org, fw@strlen.de, netfilter-devel@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH bpf-next 2/3] bpf: Add support for writing to nf_conn:mark Message-ID: <20220815224011.GA9821@breakpoint.cc> References: <871qth87r1.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: <871qth87r1.fsf@toke.dk> User-Agent: Mutt/1.10.1 (2018-07-13) X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_LOW, 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: > > Support direct writes to nf_conn:mark from TC and XDP prog types. This > > is useful when applications want to store per-connection metadata. This > > is also particularly useful for applications that run both bpf and > > iptables/nftables because the latter can trivially access this metadata. > > > > One example use case would be if a bpf prog is responsible for advanced > > packet classification and iptables/nftables is later used for routing > > due to pre-existing/legacy code. > > > > Signed-off-by: Daniel Xu > > Didn't we agree the last time around that all field access should be > using helper kfuncs instead of allowing direct writes to struct nf_conn? I don't see why ct->mark needs special handling. It might be possible we need to change accesses on nf/tc side to use READ/WRITE_ONCE though.