Skip to contentSkip to conversation

bpf: merge two CONFIG_BPF entries

PATCH Applied Masahiro Yamada 3 participants 5 messages Feb 4, 2024 – Feb 8, 2024 BPF

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 bpf: merge two CONFIG_BPF entries

'config BPF' exists in both init/Kconfig and kernel/bpf/Kconfig.

Commit b24abcff918a ("bpf, kconfig: Add consolidated menu entry for bpf with core options") added the second one to kernel/bpf/Kconfig instead of moving the existing one.

Merge them together.

---

 init/Kconfig       | 5 -----
 kernel/bpf/Kconfig | 1 +
 2 files changed, 1 insertion(+), 5 deletions(-)
init/Kconfig +0 -5
index 8d4e836e1b6b..46ccad83a664 100644
@@ -1457,11 +1457,6 @@ config SYSCTL_ARCH_UNALIGN_ALLOW
 config HAVE_PCSPKR_PLATFORM
 	bool
 
-# interpreter that classic socket filters depend on
-config BPF
-	bool
-	select CRYPTO_LIB_SHA1
-
 menuconfig EXPERT
 	bool "Configure standard kernel features (expert users)"
 	# Unhide debug options, to make the on-by-default options visible
kernel/bpf/Kconfig +1 -0
index 6a906ff93006..bc25f5098a25 100644
@@ -3,6 +3,7 @@
 # BPF interpreter that, for example, classic socket filters depend on.
 config BPF
 	bool
+	select CRYPTO_LIB_SHA1
 
 # Used by archs to tell that they support BPF JIT compiler plus which
 # flavour. Only one of the two can be selected for a specific arch since
Signature · 1 line
2.40.1
reviewer
#1 lore raw
Quoted 36 lines · Masahiro Yamada

'config BPF' exists in both init/Kconfig and kernel/bpf/Kconfig.

Commit b24abcff918a ("bpf, kconfig: Add consolidated menu entry for bpf with core options") added the second one to kernel/bpf/Kconfig instead of moving the existing one.

Merge them together.

---

  init/Kconfig       | 5 -----
  kernel/bpf/Kconfig | 1 +
  2 files changed, 1 insertion(+), 5 deletions(-)
init/Kconfig +0 -5
index 8d4e836e1b6b..46ccad83a664 100644
@@ -1457,11 +1457,6 @@ config SYSCTL_ARCH_UNALIGN_ALLOW
  config HAVE_PCSPKR_PLATFORM
  	bool
 
-# interpreter that classic socket filters depend on
-config BPF
-	bool
-	select CRYPTO_LIB_SHA1
-
  menuconfig EXPERT
  	bool "Configure standard kernel features (expert users)"
  	# Unhide debug options, to make the on-by-default options visible
kernel/bpf/Kconfig +0 -0
index 6a906ff93006..bc25f5098a25 100644

kernel/bpf/Kconfig line 6

Quoted 4 lines
kernel/bpf/Kconfig +1 -0
@@ -3,6 +3,7 @@
  # BPF interpreter that, for example, classic socket filters depend on.
  config BPF
  	bool
+	select CRYPTO_LIB_SHA1

Currently, the kernel/bpf directory is guarded with CONFIG_BPF
obj-$(CONFIG_BPF) += bpf/
in kernel/bpf/Makefile.

Your patch probably works since there are lots of some other BPF related configurations which requires CONFIG_BPF. But maybe we sould keep 'config BPF' in init/Kconfig and remove 'config BPF'
in kernel/bpf/Kconfig. This will be less confusing?

Quoted 3 lines
kernel/bpf/Kconfig +0 -0
  # Used by archs to tell that they support BPF JIT compiler plus which
  # flavour. Only one of the two can be selected for a specific arch since
#2 lore raw
Quoted 39 lines · Yonghong Song
Quoted 36 lines · Masahiro Yamada

'config BPF' exists in both init/Kconfig and kernel/bpf/Kconfig.

Commit b24abcff918a ("bpf, kconfig: Add consolidated menu entry for bpf with core options") added the second one to kernel/bpf/Kconfig instead of moving the existing one.

Merge them together.

---

  init/Kconfig       | 5 -----
  kernel/bpf/Kconfig | 1 +
  2 files changed, 1 insertion(+), 5 deletions(-)
init/Kconfig +0 -5
index 8d4e836e1b6b..46ccad83a664 100644
@@ -1457,11 +1457,6 @@ config SYSCTL_ARCH_UNALIGN_ALLOW
  config HAVE_PCSPKR_PLATFORM
      bool
 
-# interpreter that classic socket filters depend on
-config BPF
-     bool
-     select CRYPTO_LIB_SHA1
-
  menuconfig EXPERT
      bool "Configure standard kernel features (expert users)"
      # Unhide debug options, to make the on-by-default options visible
kernel/bpf/Kconfig +0 -0
index 6a906ff93006..bc25f5098a25 100644
@@ -3,6 +3,7 @@
Quoted 8 lines

kernel/bpf/Kconfig line 6

Quoted 4 lines
kernel/bpf/Kconfig +1 -0
  # BPF interpreter that, for example, classic socket filters depend on.
  config BPF
      bool
+     select CRYPTO_LIB_SHA1

Currently, the kernel/bpf directory is guarded with CONFIG_BPF
obj-$(CONFIG_BPF) += bpf/
in kernel/bpf/Makefile.

Wrong.

"in kernel/Makefile".

Why is it related to this patch?

Quoted 4 lines

Your patch probably works since there are lots of some other BPF related configurations which requires CONFIG_BPF. But maybe we sould keep 'config BPF' in init/Kconfig and remove 'config BPF'
in kernel/bpf/Kconfig. This will be less confusing?

Why?

Quoted 3 lines
Quoted 3 lines
kernel/bpf/Kconfig +0 -0
  # Used by archs to tell that they support BPF JIT compiler plus which
  # flavour. Only one of the two can be selected for a specific arch since
Signature · 2 lines
Best Regards
Masahiro Yamada
reviewer Acked-by
#3 lore raw
Quoted 47 lines · Masahiro Yamada
Quoted 43 lines · Yonghong Song
Quoted 36 lines · Masahiro Yamada

'config BPF' exists in both init/Kconfig and kernel/bpf/Kconfig.

Commit b24abcff918a ("bpf, kconfig: Add consolidated menu entry for bpf with core options") added the second one to kernel/bpf/Kconfig instead of moving the existing one.

Merge them together.

---

   init/Kconfig       | 5 -----
   kernel/bpf/Kconfig | 1 +
   2 files changed, 1 insertion(+), 5 deletions(-)
init/Kconfig +0 -5
index 8d4e836e1b6b..46ccad83a664 100644
@@ -1457,11 +1457,6 @@ config SYSCTL_ARCH_UNALIGN_ALLOW
   config HAVE_PCSPKR_PLATFORM
       bool
 
-# interpreter that classic socket filters depend on
-config BPF
-     bool
-     select CRYPTO_LIB_SHA1
-
   menuconfig EXPERT
       bool "Configure standard kernel features (expert users)"
       # Unhide debug options, to make the on-by-default options visible
kernel/bpf/Kconfig +0 -0
index 6a906ff93006..bc25f5098a25 100644

kernel/bpf/Kconfig line 6

Quoted 4 lines
kernel/bpf/Kconfig +1 -0
@@ -3,6 +3,7 @@
   # BPF interpreter that, for example, classic socket filters depend on.
   config BPF
       bool
+     select CRYPTO_LIB_SHA1

Currently, the kernel/bpf directory is guarded with CONFIG_BPF

Quoted 2 lines
    obj-$(CONFIG_BPF) += bpf/

in kernel/bpf/Makefile.

Quoted 6 lines

Wrong.

"in kernel/Makefile".

Why is it related to this patch?

Sorry, my obvious mistake.

Quoted 9 lines
Quoted 7 lines

Your patch probably works since there are lots of some other BPF related configurations which requires CONFIG_BPF. But maybe we sould keep 'config BPF' in init/Kconfig and remove 'config BPF'
in kernel/bpf/Kconfig. This will be less confusing?

Why?

The 'less confusing' part is just my initial feeling. I found some CGROUP related configs are defined in init/Kconfig but not under kernel/cgroup directory. So I thought 'config BPF' could stay in init/Kconfig as well.

But I just did some other checking. For example, 'config NET' is actually under 'net' directory. So probably you are right, let us remove the one in init/Kconfig and use the one in kernel/bpf/Kconfig.

So

Quoted 7 lines
Quoted 5 lines
Quoted 5 lines
kernel/bpf/Kconfig +0 -0
   # Used by archs to tell that they support BPF JIT compiler plus which
   # flavour. Only one of the two can be selected for a specific arch since
#4 lore raw
In reply to Masahiro Yamada
This patch was applied to bpf/bpf-next.git (master) by Andrii Nakryiko <[email protected]>:

Hello:

This patch was applied to bpf/bpf-next.git (master) by Andrii Nakryiko <[email protected]>:

Quoted 9 lines · On Sun, 4 Feb 2024 16:56:34 +0900 you wrote:

'config BPF' exists in both init/Kconfig and kernel/bpf/Kconfig.

Commit b24abcff918a ("bpf, kconfig: Add consolidated menu entry for bpf with core options") added the second one to kernel/bpf/Kconfig instead of moving the existing one.

Merge them together.

[...]

Here is the summary with links:
- bpf: merge two CONFIG_BPF entries

    https://git.kernel.org/bpf/bpf-next/c/e55dad12abe4

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html