Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp6703711rdb; Fri, 15 Dec 2023 06:17:35 -0800 (PST) X-Google-Smtp-Source: AGHT+IEBJXUy0AgMKsTtJG6N+VXQBN/jkq9mpD0K5BdMAgtHCixjyVITu1h/lO+4Cx7Gvdx5O8Qr X-Received: by 2002:a17:902:ecc7:b0:1d0:b1f0:fdb with SMTP id a7-20020a170902ecc700b001d0b1f00fdbmr6255658plh.46.1702649855162; Fri, 15 Dec 2023 06:17:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702649855; cv=none; d=google.com; s=arc-20160816; b=Xxuid/Q74qzy0/Jeh9T3k4H++JHzVw84uvXPyM5lnwhO0iZKEti6VYhIQlqJvZPkpO KRSC+gR1aRvAi1k9OlbU12hcnU4rx65TNWA58bYKQmYXkG10lJJkV3SZdcXg4MOAMJgp MbbOTIPC1TTBnpSACMwJQbZBTf4hnjmauRj7ibyLn15fwylv7APFnVbsr06uxJrT24Ky OdACHcbh64SoqjqqQ3npjTYIjYD9xrwPfaTFw0ewKY19/y5WVJa0ufFAPEgaPv9TAg07 Y1NqbZzQVytn0T8BLcIvQEMqeefC4JJr5LByDlp1+h0Kzm9AcazDC+O/Pxl+wVW82JqI 3LHA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=user-agent:in-reply-to:content-disposition:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:references :message-id:subject:cc:to:from:date; bh=MQWsOx2T2zSnzpIec7WbA2/cGyIKUcABdjYRAESmf+4=; fh=U0t+ZY+jo+J1zjdh5z2waJB2uW0lU7nPptatOtTtJpI=; b=sV0J+tHJAPDLTmhZYEfVxU6VM1FIZEe6TMyUqLFABu9QdBfz0Bu7va8X0/yKmGYyeO JPbk06t9isD+US2V/oH83XX0UMxDbDb7ycVr1JoSDb2obmmWGXGDQxY/SFaTve/ophtp PyIdxv45Itf9fTQ68L98nXBPQuDtaZI4P6r6/sGbgjpcWgh8HWdFIZbuWqUAZJvPINSo /D/8hKmj1FT2M6l3Rj62h3G7kTbFBTZ8OysKMzypgHxDItMAhm/EDhb9fyG7GdQ/oMSO s7oYlSl3lgLJYlzlng3VSa3kTIh438jPNerdn6u5Gpdldpposp+yJsV+ikH4xwL2Oxsa iKlA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-1097-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-1097-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id n11-20020a170902e54b00b001cff62f4575si5782484plf.370.2023.12.15.06.17.34 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Dec 2023 06:17:35 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-1097-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-1097-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-1097-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id D24FF286144 for ; Fri, 15 Dec 2023 14:17:34 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C0D0730344; Fri, 15 Dec 2023 14:17:20 +0000 (UTC) X-Original-To: linux-kernel@vger.kernel.org Received: from Chamillionaire.breakpoint.cc (Chamillionaire.breakpoint.cc [91.216.245.30]) (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 BC88730CE1; Fri, 15 Dec 2023 14:17:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=strlen.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=strlen.de Received: from fw by Chamillionaire.breakpoint.cc with local (Exim 4.92) (envelope-from ) id 1rE904-0005oD-7W; Fri, 15 Dec 2023 15:17:12 +0100 Date: Fri, 15 Dec 2023 15:17:12 +0100 From: Florian Westphal To: "D. Wythe" Cc: pablo@netfilter.org, 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 v1 1/2] netfilter: bpf: support prog update Message-ID: <20231215141712.GA17065@breakpoint.cc> References: <1702609653-45835-1-git-send-email-alibuda@linux.alibaba.com> <1702609653-45835-2-git-send-email-alibuda@linux.alibaba.com> 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=us-ascii Content-Disposition: inline In-Reply-To: <1702609653-45835-2-git-send-email-alibuda@linux.alibaba.com> User-Agent: Mutt/1.10.1 (2018-07-13) D. Wythe wrote: > const struct nf_defrag_hook *defrag_hook; > + const struct bpf_prog __rcu *nf_prog; Hmm, why do we need this pointer? Can't you just re-use bpf_nf_link->link.prog? > + rcu_assign_pointer(nf_link->nf_prog, new_prog); > + old_prog = xchg(&link->prog, new_prog); This looks redundant, I think you can remove the nf_prog pointer again. Rest LGTM.