1
0
Fork 0
mirror of https://github.com/Ysurac/openmptcprouter.git synced 2025-03-09 15:40:20 +00:00

Fix compilation for 5.14

This commit is contained in:
Ycarus (Yannick Chabanois) 2021-10-18 16:01:57 +02:00
parent 1fcd853b8d
commit 1741a86684
142 changed files with 20808 additions and 105 deletions

View file

@ -14,7 +14,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
--- a/include/linux/module.h
+++ b/include/linux/module.h
@@ -161,6 +161,7 @@ extern void cleanup_module(void);
@@ -164,6 +164,7 @@ extern void cleanup_module(void);
/* Generic info of form tag = "info" */
#define MODULE_INFO(tag, info) __MODULE_INFO(tag, tag, info)
@ -22,7 +22,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
/* For userspace: you can also call me... */
#define MODULE_ALIAS(_alias) MODULE_INFO(alias, _alias)
@@ -230,12 +231,12 @@ extern void cleanup_module(void);
@@ -233,12 +234,12 @@ extern void cleanup_module(void);
* Author(s), use "Name <email>" or just "Name", for multiple
* authors use multiple MODULE_AUTHOR() statements/lines.
*/
@ -38,7 +38,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
/* Creates an alias so file2alias.c can find device table. */
#define MODULE_DEVICE_TABLE(type, name) \
extern typeof(name) __mod_##type##__##name##_device_table \
@@ -262,7 +263,9 @@ extern typeof(name) __mod_##type##__##na
@@ -265,7 +266,9 @@ extern typeof(name) __mod_##type##__##na
*/
#if defined(MODULE) || !defined(CONFIG_SYSFS)
@ -49,7 +49,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
#else
#define MODULE_VERSION(_version) \
MODULE_INFO(version, _version); \
@@ -285,7 +288,7 @@ extern typeof(name) __mod_##type##__##na
@@ -288,7 +291,7 @@ extern typeof(name) __mod_##type##__##na
/* Optional firmware file (or files) needed by the module
* format is simply firmware file name. Multiple firmware
* files require multiple MODULE_FIRMWARE() specifiers */
@ -75,9 +75,9 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
+#endif
+
#define __MODULE_INFO(tag, name, info) \
static const char __UNIQUE_ID(name)[] \
__used __section(".modinfo") __attribute__((unused, aligned(1))) \
@@ -31,7 +41,7 @@ static const char __UNIQUE_ID(name)[]
static const char __UNIQUE_ID(name)[] \
__used __section(".modinfo") __aligned(1) \
@@ -31,7 +41,7 @@
/* One for each parameter, describing how to use it. Some files do
multiple of these per line, so can't just use MODULE_INFO. */
#define MODULE_PARM_DESC(_parm, desc) \
@ -88,7 +88,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
--- a/init/Kconfig
+++ b/init/Kconfig
@@ -2337,6 +2337,13 @@ config UNUSED_KSYMS_WHITELIST
@@ -2324,6 +2324,13 @@ config UNUSED_KSYMS_WHITELIST
one per line. The path can be absolute, or relative to the kernel
source tree.
@ -104,7 +104,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
config MODULES_TREE_LOOKUP
--- a/kernel/module.c
+++ b/kernel/module.c
@@ -3247,9 +3247,11 @@ static int setup_load_info(struct load_i
@@ -3227,9 +3227,11 @@ static int setup_load_info(struct load_i
static int check_modinfo(struct module *mod, struct load_info *info, int flags)
{
@ -117,7 +117,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
if (flags & MODULE_INIT_IGNORE_VERMAGIC)
modmagic = NULL;
@@ -3270,6 +3272,7 @@ static int check_modinfo(struct module *
@@ -3250,6 +3252,7 @@ static int check_modinfo(struct module *
mod->name);
add_taint_module(mod, TAINT_OOT_MODULE, LOCKDEP_STILL_OK);
}
@ -127,7 +127,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
--- a/scripts/mod/modpost.c
+++ b/scripts/mod/modpost.c
@@ -2037,7 +2037,9 @@ static void read_symbols(const char *mod
@@ -2024,7 +2024,9 @@ static void read_symbols(const char *mod
symname = remove_dot(info.strtab + sym->st_name);
handle_symbol(mod, &info, sym, symname);
@ -137,9 +137,9 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
}
for (sym = info.symtab_start; sym < info.symtab_stop; sym++) {
@@ -2250,8 +2252,10 @@ static void add_header(struct buffer *b,
buf_printf(b, "\n");
@@ -2203,8 +2205,10 @@ static void add_header(struct buffer *b,
buf_printf(b, "BUILD_SALT;\n");
buf_printf(b, "BUILD_LTO_INFO;\n");
buf_printf(b, "\n");
+#ifndef CONFIG_MODULE_STRIPPED
buf_printf(b, "MODULE_INFO(vermagic, VERMAGIC_STRING);\n");
@ -148,7 +148,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
buf_printf(b, "\n");
buf_printf(b, "__visible struct module __this_module\n");
buf_printf(b, "__section(\".gnu.linkonce.this_module\") = {\n");
@@ -2268,8 +2272,10 @@ static void add_header(struct buffer *b,
@@ -2221,8 +2225,10 @@ static void add_header(struct buffer *b,
static void add_intree_flag(struct buffer *b, int is_intree)
{
@ -159,7 +159,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
}
/* Cannot check for assembler */
@@ -2282,8 +2288,10 @@ static void add_retpoline(struct buffer
@@ -2235,8 +2241,10 @@ static void add_retpoline(struct buffer
static void add_staging_flag(struct buffer *b, const char *name)
{
@ -170,7 +170,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
}
/**
@@ -2367,11 +2375,13 @@ static void add_depends(struct buffer *b
@@ -2316,11 +2324,13 @@ static void add_depends(struct buffer *b
static void add_srcversion(struct buffer *b, struct module *mod)
{
@ -184,9 +184,9 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
}
static void write_buf(struct buffer *b, const char *fname)
@@ -2630,7 +2640,9 @@ int main(int argc, char **argv)
@@ -2569,7 +2579,9 @@ int main(int argc, char **argv)
add_staging_flag(&buf, mod->name);
err |= add_versions(&buf, mod);
add_versions(&buf, mod);
add_depends(&buf, mod);
+#ifndef CONFIG_MODULE_STRIPPED
add_moddevtable(&buf, mod);

View file

@ -3039,7 +3039,7 @@ Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
main(int argc, char **argv)
--- a/scripts/mod/modpost.h
+++ b/scripts/mod/modpost.h
@@ -8,7 +8,11 @@
@@ -9,7 +9,11 @@
#include <sys/mman.h>
#include <fcntl.h>
#include <unistd.h>

View file

@ -0,0 +1,114 @@
From 48232d3d931c95953ce2ddfe7da7bb164aef6a73 Mon Sep 17 00:00:00 2001
From: Felix Fietkau <nbd@nbd.name>
Date: Fri, 7 Jul 2017 17:03:16 +0200
Subject: fix portability of some includes files in tools/ used on the host
Signed-off-by: Felix Fietkau <nbd@nbd.name>
---
tools/include/tools/be_byteshift.h | 4 ++++
tools/include/tools/le_byteshift.h | 4 ++++
tools/include/tools/linux_types.h | 22 ++++++++++++++++++++++
3 files changed, 30 insertions(+)
create mode 100644 tools/include/tools/linux_types.h
--- a/tools/include/tools/be_byteshift.h
+++ b/tools/include/tools/be_byteshift.h
@@ -2,6 +2,10 @@
#ifndef _TOOLS_BE_BYTESHIFT_H
#define _TOOLS_BE_BYTESHIFT_H
+#ifndef __linux__
+#include "linux_types.h"
+#endif
+
#include <stdint.h>
static inline uint16_t __get_unaligned_be16(const uint8_t *p)
--- a/tools/include/tools/le_byteshift.h
+++ b/tools/include/tools/le_byteshift.h
@@ -2,6 +2,10 @@
#ifndef _TOOLS_LE_BYTESHIFT_H
#define _TOOLS_LE_BYTESHIFT_H
+#ifndef __linux__
+#include "linux_types.h"
+#endif
+
#include <stdint.h>
static inline uint16_t __get_unaligned_le16(const uint8_t *p)
--- /dev/null
+++ b/tools/include/tools/linux_types.h
@@ -0,0 +1,26 @@
+#ifndef __LINUX_TYPES_H
+#define __LINUX_TYPES_H
+
+#include <stdint.h>
+
+typedef int8_t __s8;
+typedef uint8_t __u8;
+typedef uint8_t __be8;
+typedef uint8_t __le8;
+
+typedef int16_t __s16;
+typedef uint16_t __u16;
+typedef uint16_t __be16;
+typedef uint16_t __le16;
+
+typedef int32_t __s32;
+typedef uint32_t __u32;
+typedef uint32_t __be32;
+typedef uint32_t __le32;
+
+typedef int64_t __s64;
+typedef uint64_t __u64;
+typedef uint64_t __be64;
+typedef uint64_t __le64;
+
+#endif
--- a/tools/include/linux/types.h
+++ b/tools/include/linux/types.h
@@ -6,12 +6,13 @@
#include <stddef.h>
#include <stdint.h>
-#ifndef __SANE_USERSPACE_TYPES__
#define __SANE_USERSPACE_TYPES__ /* For PPC64, to get LL64 types */
-#endif
-
+#ifndef __linux__
+#include <tools/linux_types.h>
+#else
#include <asm/types.h>
#include <asm/posix_types.h>
+#endif
struct page;
struct kmem_cache;
--- a/tools/perf/pmu-events/jevents.c
+++ b/tools/perf/pmu-events/jevents.c
@@ -1,4 +1,6 @@
+#ifdef __linux__
#define _XOPEN_SOURCE 500 /* needed for nftw() */
+#endif
#define _GNU_SOURCE /* needed for asprintf() */
/* Parse event JSON files */
@@ -35,6 +37,7 @@
#include <stdlib.h>
#include <errno.h>
#include <string.h>
+#include <strings.h>
#include <ctype.h>
#include <unistd.h>
#include <stdarg.h>
--- a/tools/perf/pmu-events/json.c
+++ b/tools/perf/pmu-events/json.c
@@ -38,7 +38,6 @@
#include <unistd.h>
#include "jsmn.h"
#include "json.h"
-#include <linux/kernel.h>
static char *mapfile(const char *fn, size_t *size)

View file

@ -13,7 +13,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
--- a/include/uapi/linux/spi/spidev.h
+++ b/include/uapi/linux/spi/spidev.h
@@ -121,7 +121,7 @@ struct spi_ioc_transfer {
@@ -93,7 +93,7 @@ struct spi_ioc_transfer {
/* not all platforms use <asm-generic/ioctl.h> or _IOC_TYPECHECK() ... */
#define SPI_MSGSIZE(N) \

View file

@ -12,7 +12,7 @@ Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
---
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -113,6 +113,7 @@ config ARM
@@ -117,6 +117,7 @@ config ARM
select HAVE_UID16
select HAVE_VIRT_CPU_ACCOUNTING_GEN
select IRQ_FORCED_THREADING
@ -22,14 +22,14 @@ Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
select OF_EARLY_FLATTREE if OF
--- a/arch/arm/boot/compressed/Makefile
+++ b/arch/arm/boot/compressed/Makefile
@@ -98,6 +98,7 @@ $(foreach o, $(libfdt_objs) atags_to_fdt
ifdef building_out_of_srctree
$(shell rm -f $(addprefix $(obj)/, fdt_rw.c fdt_ro.c fdt_wip.c fdt.c))
@@ -92,6 +92,7 @@ endif
ifeq ($(CONFIG_USE_OF),y)
OBJS += $(libfdt_objs) fdt_check_mem_start.o
endif
+KBUILD_CFLAGS_KERNEL := $(patsubst -f%-sections,,$(KBUILD_CFLAGS_KERNEL))
targets := vmlinux vmlinux.lds piggy_data piggy.o \
lib1funcs.o ashldi3.o bswapsdi2.o \
# -fstack-protector-strong triggers protection checks in this code,
# but it is being used too early to link to meaningful stack_chk logic.
--- a/arch/arm/kernel/vmlinux.lds.S
+++ b/arch/arm/kernel/vmlinux.lds.S
@@ -100,24 +100,24 @@ SECTIONS

View file

@ -30,7 +30,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
/* Align . to a 8 byte boundary equals to maximum function alignment. */
#define ALIGN_FUNCTION() . = ALIGN(8)
@@ -473,14 +483,14 @@
@@ -486,14 +496,14 @@
/* Kernel symbol table: Normal symbols */ \
__ksymtab : AT(ADDR(__ksymtab) - LOAD_OFFSET) { \
__start___ksymtab = .; \
@ -47,7 +47,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
__stop___ksymtab_gpl = .; \
} \
\
@@ -542,7 +552,7 @@
@@ -513,7 +523,7 @@
\
/* Kernel symbol table: strings */ \
__ksymtab_strings : AT(ADDR(__ksymtab_strings) - LOAD_OFFSET) { \
@ -56,7 +56,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
} \
\
/* __*init sections */ \
@@ -1018,6 +1028,8 @@
@@ -1009,6 +1019,8 @@
#define COMMON_DISCARDS \
SANITIZER_DISCARDS \
@ -91,7 +91,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
"__kstrtabns_" #sym ": \n" \
--- a/scripts/Makefile.build
+++ b/scripts/Makefile.build
@@ -367,7 +367,7 @@ targets += $(lib-y) $(always-y) $(MAKECM
@@ -358,7 +358,7 @@ targets += $(real-dtb-y) $(lib-y) $(alwa
# Linker scripts preprocessor (.lds.S -> .lds)
# ---------------------------------------------------------------------------
quiet_cmd_cpp_lds_S = LDS $@

View file

@ -23,7 +23,7 @@ Signed-off-by: Imre Kaloz <kaloz@openwrt.org>
{ {0x02, 0x21}, "lz4", unlz4 },
--- a/scripts/Makefile.lib
+++ b/scripts/Makefile.lib
@@ -370,7 +370,7 @@ quiet_cmd_bzip2 = BZIP2 $@
@@ -408,7 +408,7 @@ quiet_cmd_bzip2 = BZIP2 $@
# ---------------------------------------------------------------------------
quiet_cmd_lzma = LZMA $@

View file

@ -9,7 +9,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
--- a/net/netfilter/Kconfig
+++ b/net/netfilter/Kconfig
@@ -228,7 +228,6 @@ config NF_CONNTRACK_FTP
@@ -243,7 +243,6 @@ config NF_CONNTRACK_FTP
config NF_CONNTRACK_H323
tristate "H.323 protocol support"
@ -17,7 +17,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
depends on NETFILTER_ADVANCED
help
H.323 is a VoIP signalling protocol from ITU-T. As one of the most
@@ -1072,7 +1071,6 @@ config NETFILTER_XT_TARGET_SECMARK
@@ -1106,7 +1105,6 @@ config NETFILTER_XT_TARGET_SECMARK
config NETFILTER_XT_TARGET_TCPMSS
tristate '"TCPMSS" target support'

View file

@ -92,7 +92,7 @@ Signed-off-by: John Crispin <john@phrozen.org>
bool
--- a/lib/Kconfig
+++ b/lib/Kconfig
@@ -419,16 +419,16 @@ config BCH_CONST_T
@@ -433,16 +433,16 @@ config BCH_CONST_T
# Textsearch support is select'ed if needed
#
config TEXTSEARCH

View file

@ -37,7 +37,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
tristate "Userspace cryptographic algorithm configuration"
--- a/crypto/algboss.c
+++ b/crypto/algboss.c
@@ -230,8 +230,12 @@ static int cryptomgr_schedule_test(struc
@@ -211,8 +211,12 @@ static int cryptomgr_schedule_test(struc
type = alg->cra_flags;
/* Do not test internal algorithms. */

View file

@ -26,7 +26,7 @@ Signed-off-by: John Crispin <john@phrozen.org>
* @name: name of the struct -- the string is not copied internally
--- a/net/Makefile
+++ b/net/Makefile
@@ -53,7 +53,7 @@ obj-$(CONFIG_TIPC) += tipc/
@@ -52,7 +52,7 @@ obj-$(CONFIG_TIPC) += tipc/
obj-$(CONFIG_NETLABEL) += netlabel/
obj-$(CONFIG_IUCV) += iucv/
obj-$(CONFIG_SMC) += smc/
@ -34,7 +34,7 @@ Signed-off-by: John Crispin <john@phrozen.org>
+obj-$(CONFIG_RFKILL_FULL) += rfkill/
obj-$(CONFIG_NET_9P) += 9p/
obj-$(CONFIG_CAIF) += caif/
ifneq ($(CONFIG_DCB),)
obj-$(CONFIG_DCB) += dcb/
--- a/net/rfkill/Kconfig
+++ b/net/rfkill/Kconfig
@@ -2,7 +2,11 @@

View file

@ -10,7 +10,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
---
--- a/arch/mips/include/asm/r4kcache.h
+++ b/arch/mips/include/asm/r4kcache.h
@@ -296,14 +296,46 @@ static inline void prot##extra##blast_##
@@ -286,14 +286,46 @@ static inline void prot##extra##blast_##
unsigned long end) \
{ \
unsigned long lsize = cpu_##desc##_line_size(); \

View file

@ -10,7 +10,7 @@ Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
--- a/arch/mips/Kconfig
+++ b/arch/mips/Kconfig
@@ -1165,6 +1165,10 @@ config MIPS_MSC
@@ -1202,6 +1202,10 @@ config MIPS_MSC
config SYNC_R4K
bool

View file

@ -0,0 +1,38 @@
From 107c0964cb8db7ca28ac5199426414fdab3c274d Mon Sep 17 00:00:00 2001
From: "Alexandros C. Couloumbis" <alex@ozo.com>
Date: Fri, 7 Jul 2017 17:14:51 +0200
Subject: hack: arch: powerpc: drop register save/restore library from modules
Upstream GCC uses a libgcc function for saving/restoring registers. This
makes the code bigger, and upstream kernels need to carry that function
for every single kernel module. Our GCC is patched to avoid those
references, so we can drop the extra bloat for modules.
lede-commit: e8e1084654f50904e6bf77b70b2de3f137d7b3ec
Signed-off-by: Alexandros C. Couloumbis <alex@ozo.com>
---
arch/powerpc/Makefile | 1 -
1 file changed, 1 deletion(-)
--- a/arch/powerpc/Makefile
+++ b/arch/powerpc/Makefile
@@ -61,19 +61,6 @@ machine-$(CONFIG_PPC64) += 64
machine-$(CONFIG_CPU_LITTLE_ENDIAN) += le
UTS_MACHINE := $(subst $(space),,$(machine-y))
-# XXX This needs to be before we override LD below
-ifdef CONFIG_PPC32
-KBUILD_LDFLAGS_MODULE += arch/powerpc/lib/crtsavres.o
-else
-ifeq ($(call ld-ifversion, -ge, 22500, y),y)
-# Have the linker provide sfpr if possible.
-# There is a corresponding test in arch/powerpc/lib/Makefile
-KBUILD_LDFLAGS_MODULE += --save-restore-funcs
-else
-KBUILD_LDFLAGS_MODULE += arch/powerpc/lib/crtsavres.o
-endif
-endif
-
ifdef CONFIG_CPU_LITTLE_ENDIAN
KBUILD_CFLAGS += -mlittle-endian
KBUILD_LDFLAGS += -EL

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,41 @@
From: Felix Fietkau <nbd@nbd.name>
Date: Fri, 7 Jul 2017 17:18:54 +0200
Subject: bridge: only accept EAP locally
When bridging, do not forward EAP frames to other ports, only deliver
them locally, regardless of the state.
Signed-off-by: Felix Fietkau <nbd@nbd.name>
[add disable_eap_hack sysfs attribute]
Signed-off-by: Etienne Champetier <champetier.etienne@gmail.com>
---
--- a/net/bridge/br_input.c
+++ b/net/bridge/br_input.c
@@ -103,10 +103,14 @@ int br_handle_frame_finish(struct net *n
}
}
+ BR_INPUT_SKB_CB(skb)->brdev = br->dev;
+
+ if (skb->protocol == htons(ETH_P_PAE) && !br->disable_eap_hack)
+ return br_pass_frame_up(skb);
+
if (state == BR_STATE_LEARNING)
goto drop;
- BR_INPUT_SKB_CB(skb)->brdev = br->dev;
BR_INPUT_SKB_CB(skb)->src_port_isolated = !!(p->flags & BR_ISOLATED);
if (IS_ENABLED(CONFIG_INET) &&
--- a/net/bridge/br_private.h
+++ b/net/bridge/br_private.h
@@ -402,6 +402,8 @@ struct net_bridge {
u16 group_fwd_mask;
u16 group_fwd_mask_required;
+ bool disable_eap_hack;
+
/* STP */
bridge_id designated_root;
bridge_id bridge_id;

View file

@ -47,7 +47,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
depends on !NF_CONNTRACK || NF_CONNTRACK
--- a/net/netfilter/Kconfig
+++ b/net/netfilter/Kconfig
@@ -683,8 +683,6 @@ config NFT_FIB_NETDEV
@@ -708,8 +708,6 @@ config NFT_REJECT_NETDEV
endif # NF_TABLES_NETDEV
@ -56,7 +56,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
config NF_FLOW_TABLE_INET
tristate "Netfilter flow table mixed IPv4/IPv6 module"
depends on NF_FLOW_TABLE
@@ -693,11 +691,12 @@ config NF_FLOW_TABLE_INET
@@ -718,11 +716,12 @@ config NF_FLOW_TABLE_INET
To compile it as a module, choose M here.
@ -70,7 +70,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
help
This option adds the flow table core infrastructure.
@@ -977,6 +976,15 @@ config NETFILTER_XT_TARGET_NOTRACK
@@ -1011,6 +1010,15 @@ config NETFILTER_XT_TARGET_NOTRACK
depends on NETFILTER_ADVANCED
select NETFILTER_XT_TARGET_CT
@ -88,7 +88,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
depends on NETFILTER_ADVANCED
--- a/net/netfilter/Makefile
+++ b/net/netfilter/Makefile
@@ -145,6 +145,7 @@ obj-$(CONFIG_NETFILTER_XT_TARGET_CLASSIF
@@ -143,6 +143,7 @@ obj-$(CONFIG_NETFILTER_XT_TARGET_CLASSIF
obj-$(CONFIG_NETFILTER_XT_TARGET_CONNSECMARK) += xt_CONNSECMARK.o
obj-$(CONFIG_NETFILTER_XT_TARGET_CT) += xt_CT.o
obj-$(CONFIG_NETFILTER_XT_TARGET_DSCP) += xt_DSCP.o
@ -767,7 +767,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
#include <net/netfilter/nf_flow_table.h>
#include <net/netfilter/nf_conntrack.h>
#include <net/netfilter/nf_conntrack_core.h>
@@ -395,8 +394,7 @@ flow_offload_lookup(struct nf_flowtable
@@ -407,8 +406,7 @@ flow_offload_lookup(struct nf_flowtable
}
EXPORT_SYMBOL_GPL(flow_offload_lookup);
@ -777,7 +777,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
void (*iter)(struct flow_offload *flow, void *data),
void *data)
{
@@ -428,6 +426,7 @@ nf_flow_table_iterate(struct nf_flowtabl
@@ -440,6 +438,7 @@ nf_flow_table_iterate(struct nf_flowtabl
return err;
}
@ -807,7 +807,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
+#endif /* _XT_FLOWOFFLOAD_H */
--- a/include/net/netfilter/nf_flow_table.h
+++ b/include/net/netfilter/nf_flow_table.h
@@ -270,6 +270,10 @@ void nf_flow_table_free(struct nf_flowta
@@ -273,6 +273,10 @@ void nf_flow_table_free(struct nf_flowta
void flow_offload_teardown(struct flow_offload *flow);

View file

@ -13,7 +13,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
--- a/net/sched/sch_fq_codel.c
+++ b/net/sched/sch_fq_codel.c
@@ -461,7 +461,11 @@ static int fq_codel_init(struct Qdisc *s
@@ -469,7 +469,11 @@ static int fq_codel_init(struct Qdisc *s
sch->limit = 10*1024;
q->flows_cnt = 1024;

View file

@ -14,7 +14,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
--- a/include/net/sch_generic.h
+++ b/include/net/sch_generic.h
@@ -623,12 +623,13 @@ extern struct Qdisc_ops noop_qdisc_ops;
@@ -624,12 +624,13 @@ extern struct Qdisc_ops noop_qdisc_ops;
extern struct Qdisc_ops pfifo_fast_ops;
extern struct Qdisc_ops mq_qdisc_ops;
extern struct Qdisc_ops noqueue_qdisc_ops;
@ -44,7 +44,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
device, it has to decide which ones to send first, which ones to
--- a/net/sched/sch_api.c
+++ b/net/sched/sch_api.c
@@ -2282,7 +2282,7 @@ static int __init pktsched_init(void)
@@ -2283,7 +2283,7 @@ static int __init pktsched_init(void)
return err;
}
@ -55,7 +55,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
register_qdisc(&pfifo_head_drop_qdisc_ops);
--- a/net/sched/sch_fq_codel.c
+++ b/net/sched/sch_fq_codel.c
@@ -701,7 +701,7 @@ static const struct Qdisc_class_ops fq_c
@@ -709,7 +709,7 @@ static const struct Qdisc_class_ops fq_c
.walk = fq_codel_walk,
};
@ -64,7 +64,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
.cl_ops = &fq_codel_class_ops,
.id = "fq_codel",
.priv_size = sizeof(struct fq_codel_sched_data),
@@ -716,6 +716,7 @@ static struct Qdisc_ops fq_codel_qdisc_o
@@ -724,6 +724,7 @@ static struct Qdisc_ops fq_codel_qdisc_o
.dump_stats = fq_codel_dump_stats,
.owner = THIS_MODULE,
};
@ -83,7 +83,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
EXPORT_SYMBOL(default_qdisc_ops);
static void qdisc_maybe_clear_missed(struct Qdisc *q,
@@ -1062,12 +1062,12 @@ static void attach_one_default_qdisc(str
@@ -1088,12 +1088,12 @@ static void attach_one_default_qdisc(str
void *_unused)
{
struct Qdisc *qdisc;

View file

@ -43,7 +43,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
+ bool "Atheros AR8216 switch LED support"
+ depends on (AR8216_PHY && LEDS_CLASS)
+
+#source "drivers/net/phy/b53/Kconfig"
+source "drivers/net/phy/b53/Kconfig"
+
+config IP17XX_PHY
+ tristate "Driver for IC+ IP17xx switches"
@ -102,7 +102,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
+obj-$(CONFIG_SWCONFIG) += swconfig.o
+obj-$(CONFIG_ADM6996_PHY) += adm6996.o
+obj-$(CONFIG_AR8216_PHY) += ar8216.o ar8327.o
+#obj-$(CONFIG_SWCONFIG_B53) += b53/
+obj-$(CONFIG_SWCONFIG_B53) += b53/
+obj-$(CONFIG_IP17XX_PHY) += ip17xx.o
+obj-$(CONFIG_PSB6970_PHY) += psb6970.o
+obj-$(CONFIG_RTL8306_PHY) += rtl8306.o

View file

@ -1,6 +1,6 @@
--- a/drivers/net/dsa/mv88e6xxx/chip.c
+++ b/drivers/net/dsa/mv88e6xxx/chip.c
@@ -2088,6 +2088,7 @@ static int mv88e6xxx_port_fdb_add(struct
@@ -2225,6 +2225,7 @@ static int mv88e6xxx_port_fdb_add(struct
struct mv88e6xxx_chip *chip = ds->priv;
int err;
@ -8,7 +8,7 @@
mv88e6xxx_reg_lock(chip);
err = mv88e6xxx_port_db_load_purge(chip, port, addr, vid,
MV88E6XXX_G1_ATU_DATA_STATE_UC_STATIC);
@@ -2102,6 +2103,7 @@ static int mv88e6xxx_port_fdb_del(struct
@@ -2239,6 +2240,7 @@ static int mv88e6xxx_port_fdb_del(struct
struct mv88e6xxx_chip *chip = ds->priv;
int err;

View file

@ -1,8 +1,8 @@
--- a/drivers/net/dsa/mv88e6xxx/chip.c
+++ b/drivers/net/dsa/mv88e6xxx/chip.c
@@ -2650,6 +2650,9 @@ static int mv88e6xxx_setup_port(struct m
if (dsa_is_cpu_port(ds, port))
reg = 0;
@@ -2817,6 +2817,9 @@ static int mv88e6xxx_setup_port(struct m
else
reg = 1 << port;
+ /* Disable ATU member violation interrupt */
+ reg |= MV88E6XXX_PORT_ASSOC_VECTOR_IGNORE_WRONG;

View file

@ -78,7 +78,7 @@ Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
netif_napi_del(&bgmac->napi);
--- a/drivers/net/ethernet/broadcom/bgmac.h
+++ b/drivers/net/ethernet/broadcom/bgmac.h
@@ -428,6 +428,7 @@
@@ -390,6 +390,7 @@
#define BGMAC_FEAT_CC4_IF_SW_TYPE_RGMII BIT(18)
#define BGMAC_FEAT_CC7_IF_TYPE_RGMII BIT(19)
#define BGMAC_FEAT_IDM_MASK BIT(20)
@ -86,7 +86,7 @@ Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
struct bgmac_slot_info {
union {
@@ -533,6 +534,9 @@ struct bgmac {
@@ -495,6 +496,9 @@ struct bgmac {
void (*cmn_maskset32)(struct bgmac *bgmac, u16 offset, u32 mask,
u32 set);
int (*phy_connect)(struct bgmac *bgmac);

View file

@ -0,0 +1,162 @@
From 3b6115d6b57a263bdc8c9b1df273bd4a7955eead Mon Sep 17 00:00:00 2001
From: Felix Fietkau <nbd@nbd.name>
Date: Sat, 8 Jul 2017 08:16:31 +0200
Subject: debloat: add some debloat patches, strip down procfs and make O_DIRECT support optional, saves ~15K after lzma on MIPS
Signed-off-by: Felix Fietkau <nbd@nbd.name>
---
net/Kconfig | 3 +++
net/core/Makefile | 3 ++-
net/core/sock.c | 2 ++
net/ipv4/Kconfig | 1 +
net/netlink/Kconfig | 1 +
net/packet/Kconfig | 1 +
net/unix/Kconfig | 1 +
7 files changed, 11 insertions(+), 1 deletion(-)
--- a/net/Kconfig
+++ b/net/Kconfig
@@ -98,6 +98,9 @@ source "net/mptcp/Kconfig"
endif # if INET
+config SOCK_DIAG
+ bool
+
config NETWORK_SECMARK
bool "Security Marking"
help
--- a/net/core/Makefile
+++ b/net/core/Makefile
@@ -10,9 +10,10 @@ obj-$(CONFIG_SYSCTL) += sysctl_net_core.
obj-y += dev.o dev_addr_lists.o dst.o netevent.o \
neighbour.o rtnetlink.o utils.o link_watch.o filter.o \
- sock_diag.o dev_ioctl.o tso.o sock_reuseport.o \
+ dev_ioctl.o tso.o sock_reuseport.o \
fib_notifier.o xdp.o flow_offload.o
+obj-$(CONFIG_SOCK_DIAG) += sock_diag.o
obj-y += net-sysfs.o
obj-$(CONFIG_PAGE_POOL) += page_pool.o
obj-$(CONFIG_PROC_FS) += net-procfs.o
--- a/net/core/sock.c
+++ b/net/core/sock.c
@@ -114,6 +114,7 @@
#include <linux/memcontrol.h>
#include <linux/prefetch.h>
#include <linux/compat.h>
+#include <linux/cookie.h>
#include <linux/uaccess.h>
@@ -143,6 +144,7 @@
static DEFINE_MUTEX(proto_list_mutex);
static LIST_HEAD(proto_list);
+DEFINE_COOKIE(sock_cookie);
static void sock_inuse_add(struct net *net, int val);
@@ -544,6 +546,18 @@ discard_and_relse:
}
EXPORT_SYMBOL(__sk_receive_skb);
+u64 __sock_gen_cookie(struct sock *sk)
+{
+ while (1) {
+ u64 res = atomic64_read(&sk->sk_cookie);
+
+ if (res)
+ return res;
+ res = gen_cookie_next(&sock_cookie);
+ atomic64_cmpxchg(&sk->sk_cookie, 0, res);
+ }
+}
+
INDIRECT_CALLABLE_DECLARE(struct dst_entry *ip6_dst_check(struct dst_entry *,
u32));
INDIRECT_CALLABLE_DECLARE(struct dst_entry *ipv4_dst_check(struct dst_entry *,
@@ -1967,9 +1981,11 @@ static void __sk_free(struct sock *sk)
if (likely(sk->sk_net_refcnt))
sock_inuse_add(sock_net(sk), -1);
+#ifdef CONFIG_SOCK_DIAG
if (unlikely(sk->sk_net_refcnt && sock_diag_has_destroy_listeners(sk)))
sock_diag_broadcast_destroy(sk);
else
+#endif
sk_destruct(sk);
}
--- a/net/core/sock_diag.c
+++ b/net/core/sock_diag.c
@@ -11,7 +11,6 @@
#include <linux/tcp.h>
#include <linux/workqueue.h>
#include <linux/nospec.h>
-#include <linux/cookie.h>
#include <linux/inet_diag.h>
#include <linux/sock_diag.h>
@@ -20,20 +19,6 @@ static int (*inet_rcv_compat)(struct sk_
static DEFINE_MUTEX(sock_diag_table_mutex);
static struct workqueue_struct *broadcast_wq;
-DEFINE_COOKIE(sock_cookie);
-
-u64 __sock_gen_cookie(struct sock *sk)
-{
- while (1) {
- u64 res = atomic64_read(&sk->sk_cookie);
-
- if (res)
- return res;
- res = gen_cookie_next(&sock_cookie);
- atomic64_cmpxchg(&sk->sk_cookie, 0, res);
- }
-}
-
int sock_diag_check_cookie(struct sock *sk, const __u32 *cookie)
{
u64 res;
--- a/net/ipv4/Kconfig
+++ b/net/ipv4/Kconfig
@@ -414,6 +414,7 @@ config INET_TUNNEL
config INET_DIAG
tristate "INET: socket monitoring interface"
+ select SOCK_DIAG
default y
help
Support for INET (TCP, DCCP, etc) socket monitoring interface used by
--- a/net/netlink/Kconfig
+++ b/net/netlink/Kconfig
@@ -5,6 +5,7 @@
config NETLINK_DIAG
tristate "NETLINK: socket monitoring interface"
+ select SOCK_DIAG
default n
help
Support for NETLINK socket monitoring interface used by the ss tool.
--- a/net/packet/Kconfig
+++ b/net/packet/Kconfig
@@ -19,6 +19,7 @@ config PACKET
config PACKET_DIAG
tristate "Packet: sockets monitoring interface"
depends on PACKET
+ select SOCK_DIAG
default n
help
Support for PF_PACKET sockets monitoring interface used by the ss tool.
--- a/net/unix/Kconfig
+++ b/net/unix/Kconfig
@@ -28,6 +28,7 @@ config UNIX_SCM
config UNIX_DIAG
tristate "UNIX: socket monitoring interface"
depends on UNIX
+ select SOCK_DIAG
default n
help
Support for UNIX socket monitoring interface used by the ss tool.

View file

@ -29,7 +29,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
--- a/fs/locks.c
+++ b/fs/locks.c
@@ -2993,6 +2993,8 @@ static const struct seq_operations locks
@@ -3044,6 +3044,8 @@ static const struct seq_operations locks
static int __init proc_locks_init(void)
{
@ -147,7 +147,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
IPC_MSG_IDS, sysvipc_msg_proc_show);
--- a/ipc/sem.c
+++ b/ipc/sem.c
@@ -266,6 +266,8 @@ void sem_exit_ns(struct ipc_namespace *n
@@ -268,6 +268,8 @@ void sem_exit_ns(struct ipc_namespace *n
void __init sem_init(void)
{
sem_init_ns(&init_ipc_ns);
@ -169,7 +169,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
" key shmid perms size cpid lpid nattch uid gid cuid cgid atime dtime ctime rss swap\n",
--- a/ipc/util.c
+++ b/ipc/util.c
@@ -140,6 +140,9 @@ void __init ipc_init_proc_interface(cons
@@ -141,6 +141,9 @@ void __init ipc_init_proc_interface(cons
struct proc_dir_entry *pde;
struct ipc_proc_iface *iface;
@ -224,7 +224,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
if (!root_irq_dir)
--- a/kernel/time/timer_list.c
+++ b/kernel/time/timer_list.c
@@ -370,6 +370,8 @@ static int __init init_timer_list_procfs
@@ -350,6 +350,8 @@ static int __init init_timer_list_procfs
{
struct proc_dir_entry *pe;
@ -235,7 +235,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
if (!pe)
--- a/mm/vmalloc.c
+++ b/mm/vmalloc.c
@@ -3572,6 +3572,8 @@ static const struct seq_operations vmall
@@ -3899,6 +3899,8 @@ static const struct seq_operations vmall
static int __init proc_vmalloc_init(void)
{
@ -286,7 +286,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
goto err;
--- a/net/core/net-procfs.c
+++ b/net/core/net-procfs.c
@@ -290,10 +290,12 @@ static int __net_init dev_proc_net_init(
@@ -287,10 +287,12 @@ static int __net_init dev_proc_net_init(
if (!proc_create_net("dev", 0444, net->proc_net, &dev_seq_ops,
sizeof(struct seq_net_private)))
goto out;
@ -301,7 +301,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
sizeof(struct seq_net_private)))
goto out_softnet;
@@ -303,9 +305,11 @@ static int __net_init dev_proc_net_init(
@@ -300,9 +302,11 @@ static int __net_init dev_proc_net_init(
out:
return rc;
out_ptype:
@ -315,7 +315,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
out_dev:
remove_proc_entry("dev", net->proc_net);
goto out;
@@ -315,8 +319,10 @@ static void __net_exit dev_proc_net_exit
@@ -312,8 +316,10 @@ static void __net_exit dev_proc_net_exit
{
wext_proc_exit(net);
@ -330,7 +330,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
--- a/net/core/sock.c
+++ b/net/core/sock.c
@@ -3682,6 +3682,8 @@ static __net_initdata struct pernet_oper
@@ -3839,6 +3839,8 @@ static __net_initdata struct pernet_oper
static int __init proto_init(void)
{
@ -341,7 +341,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
--- a/net/ipv4/fib_trie.c
+++ b/net/ipv4/fib_trie.c
@@ -2986,11 +2986,13 @@ static const struct seq_operations fib_r
@@ -3015,11 +3015,13 @@ static const struct seq_operations fib_r
int __net_init fib_proc_init(struct net *net)
{
@ -357,7 +357,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
fib_triestat_seq_show, NULL))
goto out2;
@@ -3001,17 +3003,21 @@ int __net_init fib_proc_init(struct net
@@ -3030,17 +3032,21 @@ int __net_init fib_proc_init(struct net
return 0;
out3:
@ -385,7 +385,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
--- a/net/ipv4/proc.c
+++ b/net/ipv4/proc.c
@@ -528,5 +528,8 @@ static __net_initdata struct pernet_oper
@@ -553,5 +553,8 @@ static __net_initdata struct pernet_oper
int __init ip_misc_proc_init(void)
{
@ -396,7 +396,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
}
--- a/net/ipv4/route.c
+++ b/net/ipv4/route.c
@@ -410,6 +410,9 @@ static struct pernet_operations ip_rt_pr
@@ -386,6 +386,9 @@ static struct pernet_operations ip_rt_pr
static int __init ip_rt_proc_init(void)
{

View file

@ -13,7 +13,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
--- a/drivers/base/Kconfig
+++ b/drivers/base/Kconfig
@@ -184,7 +184,7 @@ config SOC_BUS
@@ -187,7 +187,7 @@ config SOC_BUS
source "drivers/base/regmap/Kconfig"
config DMA_SHARED_BUFFER
@ -22,14 +22,6 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
default n
select IRQ_WORK
help
--- a/drivers/dma-buf/heaps/Makefile
+++ b/drivers/dma-buf/heaps/Makefile
@@ -1,3 +1,3 @@
# SPDX-License-Identifier: GPL-2.0
-obj-$(CONFIG_DMABUF_HEAPS_SYSTEM) += system_heap.o
-obj-$(CONFIG_DMABUF_HEAPS_CMA) += cma_heap.o
+dma-buf-objs-$(CONFIG_DMABUF_HEAPS_SYSTEM) += system_heap.o
+dma-buf-objs-$(CONFIG_DMABUF_HEAPS_CMA) += cma_heap.o
--- a/drivers/dma-buf/Makefile
+++ b/drivers/dma-buf/Makefile
@@ -1,15 +1,19 @@
@ -45,8 +37,8 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
-obj-$(CONFIG_SW_SYNC) += sw_sync.o sync_debug.o
-obj-$(CONFIG_UDMABUF) += udmabuf.o
+dma-buf-objs-$(CONFIG_DMABUF_HEAPS) += dma-heap.o
+obj-$(CONFIG_DMABUF_HEAPS) += heaps/
+dma-buf-objs-$(CONFIG_SYNC_FILE) += sync_file.o
+dma-buf-objs-$(CONFIG_DMABUF_HEAPS) += heaps/
+dma-buf-objs-$(CONFIG_SYNC_FILE) += sync_file.o
+dma-buf-objs-$(CONFIG_SW_SYNC) += sw_sync.o sync_debug.o
+dma-buf-objs-$(CONFIG_UDMABUF) += udmabuf.o
@ -61,7 +53,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
+dma-shared-buffer-objs := $(dma-buf-objs-y)
--- a/drivers/dma-buf/dma-buf.c
+++ b/drivers/dma-buf/dma-buf.c
@@ -1418,4 +1418,5 @@ static void __exit dma_buf_deinit(void)
@@ -1485,4 +1485,5 @@ static void __exit dma_buf_deinit(void)
dma_buf_uninit_debugfs();
kern_unmount(dma_buf_mnt);
}
@ -70,7 +62,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
+MODULE_LICENSE("GPL");
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -3049,6 +3049,7 @@ int wake_up_state(struct task_struct *p,
@@ -3939,6 +3939,7 @@ int wake_up_state(struct task_struct *p,
{
return try_to_wake_up(p, state, 0);
}
@ -80,7 +72,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
* Perform scheduler related setup for a newly forked process p.
--- a/fs/d_path.c
+++ b/fs/d_path.c
@@ -311,6 +311,7 @@ char *dynamic_dname(struct dentry *dentr
@@ -283,6 +283,7 @@ char *dynamic_dname(struct dentry *dentr
buffer += buflen - sz;
return memcpy(buffer, temp, sz);
}