Initial commit
Some checks failed
Build Kernel / Build all affected Kernels (push) Has been cancelled
Build all core packages / Build all core packages for selected target (push) Has been cancelled
Build and Push prebuilt tools container / Build and Push all prebuilt containers (push) Has been cancelled
Build Toolchains / Build Toolchains for each target (push) Has been cancelled
Build host tools / Build host tools for linux and macos based systems (push) Has been cancelled
Coverity scan build / Coverity x86/64 build (push) Has been cancelled
Some checks failed
Build Kernel / Build all affected Kernels (push) Has been cancelled
Build all core packages / Build all core packages for selected target (push) Has been cancelled
Build and Push prebuilt tools container / Build and Push all prebuilt containers (push) Has been cancelled
Build Toolchains / Build Toolchains for each target (push) Has been cancelled
Build host tools / Build host tools for linux and macos based systems (push) Has been cancelled
Coverity scan build / Coverity x86/64 build (push) Has been cancelled
This commit is contained in:
113
package/kernel/bpf-headers/Makefile
Normal file
113
package/kernel/bpf-headers/Makefile
Normal file
@@ -0,0 +1,113 @@
|
||||
#
|
||||
# Copyright (C) 2006-2009 OpenWrt.org
|
||||
#
|
||||
# This is free software, licensed under the GNU General Public License v2.
|
||||
# See /LICENSE for more information.
|
||||
#
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
override QUILT:=
|
||||
override HOST_QUILT:=
|
||||
|
||||
include $(INCLUDE_DIR)/kernel.mk
|
||||
|
||||
|
||||
PKG_NAME:=linux
|
||||
PKG_PATCHVER:=5.15
|
||||
# Manually include kernel version and hash from kernel details file
|
||||
include $(INCLUDE_DIR)/kernel-$(PKG_PATCHVER)
|
||||
|
||||
PKG_VERSION:=$(PKG_PATCHVER)$(strip $(LINUX_VERSION-$(PKG_PATCHVER)))
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
|
||||
PKG_SOURCE_URL:=@KERNEL/linux/kernel/v$(word 1,$(subst ., ,$(PKG_PATCHVER))).x
|
||||
PKG_HASH:=$(LINUX_KERNEL_HASH-$(strip $(PKG_VERSION)))
|
||||
PKG_BUILD_DIR:=$(KERNEL_BUILD_DIR)/bpf-headers/$(PKG_NAME)-$(PKG_VERSION)
|
||||
|
||||
GENERIC_PLATFORM_DIR := $(CURDIR)/../../../target/linux/generic
|
||||
GENERIC_BACKPORT_DIR := $(GENERIC_PLATFORM_DIR)/backport$(if $(wildcard $(GENERIC_PLATFORM_DIR)/backport-$(PKG_PATCHVER)),-$(PKG_PATCHVER))
|
||||
GENERIC_PATCH_DIR := $(GENERIC_PLATFORM_DIR)/pending$(if $(wildcard $(GENERIC_PLATFORM_DIR)/pending-$(PKG_PATCHVER)),-$(PKG_PATCHVER))
|
||||
GENERIC_HACK_DIR := $(GENERIC_PLATFORM_DIR)/hack$(if $(wildcard $(GENERIC_PLATFORM_DIR)/hack-$(PKG_PATCHVER)),-$(PKG_PATCHVER))
|
||||
GENERIC_FILES_DIR := $(foreach dir,$(wildcard $(GENERIC_PLATFORM_DIR)/files $(GENERIC_PLATFORM_DIR)/files-$(PKG_PATCHVER)),"$(dir)")
|
||||
PATCH_DIR := $(CURDIR)/patches
|
||||
FILES_DIR :=
|
||||
|
||||
REAL_LINUX_DIR := $(LINUX_DIR)
|
||||
LINUX_DIR := $(PKG_BUILD_DIR)
|
||||
|
||||
include $(INCLUDE_DIR)/bpf.mk
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define Package/bpf-headers
|
||||
SECTION:=kernel
|
||||
CATEGORY:=Kernel modules
|
||||
TITLE:=eBPF kernel headers
|
||||
BUILDONLY:=1
|
||||
HIDDEN:=1
|
||||
endef
|
||||
|
||||
PKG_CONFIG_PATH:=
|
||||
|
||||
export HOST_EXTRACFLAGS=-I$(STAGING_DIR_HOST)/include
|
||||
|
||||
KERNEL_MAKE := \
|
||||
$(MAKE) -C $(PKG_BUILD_DIR) \
|
||||
ARCH=$(BPF_KARCH) \
|
||||
CROSS_COMPILE=$(BPF_ARCH)-linux- \
|
||||
LLVM=1 CC="$(CLANG)" LD="$(TARGET_CROSS)ld" \
|
||||
HOSTCC="$(HOSTCC)" \
|
||||
HOSTCXX="$(HOSTCXX)" \
|
||||
KBUILD_HOSTLDLIBS="-L$(STAGING_DIR_HOST)/lib" \
|
||||
CONFIG_SHELL="$(BASH)" \
|
||||
INSTALL_HDR_PATH="$(PKG_BUILD_DIR)/user_headers"
|
||||
|
||||
define Build/Patch
|
||||
$(Kernel/Patch/Default)
|
||||
endef
|
||||
|
||||
BPF_DOC = $(PKG_BUILD_DIR)/scripts/bpf_doc.py
|
||||
|
||||
define Build/Configure/64
|
||||
echo 'CONFIG_CPU_MIPS64_R2=y' >> $(PKG_BUILD_DIR)/.config
|
||||
echo 'CONFIG_64BIT=y' >> $(PKG_BUILD_DIR)/.config
|
||||
endef
|
||||
|
||||
define Build/Configure
|
||||
grep -vE 'CONFIG_(CPU_.*ENDIAN|HZ)' $(PKG_BUILD_DIR)/arch/mips/configs/generic_defconfig > $(PKG_BUILD_DIR)/.config
|
||||
echo 'CONFIG_CPU_$(if $(CONFIG_BIG_ENDIAN),BIG,LITTLE)_ENDIAN=y' >> $(PKG_BUILD_DIR)/.config
|
||||
$(if $(CONFIG_ARCH_64BIT),$(Build/Configure/64))
|
||||
grep CONFIG_HZ $(REAL_LINUX_DIR)/.config >> $(PKG_BUILD_DIR)/.config
|
||||
yes '' | $(KERNEL_MAKE) oldconfig
|
||||
grep 'CONFIG_HZ=' $(REAL_LINUX_DIR)/.config | \
|
||||
cut -d= -f2 | \
|
||||
bc -q $(LINUX_DIR)/kernel/time/timeconst.bc \
|
||||
> $(LINUX_DIR)/include/generated/timeconst.h
|
||||
$(BPF_DOC) --header \
|
||||
--file $(LINUX_DIR)/tools/include/uapi/linux/bpf.h \
|
||||
> $(PKG_BUILD_DIR)/tools/lib/bpf/bpf_helper_defs.h
|
||||
endef
|
||||
|
||||
define Build/Compile
|
||||
$(KERNEL_MAKE) archprepare headers_install
|
||||
endef
|
||||
|
||||
define Build/InstallDev
|
||||
mkdir -p $(1)/bpf-headers/arch $(1)/bpf-headers/tools
|
||||
$(CP) \
|
||||
$(PKG_BUILD_DIR)/arch/$(BPF_KARCH) \
|
||||
$(1)/bpf-headers/arch/
|
||||
$(CP) \
|
||||
$(PKG_BUILD_DIR)/tools/lib \
|
||||
$(PKG_BUILD_DIR)/tools/testing \
|
||||
$(1)/bpf-headers/tools/
|
||||
$(CP) \
|
||||
$(PKG_BUILD_DIR)/include \
|
||||
$(PKG_BUILD_DIR)/samples \
|
||||
$(PKG_BUILD_DIR)/scripts \
|
||||
$(PKG_BUILD_DIR)/user_headers \
|
||||
$(1)/bpf-headers
|
||||
$(CP) \
|
||||
$(CURDIR)/files/stdarg.h \
|
||||
$(1)/bpf-headers/include
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,bpf-headers))
|
||||
19
package/kernel/bpf-headers/files/stdarg.h
Normal file
19
package/kernel/bpf-headers/files/stdarg.h
Normal file
@@ -0,0 +1,19 @@
|
||||
#ifndef _STDARG_H
|
||||
#define _STDARG_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef __builtin_va_list va_list;
|
||||
|
||||
#define va_start(v,l) __builtin_va_start(v,l)
|
||||
#define va_end(v) __builtin_va_end(v)
|
||||
#define va_arg(v,l) __builtin_va_arg(v,l)
|
||||
#define va_copy(d,s) __builtin_va_copy(d,s)
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
20
package/kernel/bpf-headers/patches/100-support_hz_300.patch
Normal file
20
package/kernel/bpf-headers/patches/100-support_hz_300.patch
Normal file
@@ -0,0 +1,20 @@
|
||||
--- a/arch/mips/Kconfig
|
||||
+++ b/arch/mips/Kconfig
|
||||
@@ -2988,6 +2988,9 @@ choice
|
||||
config HZ_256
|
||||
bool "256 HZ" if SYS_SUPPORTS_256HZ || SYS_SUPPORTS_ARBIT_HZ
|
||||
|
||||
+ config HZ_300
|
||||
+ bool "300 HZ" if SYS_SUPPORTS_ARBIT_HZ
|
||||
+
|
||||
config HZ_1000
|
||||
bool "1000 HZ" if SYS_SUPPORTS_1000HZ || SYS_SUPPORTS_ARBIT_HZ
|
||||
|
||||
@@ -3039,6 +3042,7 @@ config HZ
|
||||
default 128 if HZ_128
|
||||
default 250 if HZ_250
|
||||
default 256 if HZ_256
|
||||
+ default 300 if HZ_300
|
||||
default 1000 if HZ_1000
|
||||
default 1024 if HZ_1024
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
From 7ed95633bff19950069c348b94c9c13164a57a2a Mon Sep 17 00:00:00 2001
|
||||
From: Christian Marangi <ansuelsmth@gmail.com>
|
||||
Date: Wed, 18 Jan 2023 20:20:39 +0100
|
||||
Subject: [PATCH] linux/netlink: drop NL_SET_ERR_MSG for kernel modules
|
||||
|
||||
We don't need NL_SET_ERR_MSG_MOD for bpf modules and we can drop it to
|
||||
solve missing KBUILD_MODNAME define.
|
||||
|
||||
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
|
||||
---
|
||||
include/linux/netlink.h | 3 ---
|
||||
1 file changed, 3 deletions(-)
|
||||
|
||||
diff --git a/include/linux/netlink.h b/include/linux/netlink.h
|
||||
index 61b1c7f..93561fb 100644
|
||||
--- a/include/linux/netlink.h
|
||||
+++ b/include/linux/netlink.h
|
||||
@@ -98,9 +98,6 @@ struct netlink_ext_ack {
|
||||
__extack->_msg = __msg; \
|
||||
} while (0)
|
||||
|
||||
-#define NL_SET_ERR_MSG_MOD(extack, msg) \
|
||||
- NL_SET_ERR_MSG((extack), KBUILD_MODNAME ": " msg)
|
||||
-
|
||||
#define NL_SET_BAD_ATTR_POLICY(extack, attr, pol) do { \
|
||||
if ((extack)) { \
|
||||
(extack)->bad_attr = (attr); \
|
||||
--
|
||||
2.38.1
|
||||
|
||||
@@ -0,0 +1,44 @@
|
||||
From 6e7cd9c0abffea55e39a4160949bc6fba972d161 Mon Sep 17 00:00:00 2001
|
||||
From: Christian Marangi <ansuelsmth@gmail.com>
|
||||
Date: Thu, 19 Jan 2023 13:37:46 +0100
|
||||
Subject: [PATCH] net/flow_offload: use NL_SET_ERR_MSG instead of
|
||||
NL_SET_ERR_MSG_MOD
|
||||
|
||||
Use NL_SET_ERR_MSG instead of NL_SET_ERR_MSG_MOD for bpf modules as
|
||||
kernel modules are not supported.
|
||||
|
||||
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
|
||||
---
|
||||
include/net/flow_offload.h | 6 +++---
|
||||
1 file changed, 3 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/include/net/flow_offload.h b/include/net/flow_offload.h
|
||||
index 7a2b022..f17c485 100644
|
||||
--- a/include/net/flow_offload.h
|
||||
+++ b/include/net/flow_offload.h
|
||||
@@ -321,7 +321,7 @@ flow_action_mixed_hw_stats_check(const struct flow_action *action,
|
||||
|
||||
flow_action_for_each(i, action_entry, action) {
|
||||
if (i && action_entry->hw_stats != last_hw_stats) {
|
||||
- NL_SET_ERR_MSG_MOD(extack, "Mixing HW stats types for actions is not supported");
|
||||
+ NL_SET_ERR_MSG(extack, "Mixing HW stats types for actions is not supported");
|
||||
return false;
|
||||
}
|
||||
last_hw_stats = action_entry->hw_stats;
|
||||
@@ -356,11 +356,11 @@ __flow_action_hw_stats_check(const struct flow_action *action,
|
||||
|
||||
if (!check_allow_bit &&
|
||||
~action_entry->hw_stats & FLOW_ACTION_HW_STATS_ANY) {
|
||||
- NL_SET_ERR_MSG_MOD(extack, "Driver supports only default HW stats type \"any\"");
|
||||
+ NL_SET_ERR_MSG(extack, "Driver supports only default HW stats type \"any\"");
|
||||
return false;
|
||||
} else if (check_allow_bit &&
|
||||
!(action_entry->hw_stats & BIT(allow_bit))) {
|
||||
- NL_SET_ERR_MSG_MOD(extack, "Driver does not support selected HW stats type");
|
||||
+ NL_SET_ERR_MSG(extack, "Driver does not support selected HW stats type");
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
--
|
||||
2.38.1
|
||||
|
||||
14
package/kernel/bpf-headers/src/include/generated/bounds.h
Normal file
14
package/kernel/bpf-headers/src/include/generated/bounds.h
Normal file
@@ -0,0 +1,14 @@
|
||||
#ifndef __LINUX_BOUNDS_H__
|
||||
#define __LINUX_BOUNDS_H__
|
||||
/*
|
||||
* DO NOT MODIFY.
|
||||
*
|
||||
* This file was generated by Kbuild
|
||||
*/
|
||||
|
||||
#define NR_PAGEFLAGS 23 /* __NR_PAGEFLAGS */
|
||||
#define MAX_NR_ZONES 4 /* __MAX_NR_ZONES */
|
||||
#define NR_CPUS_BITS 1 /* ilog2(CONFIG_NR_CPUS) */
|
||||
#define SPINLOCK_SIZE 64 /* sizeof(spinlock_t) */
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user