public inbox for netdev@vger.kernel.org 
 help / color / mirror / Atom feed
From: Song Liu <song@kernel•org>
To: <bpf@vger•kernel.org>, <netdev@vger•kernel.org>
Cc: <ast@kernel•org>, <daniel@iogearbox•net>, <andrii@kernel•org>,
	<kernel-team@fb•com>, Song Liu <song@kernel•org>,
	kernel test robot <lkp@intel•com>
Subject: [PATCH bpf-next 2/2] bpf: fix bpf_prog_pack build HPAGE_PMD_SIZE
Date: Tue, 8 Feb 2022 14:05:09 -0800	[thread overview]
Message-ID: <20220208220509.4180389-3-song@kernel.org> (raw)
In-Reply-To: <20220208220509.4180389-1-song@kernel.org>

Fix build with CONFIG_TRANSPARENT_HUGEPAGE=n with BPF_PROG_PACK_SIZE as
PAGE_SIZE.

Fixes: 57631054fae6 ("bpf: Introduce bpf_prog_pack allocator")
Reported-by: kernel test robot <lkp@intel•com>
Signed-off-by: Song Liu <song@kernel•org>
---
 kernel/bpf/core.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/kernel/bpf/core.c b/kernel/bpf/core.c
index 306aa63fa58e..9519264ab1ee 100644
--- a/kernel/bpf/core.c
+++ b/kernel/bpf/core.c
@@ -814,7 +814,11 @@ int bpf_jit_add_poke_descriptor(struct bpf_prog *prog,
  * allocator. The prog_pack allocator uses HPAGE_PMD_SIZE page (2MB on x86)
  * to host BPF programs.
  */
+#ifdef CONFIG_TRANSPARENT_HUGEPAGE
 #define BPF_PROG_PACK_SIZE	HPAGE_PMD_SIZE
+#else
+#define BPF_PROG_PACK_SIZE	PAGE_SIZE
+#endif
 #define BPF_PROG_CHUNK_SHIFT	6
 #define BPF_PROG_CHUNK_SIZE	(1 << BPF_PROG_CHUNK_SHIFT)
 #define BPF_PROG_CHUNK_MASK	(~(BPF_PROG_CHUNK_SIZE - 1))
-- 
2.30.2


  parent reply	other threads:[~2022-02-08 22:21 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-08 22:05 [PATCH bpf-next 0/2] fix bpf_prog_pack build errors Song Liu
2022-02-08 22:05 ` [PATCH bpf-next 1/2] bpf: fix leftover header->pages in sparc and powerpc code Song Liu
2022-02-08 22:05 ` Song Liu [this message]
2022-02-10  1:13   ` [PATCH bpf-next 2/2] bpf: fix bpf_prog_pack build HPAGE_PMD_SIZE Eric Dumazet
2022-02-10  5:59     ` Song Liu
2022-02-09  5:20 ` [PATCH bpf-next 0/2] fix bpf_prog_pack build errors patchwork-bot+netdevbpf

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220208220509.4180389-3-song@kernel.org \
    --to=song@kernel$(echo .)org \
    --cc=andrii@kernel$(echo .)org \
    --cc=ast@kernel$(echo .)org \
    --cc=bpf@vger$(echo .)kernel.org \
    --cc=daniel@iogearbox$(echo .)net \
    --cc=kernel-team@fb$(echo .)com \
    --cc=lkp@intel$(echo .)com \
    --cc=netdev@vger$(echo .)kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox