From patchwork Fri Aug 19 23:23:32 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Xu X-Patchwork-Id: 12949391 X-Patchwork-Delegate: bpf@iogearbox.net Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4EA0DC32792 for ; Fri, 19 Aug 2022 23:24:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244140AbiHSXX6 (ORCPT ); Fri, 19 Aug 2022 19:23:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53826 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244141AbiHSXXz (ORCPT ); Fri, 19 Aug 2022 19:23:55 -0400 Received: from wout5-smtp.messagingengine.com (wout5-smtp.messagingengine.com [64.147.123.21]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 757572CCB3; Fri, 19 Aug 2022 16:23:54 -0700 (PDT) Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.west.internal (Postfix) with ESMTP id C39D2320069B; Fri, 19 Aug 2022 19:23:52 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Fri, 19 Aug 2022 19:23:53 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dxuuu.xyz; h=cc :cc:content-transfer-encoding:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:sender :subject:subject:to:to; s=fm3; t=1660951432; x=1661037832; bh=FD LEgZ53CJkDbzaxSWQi0+Z8DuQ2sCXFgzw84z6QC2g=; b=I7M/Dbu2GJQ4twQR1u 1z57XmoAxtEAIv5i4nJQw3IqraUb+YV7g9p1RTXDNoO8YmVLj4Tyqb7ujvZJmkjF ezu8wlxKDjb/X5QkGbsu8riJNDPIYZz0EgNEu45m/esqxhWbKJAIPiKKOIewRre/ XnkKBnoClwhc1YMxadGYRQ/IiOd2GZj+tdjI5bFrcGIyiEskuIVAw4FWjfkCCMGJ RlKWBS7NfL38Q+ehboIJ7U5BykGbPxZvGcbgLeZec3j7XmCdOirLTRmfqQlHipDX 8AtUv8pF9vOWirA4jaYFUPYqpTcpZOF9uwk+tefSv0/uKlgpC5dG7Fl9Zz+aPmUx CiiA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm1; t=1660951432; x=1661037832; bh=FDLEgZ53CJkDb zaxSWQi0+Z8DuQ2sCXFgzw84z6QC2g=; b=5B6B9Yf9EKP0Vgs2nFxKPirRksYN6 kFglveQt2XN0NzTYYP0YGJHlQ95oWAQfTzxWrZM7tQXAiPs5+/2y/TL8ITx5v7te spwkdKtP0ZfYf07bPVpMvz42M/q3FFVAHFqtYksje4hNCMFplYfUf1oP1iUSG8TW yX2rI2S62HU7kAv0tYzPrYwfO9wAu+rnXuxwnv0Y3c/hcox/n+hBxveX5ROAZzca BzwbC05TN8a1yr6gs7m8UMFYcJZSQrtXyA7Zijkrm9jdo1wRc0EjufwkfzA9uvyC mO1aNMdFGi0lr/yBoR4xGwTKCYhMwwUfGxKztUBaYFDRN0BT4CmtODuRg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvfedrvdeivddgvdduucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucgfrhhlucfvnfffucdljedtmdenucfjughrpefhvf evufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpeffrghnihgvlhcuighuuceo ugiguhesugiguhhuuhdrgiihiieqnecuggftrfgrthhtvghrnhepgfefgfegjefhudeike dvueetffelieefuedvhfehjeeljeejkefgffeghfdttdetnecuvehluhhsthgvrhfuihii vgeptdenucfrrghrrghmpehmrghilhhfrhhomhepugiguhesugiguhhuuhdrgiihii X-ME-Proxy: Feedback-ID: i6a694271:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 19 Aug 2022 19:23:51 -0400 (EDT) From: Daniel Xu To: bpf@vger.kernel.org, ast@kernel.org, daniel@iogearbox.net, andrii@kernel.org, memxor@gmail.com Cc: Daniel Xu , pablo@netfilter.org, fw@strlen.de, toke@kernel.org, martin.lau@linux.dev, netfilter-devel@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH bpf-next v3 3/5] bpf: Use 0 instead of NOT_INIT for btf_struct_access() writes Date: Fri, 19 Aug 2022 17:23:32 -0600 Message-Id: <919843fbb5b3488f2b5f66edbb49d54ef29e3bf6.1660951028.git.dxu@dxuuu.xyz> X-Mailer: git-send-email 2.37.1 In-Reply-To: References: MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: bpf@iogearbox.net Returning a bpf_reg_type only makes sense in the context of a BPF_READ. For writes, prefer to explicitly return 0 for clarity. Note that is non-functional change as it just so happened that NOT_INIT == 0. Signed-off-by: Daniel Xu --- net/ipv4/bpf_tcp_ca.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/ipv4/bpf_tcp_ca.c b/net/ipv4/bpf_tcp_ca.c index 85a9e500c42d..6da16ae6a962 100644 --- a/net/ipv4/bpf_tcp_ca.c +++ b/net/ipv4/bpf_tcp_ca.c @@ -124,7 +124,7 @@ static int bpf_tcp_ca_btf_struct_access(struct bpf_verifier_log *log, return -EACCES; } - return NOT_INIT; + return 0; } BPF_CALL_2(bpf_tcp_send_ack, struct tcp_sock *, tp, u32, rcv_nxt)