Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp6415798rdb; Thu, 14 Dec 2023 19:08:08 -0800 (PST) X-Google-Smtp-Source: AGHT+IHCEYHwxjpc/7KelAVHPEyvlmQlQBYX1RfzCOR/5vWJ9LxGyBymW0HJyBjd/4c0bSXJWiWO X-Received: by 2002:a05:6870:35cf:b0:1fb:205d:756b with SMTP id c15-20020a05687035cf00b001fb205d756bmr14050622oak.19.1702609687595; Thu, 14 Dec 2023 19:08:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702609687; cv=none; d=google.com; s=arc-20160816; b=aL/pB1cd0CQ7zI+wgUoQueGq6og4Ulv9t3qiHuHaCyyxemLBYQJCCsCzsKcD0m+Z8E 2QyfhxhCqV6jNvqnkuY7kR/MorlOmLx1ar4wJrH9Tg7bBDJsz+IINTGwxtFGNNMmm9ua Mglz3H5i9bqnyvt7caSTDLIM3z2r/Lyo+Wp7x1Pu/zfYUsHOfeZgdpByRPEp52muaLb+ QOYHIqAyw+f6P39QuV/6LJqS9A2wzx0dHuU6XAgARUELEr5Qn84PT+svWfn0IaTbDJ1/ SsAtgNjruxdcNEBY1/bRhLR+GVQgGbK90XW/TltP6/kiXYwF9gzdORjnDiHFO9WkOCAO 9eFg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-subscribe:list-id:precedence:message-id:date :subject:cc:to:from; bh=yHsbK3CIW17C0bcFsPTOVWLW45bCew61RH53fnv37ow=; fh=0j9hEtKEGSulx/lgeQcpDl+4ujiVFr5DCPGOZLIRfAc=; b=JehyHmAjXdc7AtZnFnTKmSbLI2hq4KECR5QOQnIp0aQa8rPwv23xhvuF5PVVbucbjX p5lAF48+d3v1K6fvXcsEyHjf77kocZ7mkta3DU9hFU09MH8BH6DV/MzC+5+L2z6bC9HS U0mSxAEggAygOMp6+vx+BbdymvpcGw0MYYNfdVadVe5CjQ14quNIDcW1oZPu3xqqbhAv IytQ8tzNjE85sAJueul5RSxatA8MZUQ1AwqA1L1Z7Yl94HyC8hmcssJOzEfo1IW+in5l WQ9Xs8JEI99oX9Jr0Z5/A0ouy5HGhB1TL1AJb6XJCB7amACkLO6fa4BvjiE6F27fdLQN KkBQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-390-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-390-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=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 c15-20020a634e0f000000b005c6075f8a31si12014565pgb.153.2023.12.14.19.08.07 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Dec 2023 19:08:07 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-390-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; spf=pass (google.com: domain of linux-kernel+bounces-390-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-390-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=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 79A5EB20A55 for ; Fri, 15 Dec 2023 03:08:06 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5611E4693; Fri, 15 Dec 2023 03:07:51 +0000 (UTC) X-Original-To: linux-kernel@vger.kernel.org Received: from out30-119.freemail.mail.aliyun.com (out30-119.freemail.mail.aliyun.com [115.124.30.119]) (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 2D5CDCA66; Fri, 15 Dec 2023 03:07:47 +0000 (UTC) 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 X-Alimail-AntiSpam:AC=PASS;BC=-1|-1;BR=01201311R191e4;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=13;SR=0;TI=SMTPD_---0VyWIqYy_1702609653; Received: from j66a10360.sqa.eu95.tbsite.net(mailfrom:alibuda@linux.alibaba.com fp:SMTPD_---0VyWIqYy_1702609653) by smtp.aliyun-inc.com; Fri, 15 Dec 2023 11:07:39 +0800 From: "D. Wythe" To: 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 Subject: [RFC nf-next v1 0/2] netfilter: bpf: support prog update Date: Fri, 15 Dec 2023 11:07:31 +0800 Message-Id: <1702609653-45835-1-git-send-email-alibuda@linux.alibaba.com> X-Mailer: git-send-email 1.8.3.1 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: 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. D. Wythe (2): netfilter: bpf: support prog update selftests/bpf: Add netfilter link prog update test net/netfilter/nf_bpf_link.c | 68 ++++++++++++++---- .../bpf/prog_tests/netfilter_link_update_prog.c | 83 ++++++++++++++++++++++ .../bpf/progs/test_netfilter_link_update_prog.c | 24 +++++++ 3 files changed, 160 insertions(+), 15 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 -- 1.8.3.1