From 8d33aaa5b6ccd579ceb3bdbdfa4e15d8194e970a Mon Sep 17 00:00:00 2001 From: Jan Vaclav Date: Thu, 16 Oct 2025 11:58:57 +0200 Subject: [PATCH] build: drop "ebpf" configuration for n-acd compilation Since we now check whether the user's machine supports eBPF at runtime, we can drop all of this build machinery. --- .gitlab-ci/run-test.sh | 7 +------ contrib/fedora/rpm/NetworkManager.spec | 16 ---------------- contrib/fedora/rpm/configure-for-system.sh | 2 -- contrib/scripts/nm-ci-run.sh | 2 -- meson.build | 14 -------------- meson_options.txt | 2 +- src/meson.build | 2 +- 7 files changed, 3 insertions(+), 42 deletions(-) diff --git a/.gitlab-ci/run-test.sh b/.gitlab-ci/run-test.sh index 44405558c8..b58a1c321b 100755 --- a/.gitlab-ci/run-test.sh +++ b/.gitlab-ci/run-test.sh @@ -155,12 +155,7 @@ test_subtree() { do_clean pushd ./src/$d - ARGS=() - if [ "$d" = n-acd ]; then - ARGS+=('-Debpf=false') - fi - - CC="$cc" CFLAGS="-Werror -Wall" meson build "${ARGS[@]}" + CC="$cc" CFLAGS="-Werror -Wall" meson build ninja -v -C build test popd diff --git a/contrib/fedora/rpm/NetworkManager.spec b/contrib/fedora/rpm/NetworkManager.spec index a4f28f3668..0732fb495f 100644 --- a/contrib/fedora/rpm/NetworkManager.spec +++ b/contrib/fedora/rpm/NetworkManager.spec @@ -154,17 +154,6 @@ %bcond_with ifcfg_migrate %endif -%if 0%{?fedora} -# Although eBPF would be available on Fedora's kernel, it seems -# we often get SELinux denials (rh#1651654). But even aside them, -# bpf(BPF_MAP_CREATE, ...) randomly fails with EPERM. That might -# be related to `ulimit -l`. Anyway, this is not usable at the -# moment. -%global ebpf_enabled "no" -%else -%global ebpf_enabled "no" -%endif - # Fedora 33 enables LTO by default by setting CFLAGS="-flto -ffat-lto-objects". # However, we also require "-flto -flto-partition=none", so disable Fedora's # default and use our configure option --with-lto instead. @@ -682,11 +671,6 @@ Preferably use nmcli instead. -Dlibpsl=true \ %else -Dlibpsl=false \ -%endif -%if %{ebpf_enabled} != "yes" - -Debpf=false \ -%else - -Debpf=true \ %endif -Dsession_tracking=systemd \ -Dsuspend_resume=systemd \ diff --git a/contrib/fedora/rpm/configure-for-system.sh b/contrib/fedora/rpm/configure-for-system.sh index f0638591bd..6bdf66825a 100755 --- a/contrib/fedora/rpm/configure-for-system.sh +++ b/contrib/fedora/rpm/configure-for-system.sh @@ -155,7 +155,6 @@ P_CRYPTO="${CRYPTO-}" P_DBUS_SYS_DIR="${DBUS_SYS_DIR-}" P_DHCP_DEFAULT="${DHCP_DEFAULT-}" P_DNS_RC_MANAGER_DEFAULT="${DNS_RC_MANAGER_DEFAULT-}" -P_EBPF_ENABLED="${EBPF_ENABLED-no}" P_FIREWALLD_ZONE="${FIREWALLD_ZONE-}" P_IWD="${IWD-}" P_LOGGING_BACKEND_DEFAULT="${LOGGING_BACKEND_DEFAULT-}" @@ -396,7 +395,6 @@ meson setup\ -Dmodify_system=true \ -Dconcheck=true \ -Dlibpsl="$(bool_true "$P_FEDORA")" \ - -Debpf="$(bool_true "$P_EBPF_ENABLED")" \ -Dsession_tracking=systemd \ -Dsuspend_resume=systemd \ -Dsystemdsystemunitdir=/usr/lib/systemd/system \ diff --git a/contrib/scripts/nm-ci-run.sh b/contrib/scripts/nm-ci-run.sh index 13d2f0fffd..57b867c550 100755 --- a/contrib/scripts/nm-ci-run.sh +++ b/contrib/scripts/nm-ci-run.sh @@ -180,8 +180,6 @@ meson setup build \ -D crypto=$_WITH_CRYPTO \ -D docs=$_WITH_DOCS \ \ - -D ebpf=false \ - \ -D iwd=true \ -D ofono=true \ -D teamdctl=$_WITH_LIBTEAM \ diff --git a/meson.build b/meson.build index c7313d572d..d1db57b50b 100644 --- a/meson.build +++ b/meson.build @@ -477,19 +477,6 @@ if enable_selinux endif config_h.set10('HAVE_SELINUX', enable_selinux) -# eBPF support -ebpf_opt = get_option('ebpf') -# 'auto' means 'false', because there are still issues. -if ebpf_opt != 'true' - enable_ebpf = false -else - enable_ebpf = true - if not cc.has_header('linux/bpf.h') - assert(ebpf_opt != 'true', 'eBPF requires kernel support') - enable_ebpf = false - endif -endif - # libaudit support libaudit = get_option('libaudit') enable_libaudit = libaudit.contains('yes') @@ -1160,6 +1147,5 @@ output += 'have-nss: ' + crypto_nss_dep.found().to_string() + ')\n' output += ' sanitizers: ' + get_option('b_sanitize') + '\n' output += ' Mozilla Public Suffix List: ' + enable_libpsl.to_string() + '\n' output += ' vapi: ' + enable_vapi.to_string() + '\n' -output += ' ebpf: ' + enable_ebpf.to_string() + '\n' output += ' readline: ' + with_readline + '\n' message(output) diff --git a/meson_options.txt b/meson_options.txt index 55762f65d5..d28cc76fc8 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -44,7 +44,7 @@ option('nmcli', type: 'boolean', value: true, description: 'Build nmcli') option('nmtui', type: 'boolean', value: true, description: 'Build nmtui') option('nm_cloud_setup', type: 'boolean', value: true, description: 'Build nm-cloud-setup, a tool for automatically configuring networking in cloud') option('bluez5_dun', type: 'boolean', value: false, description: 'enable Bluez5 DUN support') -option('ebpf', type: 'combo', choices: ['auto', 'true', 'false'], description: 'Enable eBPF support') +option('ebpf', type: 'combo', choices: ['auto', 'true', 'false'], description: 'Enable eBPF support (deprecated)') option('nbft', type: 'boolean', value: true, description: 'Enable NBFT support in the initrd generator') # configuration plugins diff --git a/src/meson.build b/src/meson.build index 1a0319828b..a5b3441ba7 100644 --- a/src/meson.build +++ b/src/meson.build @@ -24,7 +24,7 @@ libn_acd = static_library( 'n-acd/src/n-acd.c', 'n-acd/src/n-acd-probe.c', 'n-acd/src/util/timer.c', - enable_ebpf ? 'n-acd/src/n-acd-bpf.c' : 'n-acd/src/n-acd-bpf-fallback.c', + 'n-acd/src/n-acd-bpf.c', ), include_directories: include_directories( 'c-list/src',