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 8F52CC00140 for ; Tue, 16 Aug 2022 02:27:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240703AbiHPC06 (ORCPT ); Mon, 15 Aug 2022 22:26:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48538 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239614AbiHPC0j (ORCPT ); Mon, 15 Aug 2022 22:26:39 -0400 Received: from out4-smtp.messagingengine.com (out4-smtp.messagingengine.com [66.111.4.28]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4EE4B77E8E; Mon, 15 Aug 2022 15:41:29 -0700 (PDT) Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id 7EC775C0059; Mon, 15 Aug 2022 18:41:26 -0400 (EDT) Received: from imap42 ([10.202.2.92]) by compute2.internal (MEProxy); Mon, 15 Aug 2022 18:41:26 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dxuuu.xyz; h=cc :cc:content-transfer-encoding:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to; s=fm3; t=1660603286; x= 1660689686; bh=Fx+3U6i5N7hG3oTIANTunyRAkIo4mSSiHjyXtVm84Ww=; b=r O2ByjhOaliy15VKrYUAOb59tMk4tfsG0KMeBH36pG6nfgU79EjRKNu7wRoqlA+/N X04gBu90q4oUvkCG4eidfga//uCn8speHWZIAsVArvovtCwK2kXAE5C16ZMS8HTf Sb39nr31dTzCPuEDGCQZroD07Kg93tuKfYYf27lJeWa9oJasnfB4OsK5HFEwl4K+ zsgFnAWQqhpS9XNJNP4m633z89Wp7E5w9ozxGsmiET/uvjkoTVlMN0xifWV33ynf t4MExHocuLv46PStulWP1A17B2qlY+HlGV1ydRgGUsVypPlEpxalIjsmr4dnzGf0 6TPenU6XSrqXLEcOEgntA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t=1660603286; x= 1660689686; bh=Fx+3U6i5N7hG3oTIANTunyRAkIo4mSSiHjyXtVm84Ww=; b=U KkFif4XKD3lSqv0ZUyQ+rWQ/rSp1PMZmfYXZuw4Jp73eerNuaDoassLYoSJkwsO8 fF/DBo+qakO1yxVDK9cP4bNfOJF0mLT9ZqvbVOqSX1/pnSJo1fMGXuWCCR9vLYjo ZSDPzywO1mPabsHdAfuqD7Fr8CLpx8xf+nao7qZQ/zvvbF5vfx0jtB6t2d/OE+fp 1KvRFP1I6UUurxZm2pACjTauXX112cyrf0crqc5W9sI1jgXPIpaGq6icIdoJBs5t tpLO/AO/vU4eZH9BN3slRJ+vNzZsz/OyANrfDWv5lzfCO0x/l6QaPx1DJCee28oa rk85WYKRYskLulihCCu7A== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvfedrvdehfedgudegucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne gfrhhlucfvnfffucdlvdefmdenucfjughrpefofgggkfgjfhffhffvvefutgfgsehtqher tderreejnecuhfhrohhmpedfffgrnhhivghlucgiuhdfuceougiguhesugiguhhuuhdrgi ihiieqnecuggftrfgrthhtvghrnhepfeetudetgeeikeejgefgffdvhefgveehiedtuedu jedugedtledvtdduiedtkeffnecuffhomhgrihhnpehkvghrnhgvlhdrohhrghenucevlh hushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegugihusegugihu uhhurdighiii X-ME-Proxy: Feedback-ID: i6a694271:Fastmail Received: by mailuser.nyi.internal (Postfix, from userid 501) id B1424BC0075; Mon, 15 Aug 2022 18:41:25 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.7.0-alpha0-841-g7899e99a45-fm-20220811.002-g7899e99a Mime-Version: 1.0 Message-Id: <7556b140-7d73-4411-86c5-f827cfb9f2ae@www.fastmail.com> In-Reply-To: <871qth87r1.fsf@toke.dk> References: <871qth87r1.fsf@toke.dk> Date: Mon, 15 Aug 2022 16:41:11 -0600 From: "Daniel Xu" To: =?UTF-8?Q?Toke_H=C3=B8iland-J=C3=B8rgensen?= , "bpf@vger.kernel.org" , "Alexei Starovoitov" , "Daniel Borkmann" , "Andrii Nakryiko" , "Kumar Kartikeya Dwivedi" Cc: 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 Content-Type: text/plain;charset=utf-8 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Toke, On Mon, Aug 15, 2022, at 4:25 PM, Toke H=C3=B8iland-J=C3=B8rgensen wrote: > Daniel Xu writes: > >> Support direct writes to nf_conn:mark from TC and XDP prog types. This >> is useful when applications want to store per-connection metadata. Th= is >> is also particularly useful for applications that run both bpf and >> iptables/nftables because the latter can trivially access this metada= ta. >> >> One example use case would be if a bpf prog is responsible for advanc= ed >> 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_con= n? Sorry, I was not aware of those discussions. Do you have a link handy? I received the suggestion to enable direct writes here: https://lore.kernel.org/bpf/CAP01T74aWUW-iyPCV_VfASO6YqfAZmnkYQMN2B4L8ng= MMgnAcw@mail.gmail.com/ . Thanks, Daniel