Received: by 2002:a05:7412:cfc7:b0:fc:a2b0:25d7 with SMTP id by7csp1571085rdb; Mon, 19 Feb 2024 23:25:44 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVLeeYxWnqxKbzIOf1EFi/WSa6nuubjq75TPdfbccy0a3LQvyPY0FaJSgF1/HilbmYMi5pZF4e93wfa1QnlUFVkgkQdU2K8nFpjE3hdWw== X-Google-Smtp-Source: AGHT+IGT3eCsc3cpkEVf/pBeO+u5lRKMQLR2VY+t8m6Xs2DPMBZSAy7XJ2Geb+065cBnTBcUJLdj X-Received: by 2002:a17:903:32d1:b0:1db:d2f7:6884 with SMTP id i17-20020a17090332d100b001dbd2f76884mr7311262plr.25.1708413943782; Mon, 19 Feb 2024 23:25:43 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708413943; cv=pass; d=google.com; s=arc-20160816; b=Bj55cu3D5eZTeUtVTKRIxG+IN3biKPMdZmamP7cJDcoV8KwQvV9WobNdLcOTWTQ8bX yLhF4Oo1wzdX4EDO7eVnpCwFS2/UZNSfSXdG7uyughAgTVh+Not/pR0Eo3TDY2BAKx6b kF0kl9Ul7czf4K6WsyJGAeVyuPH7U3TWJGPSSwla5CK1x5vkF0hvoNl98hdW2lPvvODI gR6WO2s6F+PudAjCIBJNLI8BGMAMz0Xz46fPdkTx2G6AXfAmqYIkGLirDfLc5Z8C59dk AIATDmLEJ7Jw2YW8/74JjNDgo+ldOmmuqU6a3qkZfASvz/I3V6NvnsX6kdtyTddO7XKB C2Bg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=0d8HScRQIx6W+ruLqSv3M+jMj6lFLshZVIqZSQ4AXqQ=; fh=bMXesnD6Ehjz/bVzgKIh6txQ8WCCg2N82LwniwUFp8c=; b=N9kDAz22DQ2FyMUPV/YncY55r+wxeDK/K1aJLbQ61/oLclZq6TD631oFaGMyYvxVf1 LOzcoIuKmWMNBeDPYhIsrTMwSyRa6BrNZaL6WsEiQ9mhXnNun5Y0Zgtx0AFEszrGOcma v1ZBrpy2Hn+WhA5aGBkI790R+vFXCAGg8eNiLktcERUKtXiMaYzmtxlYzgoofNGdj4yL NfGbXetJS3SorNHxj2rBSrnXqNnn5cvm+WySDntXGppg3pWhE1XqTA9s8Zq3llNmyc0L bBAARY4RUf70iku67dzeGMMqSCTAJf/wVyondNwteHQGALTR6cNVX1TiBvwO8q3YNlRi l6XA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linux.alibaba.com header.s=default header.b=TvXaKTq7; arc=pass (i=1 spf=pass spfdomain=linux.alibaba.com dkim=pass dkdomain=linux.alibaba.com dmarc=pass fromdomain=linux.alibaba.com); spf=pass (google.com: domain of linux-kernel+bounces-72460-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-72460-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.alibaba.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id jv21-20020a170903059500b001db4210203asi5737148plb.351.2024.02.19.23.25.43 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 19 Feb 2024 23:25:43 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-72460-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.alibaba.com header.s=default header.b=TvXaKTq7; arc=pass (i=1 spf=pass spfdomain=linux.alibaba.com dkim=pass dkdomain=linux.alibaba.com dmarc=pass fromdomain=linux.alibaba.com); spf=pass (google.com: domain of linux-kernel+bounces-72460-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-72460-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.alibaba.com 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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 054EEB222E9 for ; Tue, 20 Feb 2024 07:19:37 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A6E155A783; Tue, 20 Feb 2024 07:19:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.alibaba.com header.i=@linux.alibaba.com header.b="TvXaKTq7" Received: from out30-99.freemail.mail.aliyun.com (out30-99.freemail.mail.aliyun.com [115.124.30.99]) (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 29FC05A110; Tue, 20 Feb 2024 07:19:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=115.124.30.99 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708413558; cv=none; b=FYalkARt2uCe46L5Y0GbjKgT4wBtnJIgF2gJFzXdZ6IHMbpRkADc5wKHkphAmerY7Muj7thB9MU7jTY2Ndo0ROuLtROneF5Q5qQ9n2TFk3T3bvJDeooC+Iw3A1u2Jrn5XkQ4e7YALaOYQrgrQ0RZhrjCwk9tKzKgdN5H6q/u57k= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708413558; c=relaxed/simple; bh=S9XetiB1kCGvDGsBJEicmEP9gLUMjlR4V0Egs8d7+co=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=hGkPegf3Kyo2QzK5Xk1YNJDlvHvXSbjfjkd8zpkHxdouR9kCPvVy6NKh18t8PM0IbvskGnUN5ueinZVu2nBTJINHXTRqninuXHb9ev824W29NcRqEcQ2p9Gwmt81DhtQawNtDDBlPlHY8pXXiEwpXJKwT/dy+fFMje2uEWcOthI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.alibaba.com; spf=pass smtp.mailfrom=linux.alibaba.com; dkim=pass (1024-bit key) header.d=linux.alibaba.com header.i=@linux.alibaba.com header.b=TvXaKTq7; arc=none smtp.client-ip=115.124.30.99 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.alibaba.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.alibaba.com DKIM-Signature:v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.alibaba.com; s=default; t=1708413554; h=Message-ID:Date:MIME-Version:Subject:To:From:Content-Type; bh=0d8HScRQIx6W+ruLqSv3M+jMj6lFLshZVIqZSQ4AXqQ=; b=TvXaKTq7eny4+YEHY1Xt+yDME2e2p+wWOoOUCWufEjntpAgHiESPDOSWC/qYxVg6NEDV3pcxw7b7yTBqCgnMzlWD+wR0XgpTYY/BNb+BcUOpAJmWH+Y4h51qLNafAaeU/e/ttgnB3n4uw/UgxCPoj9stpKRz5uMo6AvEJGoDLyk= X-Alimail-AntiSpam:AC=PASS;BC=-1|-1;BR=01201311R551e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=ay29a033018046060;MF=alibuda@linux.alibaba.com;NM=1;PH=DS;RN=14;SR=0;TI=SMTPD_---0W0w1yEa_1708413552; Received: from 30.221.148.206(mailfrom:alibuda@linux.alibaba.com fp:SMTPD_---0W0w1yEa_1708413552) by smtp.aliyun-inc.com; Tue, 20 Feb 2024 15:19:13 +0800 Message-ID: <53654d84-9fe3-4a8d-98ba-ab052df91852@linux.alibaba.com> Date: Tue, 20 Feb 2024 15:19:11 +0800 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [RFC nf-next v5 0/2] netfilter: bpf: support prog update Content-Language: en-US To: Quentin Deslandes , pablo@netfilter.org, kadlec@netfilter.org, fw@strlen.de Cc: 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 References: <1704175877-28298-1-git-send-email-alibuda@linux.alibaba.com> <70114fff-43bd-4e27-9abf-45345624042c@naccy.de> From: "D. Wythe" In-Reply-To: <70114fff-43bd-4e27-9abf-45345624042c@naccy.de> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit On 2/15/24 12:10 AM, 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. > > Thanks, > Quentin Thanks for your testing. I will send  out a formal version soon. Best wishes, D. Wythe