From patchwork Sat Jun 8 21:15:58 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Xu X-Patchwork-Id: 802851 Received: from wflow3-smtp.messagingengine.com (wflow3-smtp.messagingengine.com [64.147.123.138]) (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 8415740879; Sat, 8 Jun 2024 21:16:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=64.147.123.138 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717881391; cv=none; b=eiqFkTv5llUqrHhNyuxkTub9NQUtyUlZEZ2Nu8v2OZjb084DmSRZGcAyoR36Z7RYLcu0I1kzqOLiEB7hUXi9TlWXF4KFBqe+vygJdlx1kJDGCA69FzB8Tq7uh3SiFSqbLzcadeB6HBWlTvsIUxCklanEBFFXG8Mmb8TuXHfbpEs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717881391; c=relaxed/simple; bh=DU5dy6CIqpni5W9PFs52ElMuDjzzVd6o6tdcoGpKBbM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=thmPPH8mSifwBjXoEtsFza+wnsPxMZvROZ+0iHkGb8woieB1MHhTV7pXdMwb8mv1jy3HZzlZgAzEluCOUNmi588C8Y9j+kjn9cLPLSA1jhz3Tdc3bqcWPyR6UOQRgreqXukMpgr8CgepxWvqD6JbYoHmlPmBB/o9PE8crIv5e8s= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=dxuuu.xyz; spf=pass smtp.mailfrom=dxuuu.xyz; dkim=pass (2048-bit key) header.d=dxuuu.xyz header.i=@dxuuu.xyz header.b=c68s+j/H; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=Eg9jpA67; arc=none smtp.client-ip=64.147.123.138 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=dxuuu.xyz Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=dxuuu.xyz Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=dxuuu.xyz header.i=@dxuuu.xyz header.b="c68s+j/H"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="Eg9jpA67" Received: from compute6.internal (compute6.nyi.internal [10.202.2.47]) by mailflow.west.internal (Postfix) with ESMTP id 603642CC00F8; Sat, 8 Jun 2024 17:16:28 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute6.internal (MEProxy); Sat, 08 Jun 2024 17:16:29 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dxuuu.xyz; h=cc :cc:content-transfer-encoding:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to; s=fm3; t=1717881388; x= 1717888588; bh=26A8vHe3UnZ6l6G9vH1BQWZU+wmQLBMUefgl7dTG5Ls=; b=c 68s+j/Hmn7FrSX46X473w6/h/u5LolUxnQJHnTYqlOMuNMsbTS0duRbygUeQqFXk Lt3QgZYioxSb/YY/mdwC0GSv3dZPDGZWdGk44ZjXnCtj9eKQB+d0FJvSspxpn1dX xy8wvA9tgHv2GeKz964aPfJFdMWBOosRYbh88ZU/8rcf43yeIrCt2KlQmxO1V2Pn sIELtyu/6UVW2Oeg3ryADijddzQvE9rXubVO11OAKEwNn0F/RbkGUNyTLn+4WtW/ Gi9aAIkG8QKLQ0FxdSuFb5G9oO3f4+6j9OWBnNnYIkCSongPWp5O7VJTVNUx8hY9 iSRcPVBBE0v/Awu8ozuZA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t=1717881388; x= 1717888588; bh=26A8vHe3UnZ6l6G9vH1BQWZU+wmQLBMUefgl7dTG5Ls=; b=E g9jpA679d7bNOtU7L37u49ZL2iuXbUS86KrFv2sjTGA90SmQOPZPwbhLchumkOuc 6aEe/+O41FRVp80UvAbH/UOcKJ6ILrbQ23MGAGcRPPTj7zeGX5vqGg0GZHaeOcHR CiG2c7aPGeVmUFAQni0CS5idAnLpXr/NIa9EFxtYQW9uzOr8ks2+gMovrfm72gtA Nq6eteIgf+Va7vqC23XvTu1Ry1Z7syVMCyCp/8AxHWoP9q91S7wUMcCKXEMAdJt9 eYddV8QQcd3Wd+Wgv/ZJRXgzK6gcpdS5CoqhcgW8koEsmVKMTEMPW3FE1BlOjO/0 NrzPhROOsa8nPq9CHvO5Q== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrfedtgedgleegucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucgfrhhlucfvnfffucdljedtmdenucfjughrpefhvf evufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpeffrghnihgvlhcuighuuceo ugiguhesugiguhhuuhdrgiihiieqnecuggftrfgrthhtvghrnhepgfefgfegjefhudeike dvueetffelieefuedvhfehjeeljeejkefgffeghfdttdetnecuvehluhhsthgvrhfuihii vgeptdenucfrrghrrghmpehmrghilhhfrhhomhepugiguhesugiguhhuuhdrgiihii X-ME-Proxy: Feedback-ID: i6a694271:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sat, 8 Jun 2024 17:16:26 -0400 (EDT) From: Daniel Xu To: shuah@kernel.org, daniel@iogearbox.net, andrii@kernel.org, eddyz87@gmail.com, ast@kernel.org, olsajiri@gmail.com, quentin@isovalent.com, alan.maguire@oracle.com, acme@kernel.org Cc: mykolal@fb.com, martin.lau@linux.dev, song@kernel.org, yonghong.song@linux.dev, john.fastabend@gmail.com, kpsingh@kernel.org, sdf@google.com, haoluo@google.com, jolsa@kernel.org, bpf@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-team@meta.com Subject: [PATCH bpf-next v4 02/12] bpf: selftests: Fix bpf_iter_task_vma_new() prototype Date: Sat, 8 Jun 2024 15:15:58 -0600 Message-ID: <91fc7716f9ad70d226e93039956f22fd05c934b0.1717881178.git.dxu@dxuuu.xyz> X-Mailer: git-send-email 2.44.0 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kselftest@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 bpf_iter_task_vma_new() is defined as taking a u64 as its 3rd argument. u64 is a unsigned long long. bpf_experimental.h was defining the prototype as unsigned long. Fix by using __u64. Signed-off-by: Daniel Xu --- tools/testing/selftests/bpf/bpf_experimental.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/testing/selftests/bpf/bpf_experimental.h b/tools/testing/selftests/bpf/bpf_experimental.h index 3d9e4b8c6b81..8ee7a00b7c82 100644 --- a/tools/testing/selftests/bpf/bpf_experimental.h +++ b/tools/testing/selftests/bpf/bpf_experimental.h @@ -163,7 +163,7 @@ struct bpf_iter_task_vma; extern int bpf_iter_task_vma_new(struct bpf_iter_task_vma *it, struct task_struct *task, - unsigned long addr) __ksym; + __u64 addr) __ksym; extern struct vm_area_struct *bpf_iter_task_vma_next(struct bpf_iter_task_vma *it) __ksym; extern void bpf_iter_task_vma_destroy(struct bpf_iter_task_vma *it) __ksym; From patchwork Sat Jun 8 21:15:59 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Xu X-Patchwork-Id: 802735 Received: from wflow3-smtp.messagingengine.com (wflow3-smtp.messagingengine.com [64.147.123.138]) (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 E79FB45977; Sat, 8 Jun 2024 21:16:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=64.147.123.138 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717881395; cv=none; b=P4wsD7D+/9mdmr5LAbiz7Pk3PuttPqftxNI/eoAVBZZ3BgpsNBl5QVjt9HfStY+J3eCzqu8K0RXHIeqAsoECgGWrG6/8bEUHLPShI8VJs+Duj+1oxpjMerS4beFpfhxdiaV/mSgBxS06/ClYClXWVYkJBfgJBSouen+9LoJCsT8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717881395; c=relaxed/simple; bh=C20nHI0ZVkHtBEeLzwSZvfHbTdqmLiDwww6U/jfCpnQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=cH/yDCw52vVlZiAWlDwIiCzGcEhDYOx+sr6m7VX2gxlvlA/vN2wczMPmf119/hnOpwLJwIvJdylcEv3uCT2L2YK52eVdg1ADwDEzkdaE8bzVpDFASEjtsCM3rRIcv8LxnhCuhySxhjOay06TR12sJ8Vf48QN85KZRs9YxpeeTYA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=dxuuu.xyz; spf=pass smtp.mailfrom=dxuuu.xyz; dkim=pass (2048-bit key) header.d=dxuuu.xyz header.i=@dxuuu.xyz header.b=YymvjcuH; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=Kodsly0W; arc=none smtp.client-ip=64.147.123.138 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=dxuuu.xyz Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=dxuuu.xyz Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=dxuuu.xyz header.i=@dxuuu.xyz header.b="YymvjcuH"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="Kodsly0W" Received: from compute7.internal (compute7.nyi.internal [10.202.2.48]) by mailflow.west.internal (Postfix) with ESMTP id F3DD62CC00FA; Sat, 8 Jun 2024 17:16:31 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute7.internal (MEProxy); Sat, 08 Jun 2024 17:16:33 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dxuuu.xyz; h=cc :cc:content-transfer-encoding:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to; s=fm3; t=1717881391; x= 1717888591; bh=CiQLh9M3LuA21Zq/dhBIFvJTJ6E/6gJFz8kLjmANMqQ=; b=Y ymvjcuHhJ7/70nGjwz27r9wY2LRsObxGnEGm/bz5FGPpsAx0HmVQBxck1CM+6XjU W6QOhwWxRUH5VPPoNfGt6GTBe+uoA2tOSm/z/zMbbADyAeUWFzUN6ixA0JbQPG13 Jr7Dba7QMzVRaA9/PnpdG5SUc3/4RqVjW1j181NxhfJFtQ2hxJ3wZVXUpzduaNb4 4eYJ7OA2A3un2I/SRjQSU0y+i1Z9tFW4zTBmzI6nYBtRm2bx4cBU0nUpqUPhMtZw VSA9fRCOaaQo79FOyOCySJtbgtq4/FhrqR4WflLO613bwdDVjX2YAWmWpj0RVEpd G2O9JFbVaDoSFAkkQBVsg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t=1717881391; x= 1717888591; bh=CiQLh9M3LuA21Zq/dhBIFvJTJ6E/6gJFz8kLjmANMqQ=; b=K odsly0WUUgd3Yr0dJMj0oz5mq/aKLsDIShtDkW2pXGe+Dd9Wt5RJHc2IugYuYwJs gMpVpzlDHeMzzsaiUTQ6zXtvOAqjic3MA+JHoISEih/qVVE/9G/c/idPjyj8D+x3 rLzICRlEflWNEJub5OehhMuwoefSL+8eqe7FMkqeFpaUudvOH3J5Xerna4CPDmRz 3s08p7qU+mAR8mhrefLahnp25yIMS4NhHsApBtBinpFnHAq1Lqz3JCZX1ABsfigI o5vQHG3LrV6xUc82bQ+V9F7Cu54KB+sYAB1cLC5SiCytWmTYpP1GMP1Oj7IqYH7q CQkmzxfGzYCW96Glb4ZUQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrfedtgedgleegucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucgfrhhlucfvnfffucdljedtmdenucfjughrpefhvf evufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpeffrghnihgvlhcuighuuceo ugiguhesugiguhhuuhdrgiihiieqnecuggftrfgrthhtvghrnhepgfefgfegjefhudeike dvueetffelieefuedvhfehjeeljeejkefgffeghfdttdetnecuvehluhhsthgvrhfuihii vgeptdenucfrrghrrghmpehmrghilhhfrhhomhepugiguhesugiguhhuuhdrgiihii X-ME-Proxy: Feedback-ID: i6a694271:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sat, 8 Jun 2024 17:16:30 -0400 (EDT) From: Daniel Xu To: shuah@kernel.org, daniel@iogearbox.net, andrii@kernel.org, eddyz87@gmail.com, ast@kernel.org, olsajiri@gmail.com, quentin@isovalent.com, alan.maguire@oracle.com, acme@kernel.org Cc: martin.lau@linux.dev, song@kernel.org, yonghong.song@linux.dev, john.fastabend@gmail.com, kpsingh@kernel.org, sdf@google.com, haoluo@google.com, jolsa@kernel.org, mykolal@fb.com, bpf@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-team@meta.com Subject: [PATCH bpf-next v4 03/12] bpf: selftests: Fix fentry test kfunc prototypes Date: Sat, 8 Jun 2024 15:15:59 -0600 Message-ID: <1f493cb7a7e5349f99e2badf0880b75dd6681898.1717881178.git.dxu@dxuuu.xyz> X-Mailer: git-send-email 2.44.0 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kselftest@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 The prototypes in progs/get_func_ip_test.c were not in line with how the actual kfuncs are defined in net/bpf/test_run.c. This causes compilation errors when kfunc prototypes are generated from BTF. Fix by aligning with actual kfunc definitions. Signed-off-by: Daniel Xu --- .../testing/selftests/bpf/progs/get_func_ip_test.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/tools/testing/selftests/bpf/progs/get_func_ip_test.c b/tools/testing/selftests/bpf/progs/get_func_ip_test.c index 8956eb78a226..a89596f7585d 100644 --- a/tools/testing/selftests/bpf/progs/get_func_ip_test.c +++ b/tools/testing/selftests/bpf/progs/get_func_ip_test.c @@ -5,13 +5,13 @@ char _license[] SEC("license") = "GPL"; -extern const void bpf_fentry_test1 __ksym; -extern const void bpf_fentry_test2 __ksym; -extern const void bpf_fentry_test3 __ksym; -extern const void bpf_fentry_test4 __ksym; -extern const void bpf_modify_return_test __ksym; -extern const void bpf_fentry_test6 __ksym; -extern const void bpf_fentry_test7 __ksym; +extern int bpf_fentry_test1(int a) __ksym; +extern int bpf_fentry_test2(int a, __u64 b) __ksym; +extern int bpf_fentry_test3(char a, int b, __u64 c) __ksym; +extern int bpf_fentry_test4(void *a, char b, int c, __u64 d) __ksym; +extern int bpf_modify_return_test(int a, int *b) __ksym; +extern int bpf_fentry_test6(__u64 a, void *b, short c, int d, void *e, __u64 f) __ksym; +extern int bpf_fentry_test7(struct bpf_fentry_test_t *arg) __ksym; extern bool CONFIG_X86_KERNEL_IBT __kconfig __weak; From patchwork Sat Jun 8 21:16:00 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Xu X-Patchwork-Id: 802850 Received: from wflow3-smtp.messagingengine.com (wflow3-smtp.messagingengine.com [64.147.123.138]) (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 B8CB14776F; Sat, 8 Jun 2024 21:16:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=64.147.123.138 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717881399; cv=none; b=hHFg5mi25//qKnVjyCnO6l0RCaqx9LsosZTK7zTo3LcDs23W80oHQEH4YIb1LepjEVR+qgR08NNVUYYZzYNWz/D3Sg/utPUQOfiQj/LTM6WuS0g+OFWyVz8ogFGU0l6Kn0SG3MEEJ/DdYeEQlHFkcYZHUwO+Hhk5oqN0vPA6L7E= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717881399; c=relaxed/simple; bh=fBPXvgQBNpmEAIneidG+g4NUcTeJDU/Ff0Ik5m1ytq8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=inCiYdCQKVA+l8q7UY0gO/VmtGlbbwlrkPKQ1Cg3EPIqtUnMZ42g/0x+YFCqt6yqrUwgh/yp/Cq1JSPSxu+EwHi0DmVi52ycL75cMwX2GvMHV5M9M9gKwJhUaEGPSgYkymObx+RVON52sYU8MOdvmHPVkBG44gkvDHlcSdOVuAo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=dxuuu.xyz; spf=pass smtp.mailfrom=dxuuu.xyz; dkim=pass (2048-bit key) header.d=dxuuu.xyz header.i=@dxuuu.xyz header.b=Llrm7/1a; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=Jr6BhXAq; arc=none smtp.client-ip=64.147.123.138 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=dxuuu.xyz Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=dxuuu.xyz Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=dxuuu.xyz header.i=@dxuuu.xyz header.b="Llrm7/1a"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="Jr6BhXAq" Received: from compute7.internal (compute7.nyi.internal [10.202.2.48]) by mailflow.west.internal (Postfix) with ESMTP id 9BC402CC00FB; Sat, 8 Jun 2024 17:16:35 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute7.internal (MEProxy); Sat, 08 Jun 2024 17:16:37 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dxuuu.xyz; h=cc :cc:content-transfer-encoding:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to; s=fm3; t=1717881395; x= 1717888595; bh=ezeG0+F5tOubWbkL94aTK4e46SIjo+JWMalcSljhHdQ=; b=L lrm7/1aCIWsUC97UpM+oMLf1BIAE1mEUkwtS/pIwYOSo/f1lhDE5S1kedyDUh/ur Q8EMU3CogVenLrucqrwUDDojNEmYdOfZsXdVuY8JAReBeLGcdhe+pIH6v/I3A3qm L2V/FzEfiq7Fre1PTCIM8NiN3mp6xFCBGbWcbSKIL55k5pwknXenrD/Gux0L0IIS a4CwT8lW4O4w6+PpVAxoeiE/XbWE7O0PzMQmVwzpwYJqjC2XByFCfQ1IOOzu5jYL jaqnXVoUI5mtdbmaWMLVhEfoZn2LJwqoGjyoey8aVwoxSBeXJT2SmT22+sAxfx0K HNdx1QxY630V8QlKwAVEQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t=1717881395; x= 1717888595; bh=ezeG0+F5tOubWbkL94aTK4e46SIjo+JWMalcSljhHdQ=; b=J r6BhXAqvAWDmZU4rxKVLUk6Ufd8KuVhtZ5JKjxQKkxDY59qabjlFy+kSKANVx5Mg nvJOSzINSJKWyNhURXDfH1w+RNPuZlWU++PRKU1nA2swbNCEnd90i8viUoPMRTSG RoXY82feyMSDArrrhFYBZYzyIsxQIyS09yTom0tLnR+sUfocDvEejEAp52zNIKQj HUVaZpsOvL3QEhvvwLfOBmaKfQmKWjg8YWGKUWdKvpXo8tX1CxGYdEPnGZweLrUL WZ9TF7AkDY4nropAfZJLETtbQGRen/3jd4eGvfPrGx0nPyo5G7Rs8IqYDIS/EiLr O3KSf1rVr9DcBqk27+W8w== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrfedtgedgleegucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucgfrhhlucfvnfffucdljedtmdenucfjughrpefhvf evufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpeffrghnihgvlhcuighuuceo ugiguhesugiguhhuuhdrgiihiieqnecuggftrfgrthhtvghrnhepgfefgfegjefhudeike dvueetffelieefuedvhfehjeeljeejkefgffeghfdttdetnecuvehluhhsthgvrhfuihii vgepudenucfrrghrrghmpehmrghilhhfrhhomhepugiguhesugiguhhuuhdrgiihii X-ME-Proxy: Feedback-ID: i6a694271:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sat, 8 Jun 2024 17:16:33 -0400 (EDT) From: Daniel Xu To: shuah@kernel.org, ast@kernel.org, andrii@kernel.org, eddyz87@gmail.com, daniel@iogearbox.net, olsajiri@gmail.com, quentin@isovalent.com, alan.maguire@oracle.com, acme@kernel.org Cc: mykolal@fb.com, martin.lau@linux.dev, song@kernel.org, yonghong.song@linux.dev, john.fastabend@gmail.com, kpsingh@kernel.org, sdf@google.com, haoluo@google.com, jolsa@kernel.org, bpf@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-team@meta.com Subject: [PATCH bpf-next v4 04/12] bpf: selftests: Fix bpf_cpumask_first_zero() kfunc prototype Date: Sat, 8 Jun 2024 15:16:00 -0600 Message-ID: X-Mailer: git-send-email 2.44.0 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kselftest@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 The prototype in progs/nested_trust_common.h is not in line with how the actual kfuncs are defined in kernel/bpf/cpumask.c. This causes compilation errors when kfunc prototypes are generated from BTF. Fix by aligning with actual kfunc definitions. Signed-off-by: Daniel Xu --- tools/testing/selftests/bpf/progs/nested_trust_common.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/testing/selftests/bpf/progs/nested_trust_common.h b/tools/testing/selftests/bpf/progs/nested_trust_common.h index 83d33931136e..1784b496be2e 100644 --- a/tools/testing/selftests/bpf/progs/nested_trust_common.h +++ b/tools/testing/selftests/bpf/progs/nested_trust_common.h @@ -7,6 +7,6 @@ #include bool bpf_cpumask_test_cpu(unsigned int cpu, const struct cpumask *cpumask) __ksym; -bool bpf_cpumask_first_zero(const struct cpumask *cpumask) __ksym; +__u32 bpf_cpumask_first_zero(const struct cpumask *cpumask) __ksym; #endif /* _NESTED_TRUST_COMMON_H */ From patchwork Sat Jun 8 21:16:01 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Xu X-Patchwork-Id: 802734 Received: from wflow3-smtp.messagingengine.com (wflow3-smtp.messagingengine.com [64.147.123.138]) (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 9A621487BC; Sat, 8 Jun 2024 21:16:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=64.147.123.138 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717881403; cv=none; b=ewVkrSrZ51TSq7+hIVRNx/o+2HJDGRO4rohf2rH5SGkt+/chZanJ6kSxBMFH7SSKZVbNmEiyRp9U171xeJfZSKT/pbMt0GVT17SmCrFiGTGtwiIg+ac9Xnet3F8WeiFB40i8gPTOUoSOHqV+7zx2e9QH/AhZPU22ZOr0/XwPy1Q= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717881403; c=relaxed/simple; bh=ijnUl0Hs27kSZo5nKTCwOlVMiTcVZASzt7fhb1OM00o=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ZZ8kcp2n+jJHLKmmakPvj3mIieGUhgy38Y/WssT2y+347J1+NJmU2zKXswTn6NNvfdltRvJ1ZAkhQg0ImNMD463YsGHKzsmQosPsr3KBOagR5F6ITyTlXPYwkJU6GaCtCG0LoKXRsKtpAOYwBloFL6noMTtI15hz0RA6EqW0Zl0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=dxuuu.xyz; spf=pass smtp.mailfrom=dxuuu.xyz; dkim=pass (2048-bit key) header.d=dxuuu.xyz header.i=@dxuuu.xyz header.b=MA8InosA; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=YT3wcUra; arc=none smtp.client-ip=64.147.123.138 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=dxuuu.xyz Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=dxuuu.xyz Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=dxuuu.xyz header.i=@dxuuu.xyz header.b="MA8InosA"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="YT3wcUra" Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailflow.west.internal (Postfix) with ESMTP id 7DEC32CC00F7; Sat, 8 Jun 2024 17:16:39 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Sat, 08 Jun 2024 17:16:40 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dxuuu.xyz; h=cc :cc:content-transfer-encoding:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to; s=fm3; t=1717881399; x= 1717888599; bh=P8U/vSNSp1TElUyC4OwmdinUUv2kbxRZJWBSbm83Cm8=; b=M A8InosAirC+uQq+1V/SjcpCYNW2Q5QgoI+gdHVzV6+Pf/sZqHnVYdHIBZJIQMHNf ph3nwtDM6UObzd/Ly55JpKOrtUzW8aqlWnN1u/AXvbH5FIrAlv/4h0wDa2io1dpF 1gPNDfS0Wa6IaZQ4dDqvBrvhMUm6M+msKTuVUnyTbxv0RBFbFQVM/6JT3YlQL0eq XzJc1cYQVboT2IKEHxOrgYKcIeqqwlaWoiXmZvtyr9M9xl3jc9rnVkxMtSZo9OX0 pLGBuzj4jflacPLKupbA9yoXweMrn83Ee+rR6WSVxDmmy08oHJowCkBffOFz+m4u vLWQBDdVl4+RognTfekAw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t=1717881399; x= 1717888599; bh=P8U/vSNSp1TElUyC4OwmdinUUv2kbxRZJWBSbm83Cm8=; b=Y T3wcUraR3ApdjVU7w14phOMIBw/pvQNN5FJiKM9RqB/gq6BKq24qHDrtylY24Wyc Ahzw6dPr+zEBFhkfY0AbFD0I/f9ZxNEM/yDDuhHwG9ny7dMCTQdODFlcmpH9ZqND vAsMtAPFXBzdwYFR0fX3ghjlGBddLq32bz49/rQpjnhCXyqR7Su5+f3l41ff3Yrn eyKEGnrxaoC6zknUfOqWQVD6MPNgp8vRU1AT4Uxfn60bpnJieEGROwZQJHRvhJch 5yafa9+zeEz/fkV1rLWus3PfnYXKNpDScioFu631NNov6ZXJEN05z/e5eaaw2eh/ VLyEuAnzLAKmLQO04lzHw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrfedtgedgleefucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucgfrhhlucfvnfffucdljedtmdenucfjughrpefhvf evufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpeffrghnihgvlhcuighuuceo ugiguhesugiguhhuuhdrgiihiieqnecuggftrfgrthhtvghrnhepgfefgfegjefhudeike dvueetffelieefuedvhfehjeeljeejkefgffeghfdttdetnecuvehluhhsthgvrhfuihii vgeptdenucfrrghrrghmpehmrghilhhfrhhomhepugiguhesugiguhhuuhdrgiihii X-ME-Proxy: Feedback-ID: i6a694271:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sat, 8 Jun 2024 17:16:37 -0400 (EDT) From: Daniel Xu To: shuah@kernel.org, daniel@iogearbox.net, andrii@kernel.org, eddyz87@gmail.com, ast@kernel.org, olsajiri@gmail.com, quentin@isovalent.com, alan.maguire@oracle.com, acme@kernel.org Cc: martin.lau@linux.dev, song@kernel.org, yonghong.song@linux.dev, john.fastabend@gmail.com, kpsingh@kernel.org, sdf@google.com, haoluo@google.com, jolsa@kernel.org, mykolal@fb.com, bpf@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-team@meta.com Subject: [PATCH bpf-next v4 05/12] bpf: selftests: Fix bpf_map_sum_elem_count() kfunc prototype Date: Sat, 8 Jun 2024 15:16:01 -0600 Message-ID: <1ade365ced7051f2e18803d182ebe14c61b18309.1717881178.git.dxu@dxuuu.xyz> X-Mailer: git-send-email 2.44.0 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kselftest@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 The prototype in progs/map_percpu_stats.c is not in line with how the actual kfuncs are defined in kernel/bpf/map_iter.c. This causes compilation errors when kfunc prototypes are generated from BTF. Fix by aligning with actual kfunc definitions. Signed-off-by: Daniel Xu --- tools/testing/selftests/bpf/progs/map_percpu_stats.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/testing/selftests/bpf/progs/map_percpu_stats.c b/tools/testing/selftests/bpf/progs/map_percpu_stats.c index 10b2325c1720..63245785eb69 100644 --- a/tools/testing/selftests/bpf/progs/map_percpu_stats.c +++ b/tools/testing/selftests/bpf/progs/map_percpu_stats.c @@ -7,7 +7,7 @@ __u32 target_id; -__s64 bpf_map_sum_elem_count(struct bpf_map *map) __ksym; +__s64 bpf_map_sum_elem_count(const struct bpf_map *map) __ksym; SEC("iter/bpf_map") int dump_bpf_map(struct bpf_iter__bpf_map *ctx) From patchwork Sat Jun 8 21:16:02 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Xu X-Patchwork-Id: 802849 Received: from wflow3-smtp.messagingengine.com (wflow3-smtp.messagingengine.com [64.147.123.138]) (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 3EC7B4CE04; Sat, 8 Jun 2024 21:16:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=64.147.123.138 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717881406; cv=none; b=Am6NY/4vbF53JbKkMLhBvfk8ygcqEvNG+hdGt0dBbUZPGKCMVO6d7TqBYcj6WhNw2QEINiv5V2ukzx8O0RjdJUGL5qiFqKBWbaw7eKuVeRduYUbnf8Lr89NXl3iz3MgaNJyrsYnj+cxoBcnAG/veHvigGqo8Yv9879wkxtMwGnU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717881406; c=relaxed/simple; bh=wanEOrTfLhQjXxteqyG7oIdx67CSb0OM3DUowxi3Ft8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=O5LapoDG8/Ku1N1BAo1+QXBBxQeKzd/Am1Hshdur0UxIIRPwujI0EFR4tzq54ETZPXsTwNH0FVv8OFz75DFBkG8GzrMDk9Ik2x2c6BYG0NENRPdjcH0wLioyOjhvhkWLWybISlYFbfsrUQgVUhlzD6ggOxolMUwiz4/MXKSuAXQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=dxuuu.xyz; spf=pass smtp.mailfrom=dxuuu.xyz; dkim=pass (2048-bit key) header.d=dxuuu.xyz header.i=@dxuuu.xyz header.b=pehgn/dF; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=cvseUzVC; arc=none smtp.client-ip=64.147.123.138 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=dxuuu.xyz Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=dxuuu.xyz Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=dxuuu.xyz header.i=@dxuuu.xyz header.b="pehgn/dF"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="cvseUzVC" Received: from compute7.internal (compute7.nyi.internal [10.202.2.48]) by mailflow.west.internal (Postfix) with ESMTP id 1DE9B2CC00F8; Sat, 8 Jun 2024 17:16:43 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute7.internal (MEProxy); Sat, 08 Jun 2024 17:16:44 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dxuuu.xyz; h=cc :cc:content-transfer-encoding:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to; s=fm3; t=1717881402; x= 1717888602; bh=dLI58khaaOksRM7qlvJcsyH3aC85IQuRR85SwV1wvsg=; b=p ehgn/dFoavFd8PjnzSD2kBTpTLPfOraAa5glOJjgbmW4zj1oVbPzFQ08NuuPRuNp 55y0WQauQGrywjL+UxclLFxsYc1h6piTwJ6w1ML623flPLwuc5raSo8nDBUyqTqs 4IYqyUXPYjHizs3ZsIYDjg0cad6nybhAM+8zOJNx0PK1mYtOGibu2ZU0yhFWI/sy YwHu3bTSCu1B8+6agcVpO5/94ny1viFYEWU1L0no5jYDUe0FAkS9P6VzzFI2486R NJjvlOeGPVd93+FPzmDrXyZJnh3ozM8pquWsyxEqNKbQrhz6lZIH0HQZv6Pdtejf MqqfoHuMVC3tTCWVjlSNg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t=1717881402; x= 1717888602; bh=dLI58khaaOksRM7qlvJcsyH3aC85IQuRR85SwV1wvsg=; b=c vseUzVC6L5PfU0ZB3Ve8KXqt2i037KsTBLjYx18jyHXNq4VdZbZQbxsEfW9ieYEm 0w62WskzKIijady0H0q14HJFkg4RODE6aRPXHX9soJ4Utq8r/rx64S2Sd5W4Qwhz Jzh3rth2+V+zfOCYqxA7h7/dE29dzaaihN9ZWq4kP5nUhqU1KH9oW78dBWyyO+oa AfGVsrkfQ8d5cxLmu13GWOjbbA3oz86rUlgi37BC4AydjZZhkeYnq/A+MKLtSBrM Vasbi+WrBYzq9BL6rl3zZps6ibTcjeM6vusdabFbRjjOhlx4w236XIZc5jtjbi/l 30W4OqkncIybpu5Ts48xg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrfedtgedgleegucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucgfrhhlucfvnfffucdljedtmdenucfjughrpefhvf evufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpeffrghnihgvlhcuighuuceo ugiguhesugiguhhuuhdrgiihiieqnecuggftrfgrthhtvghrnhepgfefgfegjefhudeike dvueetffelieefuedvhfehjeeljeejkefgffeghfdttdetnecuvehluhhsthgvrhfuihii vgepvdenucfrrghrrghmpehmrghilhhfrhhomhepugiguhesugiguhhuuhdrgiihii X-ME-Proxy: Feedback-ID: i6a694271:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sat, 8 Jun 2024 17:16:41 -0400 (EDT) From: Daniel Xu To: shuah@kernel.org, ast@kernel.org, andrii@kernel.org, eddyz87@gmail.com, daniel@iogearbox.net, olsajiri@gmail.com, quentin@isovalent.com, alan.maguire@oracle.com, acme@kernel.org Cc: mykolal@fb.com, martin.lau@linux.dev, song@kernel.org, yonghong.song@linux.dev, john.fastabend@gmail.com, kpsingh@kernel.org, sdf@google.com, haoluo@google.com, jolsa@kernel.org, bpf@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-team@meta.com Subject: [PATCH bpf-next v4 06/12] bpf: selftests: Fix bpf_session_cookie() kfunc prototype Date: Sat, 8 Jun 2024 15:16:02 -0600 Message-ID: <34708481d71ea72c23a78a5209e04a76b261a01d.1717881178.git.dxu@dxuuu.xyz> X-Mailer: git-send-email 2.44.0 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kselftest@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 The prototype defined in bpf_kfuncs.h was not in line with how the actual kfunc was defined. This causes compilation errors when kfunc prototypes are generated from BTF. Fix by aligning with actual kfunc definition. Signed-off-by: Daniel Xu --- tools/testing/selftests/bpf/bpf_kfuncs.h | 2 +- tools/testing/selftests/bpf/progs/kprobe_multi_session_cookie.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/testing/selftests/bpf/bpf_kfuncs.h b/tools/testing/selftests/bpf/bpf_kfuncs.h index be91a6919315..3b6675ab4086 100644 --- a/tools/testing/selftests/bpf/bpf_kfuncs.h +++ b/tools/testing/selftests/bpf/bpf_kfuncs.h @@ -77,5 +77,5 @@ extern int bpf_verify_pkcs7_signature(struct bpf_dynptr *data_ptr, struct bpf_key *trusted_keyring) __ksym; extern bool bpf_session_is_return(void) __ksym __weak; -extern long *bpf_session_cookie(void) __ksym __weak; +extern __u64 *bpf_session_cookie(void) __ksym __weak; #endif diff --git a/tools/testing/selftests/bpf/progs/kprobe_multi_session_cookie.c b/tools/testing/selftests/bpf/progs/kprobe_multi_session_cookie.c index d49070803e22..0835b5edf685 100644 --- a/tools/testing/selftests/bpf/progs/kprobe_multi_session_cookie.c +++ b/tools/testing/selftests/bpf/progs/kprobe_multi_session_cookie.c @@ -25,7 +25,7 @@ int BPF_PROG(trigger) static int check_cookie(__u64 val, __u64 *result) { - long *cookie; + __u64 *cookie; if (bpf_get_current_pid_tgid() >> 32 != pid) return 1; From patchwork Sat Jun 8 21:16:03 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Xu X-Patchwork-Id: 802733 Received: from wflow3-smtp.messagingengine.com (wflow3-smtp.messagingengine.com [64.147.123.138]) (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 D38E54D8C9; Sat, 8 Jun 2024 21:16:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=64.147.123.138 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717881410; cv=none; b=PIM3fyYnoWnBsr2MEfqJRMd9ng74XMgujcdsU+Dub57Y4EIlPaUdfl66NhouW8J4RQDzif+URUAgWsioVzoaBVrSf4UqrizVPhyQiJ9E9Tj9ndWsz/+HITev6QveEemJo646n618bEQVvd439j3SGYacCwKYWMmfzQIwue0l2OM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717881410; c=relaxed/simple; bh=JHgDG6CBaC2pw4rqBfIHAd5mxxaAeSr8uX2G8OkCw0Q=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=fLhw5zht60x1FI22dORkb2fqHrmj2xRFqdMMG4n1PgPLB9yMbRapOqB7VsTka/Ir3V+Rpx4BpwQJCXYvRP8IeVIjt3XvYUMjmGRumvxpOVJMSOcnnolsnW+okNVgbAz9JCHjm2e86jVMHIgA15Qpqds0EHl19I0ABlUH8fPy7Hs= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=dxuuu.xyz; spf=pass smtp.mailfrom=dxuuu.xyz; dkim=pass (2048-bit key) header.d=dxuuu.xyz header.i=@dxuuu.xyz header.b=aJ52fQNo; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=Bd29stLd; arc=none smtp.client-ip=64.147.123.138 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=dxuuu.xyz Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=dxuuu.xyz Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=dxuuu.xyz header.i=@dxuuu.xyz header.b="aJ52fQNo"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="Bd29stLd" Received: from compute6.internal (compute6.nyi.internal [10.202.2.47]) by mailflow.west.internal (Postfix) with ESMTP id BFF4C2CC00FC; Sat, 8 Jun 2024 17:16:46 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute6.internal (MEProxy); Sat, 08 Jun 2024 17:16:48 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dxuuu.xyz; h=cc :cc:content-transfer-encoding:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to; s=fm3; t=1717881406; x= 1717888606; bh=NA95GwCBOqNSuwFYcP1D5HkbWJ2YgltwMTaT5DqWOaM=; b=a J52fQNo1944xvEgsFDGghQ3igTe2n0d5Aqyydn+ITN4gVjD29auJip3uLIVsJkNe 0KPG2lXVab2gYDj9XdD5cktvOvNOspjXAJwQtaFwDZyUCH3bUJ8LJCTD0ddCFU30 L2aD8QtsG6it+WxGrFYrEf2TAH+BuFkSWG3kLJYA2y+FEgbyKwvqK/vvyIRMk3Ie Fjet9fcCmdAZCVgu0jlNx7aX6eb/7448giBzHa21C7EfTpSzGtaPKDTXF1qxwZQN QAlr3hZlJFYmlpIjMCUUigrhwuDtHnoJR/GUnYzGCq9w5gRhKDZGPqYYbdVW/yr2 72mGksZuxz3u2gp2EiArw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t=1717881406; x= 1717888606; bh=NA95GwCBOqNSuwFYcP1D5HkbWJ2YgltwMTaT5DqWOaM=; b=B d29stLdbIBjUOgA7EVTXDYhJRCvyC+YI5JFultizIOwEB9rNv5QXBxNaxxMMmuOA etk7UXcsfdtO7Is0+yM5aJ+qyFKA2wX+/nSLChcodylJNpOjrql3qTMlRjTvvn6M WWJlFxsjl26i3F18Rh9g+zQ4yPWs1H9Ey9uIS7RSLLvbXyM7CxpN11cQ9hFgeruz hWtCI4UdV9iA/HWBFk7ukS9hpV6uCPCJCWjbbGb6t5OONtRIl+HeAAodE6O7DcrH FHmjHRdrBdmyRwmXse+aJ1u8Jxl2Ll0XZyBpaYM5Kc09GcWU+M3mDChbk9dnfd6U VcMTebTxLGROB9tt8zhaQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrfedtgedgleegucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucgfrhhlucfvnfffucdljedtmdenucfjughrpefhvf evufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpeffrghnihgvlhcuighuuceo ugiguhesugiguhhuuhdrgiihiieqnecuggftrfgrthhtvghrnhepgfefgfegjefhudeike dvueetffelieefuedvhfehjeeljeejkefgffeghfdttdetnecuvehluhhsthgvrhfuihii vgepudenucfrrghrrghmpehmrghilhhfrhhomhepugiguhesugiguhhuuhdrgiihii X-ME-Proxy: Feedback-ID: i6a694271:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sat, 8 Jun 2024 17:16:44 -0400 (EDT) From: Daniel Xu To: shuah@kernel.org, daniel@iogearbox.net, andrii@kernel.org, eddyz87@gmail.com, ast@kernel.org, olsajiri@gmail.com, quentin@isovalent.com, alan.maguire@oracle.com, acme@kernel.org Cc: mykolal@fb.com, martin.lau@linux.dev, song@kernel.org, yonghong.song@linux.dev, john.fastabend@gmail.com, kpsingh@kernel.org, sdf@google.com, haoluo@google.com, jolsa@kernel.org, bpf@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-team@meta.com Subject: [PATCH bpf-next v4 07/12] bpf: selftests: Namespace struct_opt callbacks in bpf_dctcp Date: Sat, 8 Jun 2024 15:16:03 -0600 Message-ID: <14eb6dd8a7bb3f47fb44c433d1f10aae5d78f83f.1717881178.git.dxu@dxuuu.xyz> X-Mailer: git-send-email 2.44.0 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kselftest@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 With generated kfunc prototypes, the existing callback names will conflict. Fix by namespacing with a bpf_ prefix. Signed-off-by: Daniel Xu --- tools/testing/selftests/bpf/progs/bpf_dctcp.c | 36 +++++++++---------- 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/tools/testing/selftests/bpf/progs/bpf_dctcp.c b/tools/testing/selftests/bpf/progs/bpf_dctcp.c index 3c9ffe340312..02f552e7fd4d 100644 --- a/tools/testing/selftests/bpf/progs/bpf_dctcp.c +++ b/tools/testing/selftests/bpf/progs/bpf_dctcp.c @@ -65,7 +65,7 @@ static void dctcp_reset(const struct tcp_sock *tp, struct bpf_dctcp *ca) } SEC("struct_ops") -void BPF_PROG(dctcp_init, struct sock *sk) +void BPF_PROG(bpf_dctcp_init, struct sock *sk) { const struct tcp_sock *tp = tcp_sk(sk); struct bpf_dctcp *ca = inet_csk_ca(sk); @@ -77,7 +77,7 @@ void BPF_PROG(dctcp_init, struct sock *sk) (void *)fallback, sizeof(fallback)) == -EBUSY) ebusy_cnt++; - /* Switch back to myself and the recurred dctcp_init() + /* Switch back to myself and the recurred bpf_dctcp_init() * will get -EBUSY for all bpf_setsockopt(TCP_CONGESTION), * except the last "cdg" one. */ @@ -112,7 +112,7 @@ void BPF_PROG(dctcp_init, struct sock *sk) } SEC("struct_ops") -__u32 BPF_PROG(dctcp_ssthresh, struct sock *sk) +__u32 BPF_PROG(bpf_dctcp_ssthresh, struct sock *sk) { struct bpf_dctcp *ca = inet_csk_ca(sk); struct tcp_sock *tp = tcp_sk(sk); @@ -122,7 +122,7 @@ __u32 BPF_PROG(dctcp_ssthresh, struct sock *sk) } SEC("struct_ops") -void BPF_PROG(dctcp_update_alpha, struct sock *sk, __u32 flags) +void BPF_PROG(bpf_dctcp_update_alpha, struct sock *sk, __u32 flags) { const struct tcp_sock *tp = tcp_sk(sk); struct bpf_dctcp *ca = inet_csk_ca(sk); @@ -161,12 +161,12 @@ static void dctcp_react_to_loss(struct sock *sk) } SEC("struct_ops") -void BPF_PROG(dctcp_state, struct sock *sk, __u8 new_state) +void BPF_PROG(bpf_dctcp_state, struct sock *sk, __u8 new_state) { if (new_state == TCP_CA_Recovery && new_state != BPF_CORE_READ_BITFIELD(inet_csk(sk), icsk_ca_state)) dctcp_react_to_loss(sk); - /* We handle RTO in dctcp_cwnd_event to ensure that we perform only + /* We handle RTO in bpf_dctcp_cwnd_event to ensure that we perform only * one loss-adjustment per RTT. */ } @@ -208,7 +208,7 @@ static void dctcp_ece_ack_update(struct sock *sk, enum tcp_ca_event evt, } SEC("struct_ops") -void BPF_PROG(dctcp_cwnd_event, struct sock *sk, enum tcp_ca_event ev) +void BPF_PROG(bpf_dctcp_cwnd_event, struct sock *sk, enum tcp_ca_event ev) { struct bpf_dctcp *ca = inet_csk_ca(sk); @@ -227,7 +227,7 @@ void BPF_PROG(dctcp_cwnd_event, struct sock *sk, enum tcp_ca_event ev) } SEC("struct_ops") -__u32 BPF_PROG(dctcp_cwnd_undo, struct sock *sk) +__u32 BPF_PROG(bpf_dctcp_cwnd_undo, struct sock *sk) { const struct bpf_dctcp *ca = inet_csk_ca(sk); @@ -237,28 +237,28 @@ __u32 BPF_PROG(dctcp_cwnd_undo, struct sock *sk) extern void tcp_reno_cong_avoid(struct sock *sk, __u32 ack, __u32 acked) __ksym; SEC("struct_ops") -void BPF_PROG(dctcp_cong_avoid, struct sock *sk, __u32 ack, __u32 acked) +void BPF_PROG(bpf_dctcp_cong_avoid, struct sock *sk, __u32 ack, __u32 acked) { tcp_reno_cong_avoid(sk, ack, acked); } SEC(".struct_ops") struct tcp_congestion_ops dctcp_nouse = { - .init = (void *)dctcp_init, - .set_state = (void *)dctcp_state, + .init = (void *)bpf_dctcp_init, + .set_state = (void *)bpf_dctcp_state, .flags = TCP_CONG_NEEDS_ECN, .name = "bpf_dctcp_nouse", }; SEC(".struct_ops") struct tcp_congestion_ops dctcp = { - .init = (void *)dctcp_init, - .in_ack_event = (void *)dctcp_update_alpha, - .cwnd_event = (void *)dctcp_cwnd_event, - .ssthresh = (void *)dctcp_ssthresh, - .cong_avoid = (void *)dctcp_cong_avoid, - .undo_cwnd = (void *)dctcp_cwnd_undo, - .set_state = (void *)dctcp_state, + .init = (void *)bpf_dctcp_init, + .in_ack_event = (void *)bpf_dctcp_update_alpha, + .cwnd_event = (void *)bpf_dctcp_cwnd_event, + .ssthresh = (void *)bpf_dctcp_ssthresh, + .cong_avoid = (void *)bpf_dctcp_cong_avoid, + .undo_cwnd = (void *)bpf_dctcp_cwnd_undo, + .set_state = (void *)bpf_dctcp_state, .flags = TCP_CONG_NEEDS_ECN, .name = "bpf_dctcp", }; From patchwork Sat Jun 8 21:16:05 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Xu X-Patchwork-Id: 802848 Received: from wfhigh8-smtp.messagingengine.com (wfhigh8-smtp.messagingengine.com [64.147.123.159]) (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 1F7163D3BD; Sat, 8 Jun 2024 21:16:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=64.147.123.159 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717881421; cv=none; b=ldURqJQrisJ+/UU79sgLnDB9m4HfdXvKEws/oUMIYUwwZI1dIXctgPLuerPCTgUWemw+yZrKzaUvftq5A2j9F6Y/I+90lpUpcTBqJywWBAVe1XQFn1YaF1H+cNKRbGsnODlk/N9DLBfvlVODQIxGg7MZGS5HQifbGpqRe/l/0yA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717881421; c=relaxed/simple; bh=F1BdnD+473JFwFhnq5XquJEj+Nd5pud67dbTihqeaTM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=th0TsLh7zfOLJy/iz5Ro8U8z2ztn+EHeEgIP2dUVc6Td2gSNyk0xx2TMDbn61Zwnz9oWA06iSHWdYmSYpnl4QwccnDud5xDzzXu6xjX1gNSd9wOs+z4idnwXeD70ukzDJsbtZkd01Y1yYjK7l4BL7CfiPSp90bZKdPUDzR8B/Ss= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=dxuuu.xyz; spf=pass smtp.mailfrom=dxuuu.xyz; dkim=pass (2048-bit key) header.d=dxuuu.xyz header.i=@dxuuu.xyz header.b=m1aKuC3N; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=XeLNhmfy; arc=none smtp.client-ip=64.147.123.159 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=dxuuu.xyz Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=dxuuu.xyz Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=dxuuu.xyz header.i=@dxuuu.xyz header.b="m1aKuC3N"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="XeLNhmfy" Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailfhigh.west.internal (Postfix) with ESMTP id 2FF291800081; Sat, 8 Jun 2024 17:16:55 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Sat, 08 Jun 2024 17:16:57 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dxuuu.xyz; h=cc :cc:content-transfer-encoding:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to; s=fm3; t=1717881414; x= 1717967814; bh=ZS5H7eVLU+ArNK60GvnBi/5Y+KsAu6XxJQNxDlD3NCE=; b=m 1aKuC3NoafRCBMbmVuv2qBZrjxOhsfrUc0aT21yCIWbYWiCFnRO3ZtxtDa770e8I mXauu3wYqRddkH/vL9WFLYjGPisrZzOxBrCGrrI/O8MtmLGBS5eduH1HOFJyfKk8 pUcus07+HCT/FzEZ1dS+xK0y7gimOj6tmGQDFvV9fVXc10wqpF+Cb21zlRdHeh1h j6DjExiAaa1lerBBYEOoRnXOd2YdzvFB1fnZzrkMsbWRbRJ9QtfH3jGt1q4liNo0 NeVIOejPj60x5HtEGgQpHZvf5iW8ybyLWx00UprjzX/tgakfNpARQH9KYsPPr0PX qL7+CXKsukyZVabxo8eoQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t=1717881414; x= 1717967814; bh=ZS5H7eVLU+ArNK60GvnBi/5Y+KsAu6XxJQNxDlD3NCE=; b=X eLNhmfyg00DDj3u0LwTeIzSyLLFkLHiL6QsvsZ9Ya6WqNG6qXwdi3vMqos8x44nW K9/JGr1aT+LCkNuu/Kiy+sojQgToy9zf9z88LzYPCIh3rCss/ba85jj92PnKcd/Z 9BVvPltPWZeYukcahopOMwXH0TFIWAQyQh81BgBUf6oRK7c0IFqU4ivBLQ7+eTGg YxLdQyvwdtRCi786SiqkTQzl8aqZHn3Cy4VDshgVwZbPlV+4+MHTMYQWVHt+Epkm VjnReaNmEoX/37+BtVSQXFBAISuCQDCRrfGXs2B2KvG/p5DEWKb2tSP9ulzVaQ1C gSqkQzTRAqUEGu9tRlb3g== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrfedtgedgleegucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucgfrhhlucfvnfffucdljedtmdenucfjughrpefhvf evufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpeffrghnihgvlhcuighuuceo ugiguhesugiguhhuuhdrgiihiieqnecuggftrfgrthhtvghrnhepgfefgfegjefhudeike dvueetffelieefuedvhfehjeeljeejkefgffeghfdttdetnecuvehluhhsthgvrhfuihii vgeptdenucfrrghrrghmpehmrghilhhfrhhomhepugiguhesugiguhhuuhdrgiihii X-ME-Proxy: Feedback-ID: i6a694271:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sat, 8 Jun 2024 17:16:51 -0400 (EDT) From: Daniel Xu To: rostedt@goodmis.org, martin.lau@linux.dev, shuah@kernel.org, song@kernel.org, mhiramat@kernel.org, ast@kernel.org, andrii@kernel.org, pabeni@redhat.com, ebiggers@kernel.org, tytso@mit.edu, vadim.fedorenko@linux.dev, eddyz87@gmail.com, davem@davemloft.net, edumazet@google.com, daniel@iogearbox.net, hawk@kernel.org, kuba@kernel.org, john.fastabend@gmail.com, olsajiri@gmail.com, quentin@isovalent.com, alan.maguire@oracle.com, acme@kernel.org Cc: yonghong.song@linux.dev, kpsingh@kernel.org, sdf@google.com, haoluo@google.com, jolsa@kernel.org, mathieu.desnoyers@efficios.com, mykolal@fb.com, fsverity@lists.linux.dev, linux-kernel@vger.kernel.org, bpf@vger.kernel.org, linux-trace-kernel@vger.kernel.org, netdev@vger.kernel.org, linux-kselftest@vger.kernel.org, kernel-team@meta.com Subject: [PATCH bpf-next v4 09/12] bpf: treewide: Align kfunc signatures to prog point-of-view Date: Sat, 8 Jun 2024 15:16:05 -0600 Message-ID: <677377439845fcb9135151d1dac1102ed3d6c924.1717881178.git.dxu@dxuuu.xyz> X-Mailer: git-send-email 2.44.0 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kselftest@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Previously, kfunc declarations in bpf_kfuncs.h (and others) used "user facing" types for kfuncs prototypes while the actual kfunc definitions used "kernel facing" types. More specifically: bpf_dynptr vs bpf_dynptr_kern, __sk_buff vs sk_buff, and xdp_md vs xdp_buff. It wasn't an issue before, as the verifier allows aliased types. However, since we are now generating kfunc prototypes in vmlinux.h (in addition to keeping bpf_kfuncs.h around), this conflict creates compilation errors. Fix this conflict by using "user facing" types in kfunc definitions. This results in more casts, but otherwise has no additional runtime cost. Note, similar to 5b268d1ebcdc ("bpf: Have bpf_rdonly_cast() take a const pointer"), we also make kfuncs take const arguments where appropriate in order to make the kfunc more permissive. Signed-off-by: Daniel Xu --- fs/verity/measure.c | 3 +- include/linux/bpf.h | 8 ++-- kernel/bpf/crypto.c | 24 ++++++++---- kernel/bpf/helpers.c | 39 +++++++++++++------ kernel/bpf/verifier.c | 2 +- kernel/trace/bpf_trace.c | 9 +++-- net/core/filter.c | 32 +++++++++------ .../selftests/bpf/progs/ip_check_defrag.c | 10 ++--- .../bpf/progs/verifier_netfilter_ctx.c | 6 +-- 9 files changed, 84 insertions(+), 49 deletions(-) diff --git a/fs/verity/measure.c b/fs/verity/measure.c index 3969d54158d1..7af0f7f8a6f3 100644 --- a/fs/verity/measure.c +++ b/fs/verity/measure.c @@ -117,8 +117,9 @@ __bpf_kfunc_start_defs(); * * Return: 0 on success, a negative value on error. */ -__bpf_kfunc int bpf_get_fsverity_digest(struct file *file, struct bpf_dynptr_kern *digest_ptr) +__bpf_kfunc int bpf_get_fsverity_digest(struct file *file, struct bpf_dynptr *digest_p) { + struct bpf_dynptr_kern *digest_ptr = (struct bpf_dynptr_kern *)digest_p; const struct inode *inode = file_inode(file); u32 dynptr_sz = __bpf_dynptr_size(digest_ptr); struct fsverity_digest *arg; diff --git a/include/linux/bpf.h b/include/linux/bpf.h index a834f4b761bc..f636b4998bf7 100644 --- a/include/linux/bpf.h +++ b/include/linux/bpf.h @@ -3265,8 +3265,8 @@ u32 bpf_sock_convert_ctx_access(enum bpf_access_type type, struct bpf_insn *insn_buf, struct bpf_prog *prog, u32 *target_size); -int bpf_dynptr_from_skb_rdonly(struct sk_buff *skb, u64 flags, - struct bpf_dynptr_kern *ptr); +int bpf_dynptr_from_skb_rdonly(struct __sk_buff *skb, u64 flags, + struct bpf_dynptr *ptr); #else static inline bool bpf_sock_common_is_valid_access(int off, int size, enum bpf_access_type type, @@ -3288,8 +3288,8 @@ static inline u32 bpf_sock_convert_ctx_access(enum bpf_access_type type, { return 0; } -static inline int bpf_dynptr_from_skb_rdonly(struct sk_buff *skb, u64 flags, - struct bpf_dynptr_kern *ptr) +static inline int bpf_dynptr_from_skb_rdonly(struct __sk_buff *skb, u64 flags, + struct bpf_dynptr *ptr) { return -EOPNOTSUPP; } diff --git a/kernel/bpf/crypto.c b/kernel/bpf/crypto.c index 2bee4af91e38..3c1de0e5c0bd 100644 --- a/kernel/bpf/crypto.c +++ b/kernel/bpf/crypto.c @@ -311,11 +311,15 @@ static int bpf_crypto_crypt(const struct bpf_crypto_ctx *ctx, * Decrypts provided buffer using IV data and the crypto context. Crypto context must be configured. */ __bpf_kfunc int bpf_crypto_decrypt(struct bpf_crypto_ctx *ctx, - const struct bpf_dynptr_kern *src, - const struct bpf_dynptr_kern *dst, - const struct bpf_dynptr_kern *siv) + const struct bpf_dynptr *src, + const struct bpf_dynptr *dst, + const struct bpf_dynptr *siv) { - return bpf_crypto_crypt(ctx, src, dst, siv, true); + const struct bpf_dynptr_kern *src_kern = (struct bpf_dynptr_kern *)src; + const struct bpf_dynptr_kern *dst_kern = (struct bpf_dynptr_kern *)dst; + const struct bpf_dynptr_kern *siv_kern = (struct bpf_dynptr_kern *)siv; + + return bpf_crypto_crypt(ctx, src_kern, dst_kern, siv_kern, true); } /** @@ -328,11 +332,15 @@ __bpf_kfunc int bpf_crypto_decrypt(struct bpf_crypto_ctx *ctx, * Encrypts provided buffer using IV data and the crypto context. Crypto context must be configured. */ __bpf_kfunc int bpf_crypto_encrypt(struct bpf_crypto_ctx *ctx, - const struct bpf_dynptr_kern *src, - const struct bpf_dynptr_kern *dst, - const struct bpf_dynptr_kern *siv) + const struct bpf_dynptr *src, + const struct bpf_dynptr *dst, + const struct bpf_dynptr *siv) { - return bpf_crypto_crypt(ctx, src, dst, siv, false); + const struct bpf_dynptr_kern *src_kern = (struct bpf_dynptr_kern *)src; + const struct bpf_dynptr_kern *dst_kern = (struct bpf_dynptr_kern *)dst; + const struct bpf_dynptr_kern *siv_kern = (struct bpf_dynptr_kern *)siv; + + return bpf_crypto_crypt(ctx, src_kern, dst_kern, siv_kern, false); } __bpf_kfunc_end_defs(); diff --git a/kernel/bpf/helpers.c b/kernel/bpf/helpers.c index 6f1abcb4b084..3ac521c48bba 100644 --- a/kernel/bpf/helpers.c +++ b/kernel/bpf/helpers.c @@ -2459,9 +2459,10 @@ __bpf_kfunc struct task_struct *bpf_task_from_pid(s32 pid) * provided buffer, with its contents containing the data, if unable to obtain * direct pointer) */ -__bpf_kfunc void *bpf_dynptr_slice(const struct bpf_dynptr_kern *ptr, u32 offset, +__bpf_kfunc void *bpf_dynptr_slice(const struct bpf_dynptr *p, u32 offset, void *buffer__opt, u32 buffer__szk) { + const struct bpf_dynptr_kern *ptr = (struct bpf_dynptr_kern *)p; enum bpf_dynptr_type type; u32 len = buffer__szk; int err; @@ -2543,9 +2544,11 @@ __bpf_kfunc void *bpf_dynptr_slice(const struct bpf_dynptr_kern *ptr, u32 offset * provided buffer, with its contents containing the data, if unable to obtain * direct pointer) */ -__bpf_kfunc void *bpf_dynptr_slice_rdwr(const struct bpf_dynptr_kern *ptr, u32 offset, +__bpf_kfunc void *bpf_dynptr_slice_rdwr(const struct bpf_dynptr *p, u32 offset, void *buffer__opt, u32 buffer__szk) { + const struct bpf_dynptr_kern *ptr = (struct bpf_dynptr_kern *)p; + if (!ptr->data || __bpf_dynptr_is_rdonly(ptr)) return NULL; @@ -2571,11 +2574,12 @@ __bpf_kfunc void *bpf_dynptr_slice_rdwr(const struct bpf_dynptr_kern *ptr, u32 o * will be copied out into the buffer and the user will need to call * bpf_dynptr_write() to commit changes. */ - return bpf_dynptr_slice(ptr, offset, buffer__opt, buffer__szk); + return bpf_dynptr_slice(p, offset, buffer__opt, buffer__szk); } -__bpf_kfunc int bpf_dynptr_adjust(struct bpf_dynptr_kern *ptr, u32 start, u32 end) +__bpf_kfunc int bpf_dynptr_adjust(const struct bpf_dynptr *p, u32 start, u32 end) { + struct bpf_dynptr_kern *ptr = (struct bpf_dynptr_kern *)p; u32 size; if (!ptr->data || start > end) @@ -2592,36 +2596,45 @@ __bpf_kfunc int bpf_dynptr_adjust(struct bpf_dynptr_kern *ptr, u32 start, u32 en return 0; } -__bpf_kfunc bool bpf_dynptr_is_null(struct bpf_dynptr_kern *ptr) +__bpf_kfunc bool bpf_dynptr_is_null(const struct bpf_dynptr *p) { + struct bpf_dynptr_kern *ptr = (struct bpf_dynptr_kern *)p; + return !ptr->data; } -__bpf_kfunc bool bpf_dynptr_is_rdonly(struct bpf_dynptr_kern *ptr) +__bpf_kfunc bool bpf_dynptr_is_rdonly(const struct bpf_dynptr *p) { + struct bpf_dynptr_kern *ptr = (struct bpf_dynptr_kern *)p; + if (!ptr->data) return false; return __bpf_dynptr_is_rdonly(ptr); } -__bpf_kfunc __u32 bpf_dynptr_size(const struct bpf_dynptr_kern *ptr) +__bpf_kfunc __u32 bpf_dynptr_size(const struct bpf_dynptr *p) { + struct bpf_dynptr_kern *ptr = (struct bpf_dynptr_kern *)p; + if (!ptr->data) return -EINVAL; return __bpf_dynptr_size(ptr); } -__bpf_kfunc int bpf_dynptr_clone(struct bpf_dynptr_kern *ptr, - struct bpf_dynptr_kern *clone__uninit) +__bpf_kfunc int bpf_dynptr_clone(const struct bpf_dynptr *p, + struct bpf_dynptr *clone__uninit) { + struct bpf_dynptr_kern *clone = (struct bpf_dynptr_kern *)clone__uninit; + struct bpf_dynptr_kern *ptr = (struct bpf_dynptr_kern *)p; + if (!ptr->data) { - bpf_dynptr_set_null(clone__uninit); + bpf_dynptr_set_null(clone); return -EINVAL; } - *clone__uninit = *ptr; + *clone = *ptr; return 0; } @@ -2986,7 +2999,9 @@ late_initcall(kfunc_init); */ const void *__bpf_dynptr_data(const struct bpf_dynptr_kern *ptr, u32 len) { - return bpf_dynptr_slice(ptr, 0, NULL, len); + const struct bpf_dynptr *p = (struct bpf_dynptr *)ptr; + + return bpf_dynptr_slice(p, 0, NULL, len); } /* Get a pointer to dynptr data up to len bytes for read write access. If diff --git a/kernel/bpf/verifier.c b/kernel/bpf/verifier.c index 0808beca3837..05491b6de213 100644 --- a/kernel/bpf/verifier.c +++ b/kernel/bpf/verifier.c @@ -10910,7 +10910,7 @@ enum { }; BTF_ID_LIST(kf_arg_btf_ids) -BTF_ID(struct, bpf_dynptr_kern) +BTF_ID(struct, bpf_dynptr) BTF_ID(struct, bpf_list_head) BTF_ID(struct, bpf_list_node) BTF_ID(struct, bpf_rb_root) diff --git a/kernel/trace/bpf_trace.c b/kernel/trace/bpf_trace.c index f5154c051d2c..58ae34b730df 100644 --- a/kernel/trace/bpf_trace.c +++ b/kernel/trace/bpf_trace.c @@ -1378,10 +1378,12 @@ __bpf_kfunc void bpf_key_put(struct bpf_key *bkey) * * Return: 0 on success, a negative value on error. */ -__bpf_kfunc int bpf_verify_pkcs7_signature(struct bpf_dynptr_kern *data_ptr, - struct bpf_dynptr_kern *sig_ptr, +__bpf_kfunc int bpf_verify_pkcs7_signature(struct bpf_dynptr *data_p, + struct bpf_dynptr *sig_p, struct bpf_key *trusted_keyring) { + struct bpf_dynptr_kern *data_ptr = (struct bpf_dynptr_kern *)data_p; + struct bpf_dynptr_kern *sig_ptr = (struct bpf_dynptr_kern *)sig_p; const void *data, *sig; u32 data_len, sig_len; int ret; @@ -1453,8 +1455,9 @@ __bpf_kfunc_start_defs(); * Return: 0 on success, a negative value on error. */ __bpf_kfunc int bpf_get_file_xattr(struct file *file, const char *name__str, - struct bpf_dynptr_kern *value_ptr) + struct bpf_dynptr *value_p) { + struct bpf_dynptr_kern *value_ptr = (struct bpf_dynptr_kern *)value_p; struct dentry *dentry; u32 value_len; void *value; diff --git a/net/core/filter.c b/net/core/filter.c index 7c46ecba3b01..73722790cee3 100644 --- a/net/core/filter.c +++ b/net/core/filter.c @@ -11859,28 +11859,34 @@ bpf_sk_base_func_proto(enum bpf_func_id func_id, const struct bpf_prog *prog) } __bpf_kfunc_start_defs(); -__bpf_kfunc int bpf_dynptr_from_skb(struct sk_buff *skb, u64 flags, - struct bpf_dynptr_kern *ptr__uninit) +__bpf_kfunc int bpf_dynptr_from_skb(struct __sk_buff *s, u64 flags, + struct bpf_dynptr *ptr__uninit) { + struct bpf_dynptr_kern *ptr = (struct bpf_dynptr_kern *)ptr__uninit; + struct sk_buff *skb = (struct sk_buff *)s; + if (flags) { - bpf_dynptr_set_null(ptr__uninit); + bpf_dynptr_set_null(ptr); return -EINVAL; } - bpf_dynptr_init(ptr__uninit, skb, BPF_DYNPTR_TYPE_SKB, 0, skb->len); + bpf_dynptr_init(ptr, skb, BPF_DYNPTR_TYPE_SKB, 0, skb->len); return 0; } -__bpf_kfunc int bpf_dynptr_from_xdp(struct xdp_buff *xdp, u64 flags, - struct bpf_dynptr_kern *ptr__uninit) +__bpf_kfunc int bpf_dynptr_from_xdp(struct xdp_md *x, u64 flags, + struct bpf_dynptr *ptr__uninit) { + struct bpf_dynptr_kern *ptr = (struct bpf_dynptr_kern *)ptr__uninit; + struct xdp_buff *xdp = (struct xdp_buff *)x; + if (flags) { - bpf_dynptr_set_null(ptr__uninit); + bpf_dynptr_set_null(ptr); return -EINVAL; } - bpf_dynptr_init(ptr__uninit, xdp, BPF_DYNPTR_TYPE_XDP, 0, xdp_get_buff_len(xdp)); + bpf_dynptr_init(ptr, xdp, BPF_DYNPTR_TYPE_XDP, 0, xdp_get_buff_len(xdp)); return 0; } @@ -11906,10 +11912,11 @@ __bpf_kfunc int bpf_sock_addr_set_sun_path(struct bpf_sock_addr_kern *sa_kern, return 0; } -__bpf_kfunc int bpf_sk_assign_tcp_reqsk(struct sk_buff *skb, struct sock *sk, +__bpf_kfunc int bpf_sk_assign_tcp_reqsk(struct __sk_buff *s, struct sock *sk, struct bpf_tcp_req_attrs *attrs, int attrs__sz) { #if IS_ENABLED(CONFIG_SYN_COOKIES) + struct sk_buff *skb = (struct sk_buff *)s; const struct request_sock_ops *ops; struct inet_request_sock *ireq; struct tcp_request_sock *treq; @@ -12004,16 +12011,17 @@ __bpf_kfunc int bpf_sk_assign_tcp_reqsk(struct sk_buff *skb, struct sock *sk, __bpf_kfunc_end_defs(); -int bpf_dynptr_from_skb_rdonly(struct sk_buff *skb, u64 flags, - struct bpf_dynptr_kern *ptr__uninit) +int bpf_dynptr_from_skb_rdonly(struct __sk_buff *skb, u64 flags, + struct bpf_dynptr *ptr__uninit) { + struct bpf_dynptr_kern *ptr = (struct bpf_dynptr_kern *)ptr__uninit; int err; err = bpf_dynptr_from_skb(skb, flags, ptr__uninit); if (err) return err; - bpf_dynptr_set_rdonly(ptr__uninit); + bpf_dynptr_set_rdonly(ptr); return 0; } diff --git a/tools/testing/selftests/bpf/progs/ip_check_defrag.c b/tools/testing/selftests/bpf/progs/ip_check_defrag.c index 1c2b6c1616b0..645b2c9f7867 100644 --- a/tools/testing/selftests/bpf/progs/ip_check_defrag.c +++ b/tools/testing/selftests/bpf/progs/ip_check_defrag.c @@ -12,7 +12,7 @@ #define IP_OFFSET 0x1FFF #define NEXTHDR_FRAGMENT 44 -extern int bpf_dynptr_from_skb(struct sk_buff *skb, __u64 flags, +extern int bpf_dynptr_from_skb(struct __sk_buff *skb, __u64 flags, struct bpf_dynptr *ptr__uninit) __ksym; extern void *bpf_dynptr_slice(const struct bpf_dynptr *ptr, uint32_t offset, void *buffer, uint32_t buffer__sz) __ksym; @@ -42,7 +42,7 @@ static bool is_frag_v6(struct ipv6hdr *ip6h) return ip6h->nexthdr == NEXTHDR_FRAGMENT; } -static int handle_v4(struct sk_buff *skb) +static int handle_v4(struct __sk_buff *skb) { struct bpf_dynptr ptr; u8 iph_buf[20] = {}; @@ -64,7 +64,7 @@ static int handle_v4(struct sk_buff *skb) return NF_ACCEPT; } -static int handle_v6(struct sk_buff *skb) +static int handle_v6(struct __sk_buff *skb) { struct bpf_dynptr ptr; struct ipv6hdr *ip6h; @@ -89,9 +89,9 @@ static int handle_v6(struct sk_buff *skb) SEC("netfilter") int defrag(struct bpf_nf_ctx *ctx) { - struct sk_buff *skb = ctx->skb; + struct __sk_buff *skb = (struct __sk_buff *)ctx->skb; - switch (bpf_ntohs(skb->protocol)) { + switch (bpf_ntohs(ctx->skb->protocol)) { case ETH_P_IP: return handle_v4(skb); case ETH_P_IPV6: diff --git a/tools/testing/selftests/bpf/progs/verifier_netfilter_ctx.c b/tools/testing/selftests/bpf/progs/verifier_netfilter_ctx.c index 65bba330e7e5..ab9f9f2620ed 100644 --- a/tools/testing/selftests/bpf/progs/verifier_netfilter_ctx.c +++ b/tools/testing/selftests/bpf/progs/verifier_netfilter_ctx.c @@ -79,7 +79,7 @@ int with_invalid_ctx_access_test5(struct bpf_nf_ctx *ctx) return NF_ACCEPT; } -extern int bpf_dynptr_from_skb(struct sk_buff *skb, __u64 flags, +extern int bpf_dynptr_from_skb(struct __sk_buff *skb, __u64 flags, struct bpf_dynptr *ptr__uninit) __ksym; extern void *bpf_dynptr_slice(const struct bpf_dynptr *ptr, uint32_t offset, void *buffer, uint32_t buffer__sz) __ksym; @@ -90,8 +90,8 @@ __success __failure_unpriv __retval(0) int with_valid_ctx_access_test6(struct bpf_nf_ctx *ctx) { + struct __sk_buff *skb = (struct __sk_buff *)ctx->skb; const struct nf_hook_state *state = ctx->state; - struct sk_buff *skb = ctx->skb; const struct iphdr *iph; const struct tcphdr *th; u8 buffer_iph[20] = {}; @@ -99,7 +99,7 @@ int with_valid_ctx_access_test6(struct bpf_nf_ctx *ctx) struct bpf_dynptr ptr; uint8_t ihl; - if (skb->len <= 20 || bpf_dynptr_from_skb(skb, 0, &ptr)) + if (ctx->skb->len <= 20 || bpf_dynptr_from_skb(skb, 0, &ptr)) return NF_ACCEPT; iph = bpf_dynptr_slice(&ptr, 0, buffer_iph, sizeof(buffer_iph)); From patchwork Sat Jun 8 21:16:06 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Xu X-Patchwork-Id: 802732 Received: from wflow3-smtp.messagingengine.com (wflow3-smtp.messagingengine.com [64.147.123.138]) (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 3D7816F2E8; Sat, 8 Jun 2024 21:17:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=64.147.123.138 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717881423; cv=none; b=ny2k8WamZQfrv9x0V50kIZ3MrFWIE7Upq6wTp9nO71OTInrjwMNByKyYOax5Gr/ow3Nnxw2Z/cTc6/Tut9yG/VZQpIyeZ43pnj9htHLcSGm+ndvMKfbBldnyYb+0T6GdGJm7pfxBKPrQ7rxMB7d/P06ciA15aOId3XuPJ677Kg8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717881423; c=relaxed/simple; bh=8wcWIDJV9i7uVZzCddioETI3Y4rYvL9XxaTQ0tokYQU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=boc2WpQ7dUs+e4Dt7DmsrQuXfB28nQ7GgfwwhtZPv/ilOfzuFtEnmifi67zirqXse8qtJdPpWbbPrbnqSVGF8n75bGFvOLDRjkj8pwNgoFp3Mph35zHQDufMZ+TwKWdN/JuXt2TabGwZj8CmGzKystsDHE94rc9Kubi6SzISmAo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=dxuuu.xyz; spf=pass smtp.mailfrom=dxuuu.xyz; dkim=pass (2048-bit key) header.d=dxuuu.xyz header.i=@dxuuu.xyz header.b=CcNV3p3s; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=If4OpJ7u; arc=none smtp.client-ip=64.147.123.138 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=dxuuu.xyz Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=dxuuu.xyz Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=dxuuu.xyz header.i=@dxuuu.xyz header.b="CcNV3p3s"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="If4OpJ7u" Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailflow.west.internal (Postfix) with ESMTP id E2B9F2CC011E; Sat, 8 Jun 2024 17:16:59 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Sat, 08 Jun 2024 17:17:01 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dxuuu.xyz; h=cc :cc:content-transfer-encoding:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to; s=fm3; t=1717881419; x= 1717888619; bh=rw3uf/fg2XLXP7lcRjaOwMtzCT7fUDyYAtYnSUPZFmc=; b=C cNV3p3s/eWMl4UxvEduML/8284ozg7gEr+LqFFxTgKt626JgTKZv5aqC1PpUuB0M sx3Y2L65Ui95N55JTVibsrz5NHmEcg7V3DNuRfNvpYKlFS9ZNNnULcImQC2vVMDT TJDPfLX+bQyfZVdANpmkVDRWh4aqFR/X/4Dh84CCXJ0CGYYpxSv2eHhJ62rfdl60 COKChuVlk9pxoTWZhrn9mFCFY0yPz6WN3htAjGoY2S5Gejk1yxqoXzx4+b4WsxQo IEQnWKqsi+kV8+6SeB3cfF4QBaGeYNDPex2Q2bQ3ooIw5jAAtbLiJbLLAetTYZP9 pUPnIcJZBWL7nbXgcMWTg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t=1717881419; x= 1717888619; bh=rw3uf/fg2XLXP7lcRjaOwMtzCT7fUDyYAtYnSUPZFmc=; b=I f4OpJ7uXjgE5l3MczCb0iCGduhsABFoZ9QLrnYQzGQpl6MaJ0utIraGTwQ4eG88N a80Pc9BxYqYXopLs6oXI5S3Ej2yxy9h11NkzC+C6jmGcxUNyFiG1f7PczOkG0/v1 sIdiPgokpT11FffLskjSXuIHnM1ADDLCPY3CTbqB3ammHAOqCuTK4yGvCycMbfqu 2E+0kK93fET/sng9yz22nxnZowQ5g6rJ5VGO2+XNQx6RLtm8QeRaaDDtrnB6hu2v /biQVnQerjEfu7BKJ2IskFt5P0NWgHaBShx7xCg3PiSDSANk4p4F/yhnfn6irsNp CTE5UI8Dxco9c2BqsRpuw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrfedtgedgleefucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucgfrhhlucfvnfffucdljedtmdenucfjughrpefhvf evufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpeffrghnihgvlhcuighuuceo ugiguhesugiguhhuuhdrgiihiieqnecuggftrfgrthhtvghrnhepgfefgfegjefhudeike dvueetffelieefuedvhfehjeeljeejkefgffeghfdttdetnecuvehluhhsthgvrhfuihii vgepudenucfrrghrrghmpehmrghilhhfrhhomhepugiguhesugiguhhuuhdrgiihii X-ME-Proxy: Feedback-ID: i6a694271:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sat, 8 Jun 2024 17:16:57 -0400 (EDT) From: Daniel Xu To: shuah@kernel.org, ast@kernel.org, andrii@kernel.org, eddyz87@gmail.com, davem@davemloft.net, daniel@iogearbox.net, hawk@kernel.org, kuba@kernel.org, john.fastabend@gmail.com, olsajiri@gmail.com, quentin@isovalent.com, alan.maguire@oracle.com, acme@kernel.org Cc: mykolal@fb.com, martin.lau@linux.dev, song@kernel.org, yonghong.song@linux.dev, kpsingh@kernel.org, sdf@google.com, haoluo@google.com, jolsa@kernel.org, bpf@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, netdev@vger.kernel.org, kernel-team@meta.com Subject: [PATCH bpf-next v4 10/12] bpf: selftests: nf: Opt out of using generated kfunc prototypes Date: Sat, 8 Jun 2024 15:16:06 -0600 Message-ID: X-Mailer: git-send-email 2.44.0 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kselftest@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 The bpf-nf selftests play various games with aliased types such that folks with CONFIG_NF_CONNTRACK=m/n configs can still build the selftests. See commits: 1058b6a78db2 ("selftests/bpf: Do not fail build if CONFIG_NF_CONNTRACK=m/n") 92afc5329a5b ("selftests/bpf: Fix build errors if CONFIG_NF_CONNTRACK=m") Thus, it is simpler if these selftests opt out of using generated kfunc prototypes. The preprocessor macro this commit uses will be introduced in the final commit. Signed-off-by: Daniel Xu --- tools/testing/selftests/bpf/progs/test_bpf_nf.c | 1 + tools/testing/selftests/bpf/progs/test_bpf_nf_fail.c | 1 + tools/testing/selftests/bpf/progs/xdp_synproxy_kern.c | 1 + 3 files changed, 3 insertions(+) diff --git a/tools/testing/selftests/bpf/progs/test_bpf_nf.c b/tools/testing/selftests/bpf/progs/test_bpf_nf.c index 0289d8ce2b80..f7b330ddd007 100644 --- a/tools/testing/selftests/bpf/progs/test_bpf_nf.c +++ b/tools/testing/selftests/bpf/progs/test_bpf_nf.c @@ -1,4 +1,5 @@ // SPDX-License-Identifier: GPL-2.0 +#define BPF_NO_KFUNC_PROTOTYPES #include #include #include diff --git a/tools/testing/selftests/bpf/progs/test_bpf_nf_fail.c b/tools/testing/selftests/bpf/progs/test_bpf_nf_fail.c index 0e4759ab38ff..a586f087ffeb 100644 --- a/tools/testing/selftests/bpf/progs/test_bpf_nf_fail.c +++ b/tools/testing/selftests/bpf/progs/test_bpf_nf_fail.c @@ -1,4 +1,5 @@ // SPDX-License-Identifier: GPL-2.0 +#define BPF_NO_KFUNC_PROTOTYPES #include #include #include diff --git a/tools/testing/selftests/bpf/progs/xdp_synproxy_kern.c b/tools/testing/selftests/bpf/progs/xdp_synproxy_kern.c index 7ea9785738b5..f8f5dc9f72b8 100644 --- a/tools/testing/selftests/bpf/progs/xdp_synproxy_kern.c +++ b/tools/testing/selftests/bpf/progs/xdp_synproxy_kern.c @@ -1,6 +1,7 @@ // SPDX-License-Identifier: LGPL-2.1 OR BSD-2-Clause /* Copyright (c) 2022, NVIDIA CORPORATION & AFFILIATES. All rights reserved. */ +#define BPF_NO_KFUNC_PROTOTYPES #include "vmlinux.h" #include From patchwork Sat Jun 8 21:16:07 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Xu X-Patchwork-Id: 802847 Received: from wflow3-smtp.messagingengine.com (wflow3-smtp.messagingengine.com [64.147.123.138]) (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 B8B9B6F31D; Sat, 8 Jun 2024 21:17:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=64.147.123.138 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717881427; cv=none; b=sGXI/u9Hwbmn80wyOGpFsM7xbNV1KqpeTY4NCRdG+qEF7WiRFQbDdJl6XVI8DTrGcuNwnZXydeTby+jnTcQ3y7KOR6zohK+ngFhjcu/xUT9t8sDrvmKviXptx/Ncam0XD3EjgNqAxTe74GdF+Yx0JEhfeHNLu3JosNtJKOTwRkQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717881427; c=relaxed/simple; bh=TOFne6BN9+jp4V2XtWfmJB9qi/B/gw1rR+0HcAVMVvc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=WnbZVct2Lf/7VRiGxrFyZzaFlyBBQIDR7j/X32Soxure5lCqj8ybApoDi4Y/MXzTpcwrp5si+YPcxLqXJ+4Kh7ALdy/LSVSJijZvQK7oyA1k4s631OJxM+qS4kEMYeIIRirh0GKVOq1u82ENhGjOoVG4yqNTSnFn/RNt4oC7gWM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=dxuuu.xyz; spf=pass smtp.mailfrom=dxuuu.xyz; dkim=pass (2048-bit key) header.d=dxuuu.xyz header.i=@dxuuu.xyz header.b=Qt2ZFZco; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=EIN54Bk8; arc=none smtp.client-ip=64.147.123.138 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=dxuuu.xyz Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=dxuuu.xyz Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=dxuuu.xyz header.i=@dxuuu.xyz header.b="Qt2ZFZco"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="EIN54Bk8" Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailflow.west.internal (Postfix) with ESMTP id D698C2CC0121; Sat, 8 Jun 2024 17:17:03 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Sat, 08 Jun 2024 17:17:05 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dxuuu.xyz; h=cc :cc:content-transfer-encoding:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to; s=fm3; t=1717881423; x= 1717888623; bh=NBRZD+tUpDA7hRgb1FdxgpatpLh/bjjqfKZS5VAHywE=; b=Q t2ZFZcoieHlaIp6SXK2XqhL/KrkGCqMkN+MnDLQxXc5Q0JP+PwWcnhoBcCEt3BPw +0epaVdMuyZz7F5dr6V+eJX3yEbvTZPgcE3nVkTDM2floiJvBNqtrCvzOc1Ujsmu netPRox+O5cZK/yadVT4Dbp9vgg350PqYJK1oO00N2GPN2HrJgJbC5qnCVcuy1nE OQ8VduoHt+hAUmHiwiylfC/ZcSVTNqCz4CZxYhLzt9UidND3GwMX9ckjItWdoBcL 69JgLf13rhobypijpEmoqe5ozpNtWdRz99Tj8SfHNGZF+QEbszdqtnEWLJJgtSJS nf13Mrk+xh/x5pctEG6kw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t=1717881423; x= 1717888623; bh=NBRZD+tUpDA7hRgb1FdxgpatpLh/bjjqfKZS5VAHywE=; b=E IN54Bk8Is881T7yYbSg2jDeW4l1NVcSny1JbaM9XodDKsoXGl7ee+bOyjPac7V+2 KNYfEukbIZjtqRrpFCh2e+zsPssVmeRv8u/nJqGXTpQMGxfl+FaR2q138j+qch2i 4zIAuC1VouVrUhdRk74kAiTN3HTIfk4t4hQLW2hm8sWODvOYeat6D6l89UrMIRn5 dTyC5qKS3GkKb9oGY0BmQPAvsFy2oZtBTc0p56WTqEPG9nUPsLu8hOjUSnpJWDtL E56ba8Bd6zBSFLPwCiUakgSW315SzMbDysQ1GfgNZ59Kb0GWJqzLNEE2BcsCgDlU yr44gpw0wBCvDUEEOmd0g== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrfedtgedgleegucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucgfrhhlucfvnfffucdljedtmdenucfjughrpefhvf evufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpeffrghnihgvlhcuighuuceo ugiguhesugiguhhuuhdrgiihiieqnecuggftrfgrthhtvghrnhepgfefgfegjefhudeike dvueetffelieefuedvhfehjeeljeejkefgffeghfdttdetnecuvehluhhsthgvrhfuihii vgepudenucfrrghrrghmpehmrghilhhfrhhomhepugiguhesugiguhhuuhdrgiihii X-ME-Proxy: Feedback-ID: i6a694271:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sat, 8 Jun 2024 17:17:01 -0400 (EDT) From: Daniel Xu To: shuah@kernel.org, daniel@iogearbox.net, andrii@kernel.org, eddyz87@gmail.com, ast@kernel.org, olsajiri@gmail.com, quentin@isovalent.com, alan.maguire@oracle.com, acme@kernel.org Cc: mykolal@fb.com, martin.lau@linux.dev, song@kernel.org, yonghong.song@linux.dev, john.fastabend@gmail.com, kpsingh@kernel.org, sdf@google.com, haoluo@google.com, jolsa@kernel.org, bpf@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-team@meta.com Subject: [PATCH bpf-next v4 11/12] bpf: selftests: xfrm: Opt out of using generated kfunc prototypes Date: Sat, 8 Jun 2024 15:16:07 -0600 Message-ID: X-Mailer: git-send-email 2.44.0 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kselftest@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 The xfrm_info selftest locally defines an aliased type such that folks with CONFIG_XFRM_INTERFACE=m/n configs can still build the selftests. See commit aa67961f3243 ("selftests/bpf: Allow building bpf tests with CONFIG_XFRM_INTERFACE=[m|n]"). Thus, it is simpler if this selftest opts out of using enerated kfunc prototypes. The preprocessor macro this commit uses will be introduced in the final commit. Signed-off-by: Daniel Xu --- tools/testing/selftests/bpf/progs/xfrm_info.c | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/testing/selftests/bpf/progs/xfrm_info.c b/tools/testing/selftests/bpf/progs/xfrm_info.c index f6a501fbba2b..a1d9f106c3f0 100644 --- a/tools/testing/selftests/bpf/progs/xfrm_info.c +++ b/tools/testing/selftests/bpf/progs/xfrm_info.c @@ -1,4 +1,5 @@ // SPDX-License-Identifier: GPL-2.0 +#define BPF_NO_KFUNC_PROTOTYPES #include "vmlinux.h" #include "bpf_tracing_net.h" #include