Received: by 2002:a05:7412:2a91:b0:fc:a2b0:25d7 with SMTP id u17csp695638rdh; Wed, 14 Feb 2024 08:43:01 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWmzLaMFs8VFtIIJdLQQa7pCwEs7raqB8/k3q5D66bkkGGLb7QnkwMtQodSZJol2yzzsWtIr8onqoQ6ifSKpDraIGQSYJuMPiu6UUNStg== X-Google-Smtp-Source: AGHT+IF4Gb3PZR25/tmTOMaxL+nNfRW5p5jutJsW4ETmnyJJBl9wM6RmsH+HR7cq20IU0rBtNNl2 X-Received: by 2002:a05:622a:1646:b0:42c:123b:1303 with SMTP id y6-20020a05622a164600b0042c123b1303mr3330821qtj.24.1707928981251; Wed, 14 Feb 2024 08:43:01 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707928981; cv=pass; d=google.com; s=arc-20160816; b=k7yIpZj33vhhyAHcFkAfJWRLsTXVgtPVVF3rfcEZwH3BKF0bKbuzUoez3gRB1Rmxc0 7ue6nC8aBk06a/bFLWhAjkjiKuvcg/POsGu1AdHEIi1IrPp0ABSFOgkUY6APMvEaGIJ8 09OtOS2msmpGuPqpKrjnGdo1Y0UqaV2gGUD7lapUFXkwEdePS8AqH80OixfNJpgt5EPg JioQ71pYG3TN3NjewdO5l/pm9N7i2E5pJzQtKyyYpQAsjNohf74jp0u4WmwuHHvMjViC Y9X8NMoXkqOi0OsyVZEHzoy3tz1HZAwKYvAMzB/CwLEJheCWjccP8oQgVaRdHgaQlMj2 D/yw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date; bh=t0uTn5hgizbTbmYsp3r2Qn2owBOsqwGDJWGTEF+I+5w=; fh=SLNSyIX4M32OAOhUCuFbWSEppQbyvYpSbcU+w1QEs0I=; b=ul5hI+VoNtv3/ZlpIviKzijUDOYS4ig6fttxgOgN3eWSgaf3bBaxdmzf2Trxd3/hg3 Fi4BBb6skw3Q2PZIozc5rtWlvLFSQoQnE9zKg0ZAMHbXpV/uMX4bqhGMAdy6LE+mnQ7+ uwvDknNwK6odHYxuop/iSWjlCBUE5q2eO5NqwD2fYRkD42vyci19V3WNfIubn20JmBHx SJ3a0wHdsEZwPTX5ed49y1LHZYjll5hX612hyft8tIF0QLv48bcdpKfp5RAZ9aNOVutc NbrFOP4E6ye5ibPaqcNLzk7lxVdL1hCbyq0IVoo5Sw7nxKhsRzgigQDJCAhdK5ZPYaQy F7Aw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=gnumonks.org); spf=pass (google.com: domain of linux-kernel+bounces-65568-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-65568-linux.lists.archive=gmail.com@vger.kernel.org" X-Forwarded-Encrypted: i=2; AJvYcCVyMGAIT9F/795N1yv852C/WsOqqM2Y00GtdC8ejPLAIC5HG3zsEuWKQ/hB7gfZC5/vbgZNhLqLQrE+MGaXbR+2S4XphOvYh2rYLldj+g== Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id u18-20020ac858d2000000b0042c7bb6f68fsi6410290qta.683.2024.02.14.08.43.01 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 14 Feb 2024 08:43:01 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-65568-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=gnumonks.org); spf=pass (google.com: domain of linux-kernel+bounces-65568-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-65568-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id DE95B1C293D5 for ; Wed, 14 Feb 2024 16:41:53 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 2C9806087D; Wed, 14 Feb 2024 16:41:30 +0000 (UTC) Received: from ganesha.gnumonks.org (ganesha.gnumonks.org [213.95.27.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DB49A5DF03; Wed, 14 Feb 2024 16:41:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=213.95.27.120 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707928889; cv=none; b=P9/A7TSAsPlGrnR7d6PzQYTeyrO0Cok58yNh+d8y//ZwGhwDocKMQY49OX2mGNt7WfnhaWUsDh78WBqdFKYmXieGClpJgA5k5Xea4czwJUJd1QGjsUuv0r36LC15HAqimWLLaNIN44a8OlQDMc01JiUF8jYBLlM80HXdlX6FLVM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707928889; c=relaxed/simple; bh=sKZqb4SpRZtsvwefnHUf/iXBlUPQk87OfSTdN84K9g4=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=PfwjMKZEfvUuXozuBBdZkIkjm5KyvvyjnO+EddJbTaTKNzgnYcyC54ldljBDG+BdTXDPGvpXKF/bIyghvPOWWspRipvuaspwVe+q8p/z+Ws9wp99AE6wOo80roeS8W/QR9sGXE45i0JaDuERpwzYBi5XzRqedDSNkcRCsl5VduI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=netfilter.org; spf=pass smtp.mailfrom=gnumonks.org; arc=none smtp.client-ip=213.95.27.120 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=netfilter.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gnumonks.org Received: from [78.30.41.52] (port=34352 helo=gnumonks.org) by ganesha.gnumonks.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1raIJy-001MeG-LF; Wed, 14 Feb 2024 17:41:20 +0100 Date: Wed, 14 Feb 2024 17:41:17 +0100 From: Pablo Neira Ayuso To: Quentin Deslandes Cc: "D. Wythe" , kadlec@netfilter.org, fw@strlen.de, bpf@vger.kernel.org, linux-kernel@vger.kernel.org, netdev@vger.kernel.org, coreteam@netfilter.org, netfilter-devel@vger.kernel.org, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, ast@kernel.org Subject: Re: [RFC nf-next v5 0/2] netfilter: bpf: support prog update Message-ID: References: <1704175877-28298-1-git-send-email-alibuda@linux.alibaba.com> <70114fff-43bd-4e27-9abf-45345624042c@naccy.de> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <70114fff-43bd-4e27-9abf-45345624042c@naccy.de> X-Spam-Score: -1.7 (-) On Wed, Feb 14, 2024 at 05:10:46PM +0100, Quentin Deslandes wrote: > On 2024-01-02 07:11, D. Wythe wrote: > > From: "D. Wythe" > > > > This patches attempt to implements updating of progs within > > bpf netfilter link, allowing user update their ebpf netfilter > > prog in hot update manner. > > > > Besides, a corresponding test case has been added to verify > > whether the update works. > > -- > > v1: > > 1. remove unnecessary context, access the prog directly via rcu. > > 2. remove synchronize_rcu(), dealloc the nf_link via kfree_rcu. > > 3. check the dead flag during the update. > > -- > > v1->v2: > > 1. remove unnecessary nf_prog, accessing nf_link->link.prog in direct. > > -- > > v2->v3: > > 1. access nf_link->link.prog via rcu_dereference_raw to avoid warning. > > -- > > v3->v4: > > 1. remove mutex for link update, as it is unnecessary and can be replaced > > by atomic operations. > > -- > > v4->v5: > > 1. fix error retval check on cmpxhcg > > > > D. Wythe (2): > > netfilter: bpf: support prog update > > selftests/bpf: Add netfilter link prog update test > > > > net/netfilter/nf_bpf_link.c | 50 ++++++++----- > > .../bpf/prog_tests/netfilter_link_update_prog.c | 83 ++++++++++++++++++++++ > > .../bpf/progs/test_netfilter_link_update_prog.c | 24 +++++++ > > 3 files changed, 141 insertions(+), 16 deletions(-) > > create mode 100644 tools/testing/selftests/bpf/prog_tests/netfilter_link_update_prog.c > > create mode 100644 tools/testing/selftests/bpf/progs/test_netfilter_link_update_prog.c > > > > It seems this patch has been forgotten, hopefully this answer > will give it more visibility. > > I've applied this change on 6.8.0-rc4 and tested BPF_LINK_UPDATE > with bpfilter and everything seems alright. Just post it without RFC tag.