Received: by 2002:a05:7412:b112:b0:f9:3106:f1c0 with SMTP id az18csp24350rdb; Sun, 17 Dec 2023 19:07:25 -0800 (PST) X-Google-Smtp-Source: AGHT+IGdPPMX1DImMVgumtFkHnzlZ4q6SBqP9gdNXArjcWnU8K8YC3LWpb+vCIOrvseYwi793/3k X-Received: by 2002:a81:77c6:0:b0:5d7:1941:a9a with SMTP id s189-20020a8177c6000000b005d719410a9amr11874522ywc.53.1702868845665; Sun, 17 Dec 2023 19:07:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702868845; cv=none; d=google.com; s=arc-20160816; b=h9n4sICw0KD47fKiEyuwFBcTVnIzQmmd+/iE0Fewnj0owop3qXHD8IgEl5rbSSXVEb lBahCmgILilFozvzIc/pc74dGoG2c+BlzU7g7Ybur/xA6nnMuLFUu6QkGIBofOuwRfVg lnQBxMuky/BOuvccwV0gta53035oSdUkiLEqYbA1lsLy+7xvA3fdfpcPykbDsdgU9Gs1 Lkm1RKnt2tFUN5nBGkjAB1YASbRJgJput/Bc3v/G2IgBMXHXnB5Gg54Mx6Lk8m4NssMz Obl9pa1JWESgSmnIJpaxFdVOKChg0cIj3mCI7AW4YoB3IeCPE9v/BlCurrcGhlSQW5HV VfgA== ARC-Message-Signature: i=1; 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; bh=dlFzlYq1fF5IFwuqidL1p9cIErcUwIa+CDOgKvdig+I=; fh=K+YJW+n5sEW7522VOsPmu39bzfZFRXf7euV66+tgX58=; b=o6wq0Ho78zkIbkgTddpR6eeV6x6BqpA0StuVBC6M8/HaNRmNj8l3LO64PKjqhlg69a 2HZZxwEALCVG8nCPTWz9PBlgjGoISYuZ4USyGaglcYHTiLx0pLMcyOqCyXiHYh8DQRPx 2GAMvOe3mPhB6AlelhIrnkoe5o6wYBL2+bqhQP1ngN/s+1lEdPRXwIu6gHNGAqpQRjtc UHN9qt7qC5aFC6DfzS7uEKpyyAi/Fe0ofDusEBDaeHlkuMSYM54iM1vb7G/meB9XpTsQ twuvHg+Bfm3TQBjxcfHhMlvX+ieNm5yoIPazLCC2cCXhKSuMoFbevu34DJA8a26a7m9i ABqg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-2961-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-2961-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id n2-20020ac86742000000b0042547e32139si21576926qtp.33.2023.12.17.19.07.25 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 17 Dec 2023 19:07:25 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-2961-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; spf=pass (google.com: domain of linux-kernel+bounces-2961-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-2961-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 6EC1C1C211A9 for ; Mon, 18 Dec 2023 03:07:25 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 2D275440E; Mon, 18 Dec 2023 03:07:12 +0000 (UTC) X-Original-To: linux-kernel@vger.kernel.org Received: from out30-98.freemail.mail.aliyun.com (out30-98.freemail.mail.aliyun.com [115.124.30.98]) (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 DFE0F3C0D; Mon, 18 Dec 2023 03:07:07 +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=01201311R571e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=ay29a033018046051;MF=alibuda@linux.alibaba.com;NM=1;PH=DS;RN=13;SR=0;TI=SMTPD_---0Vydujm._1702868817; Received: from 30.221.148.252(mailfrom:alibuda@linux.alibaba.com fp:SMTPD_---0Vydujm._1702868817) by smtp.aliyun-inc.com; Mon, 18 Dec 2023 11:06:59 +0800 Message-ID: <82c74693-db42-2491-868e-b6cb1cead4ec@linux.alibaba.com> Date: Mon, 18 Dec 2023 11:06:56 +0800 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.15.1 Subject: Re: [RFC nf-next v1 1/2] netfilter: bpf: support prog update Content-Language: en-US To: Florian Westphal Cc: pablo@netfilter.org, kadlec@netfilter.org, 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: <1702609653-45835-1-git-send-email-alibuda@linux.alibaba.com> <1702609653-45835-2-git-send-email-alibuda@linux.alibaba.com> <20231215141712.GA17065@breakpoint.cc> From: "D. Wythe" In-Reply-To: <20231215141712.GA17065@breakpoint.cc> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 12/15/23 10:17 PM, Florian Westphal wrote: > 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? Accessing nf_link->link.prog directly is a bit strange because it is not marked as __rcu, which will generate a compilation warning, thus we need to perform a type conversion. But I do not intend to insist on it. I will remove it in the next version. Best wishes, D. Wythe > >> + 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.