From bb9ce1c8bfff389650e74df477b832d1324c326d Mon Sep 17 00:00:00 2001 From: coolsnowwolf Date: Mon, 10 Sep 2018 18:09:42 +0800 Subject: [PATCH 1/5] Enable FPU EMULATOR for MIPS --- target/linux/ar71xx/config-4.14 | 1 + target/linux/ar71xx/config-4.9 | 4 ++++ target/linux/ath79/config-4.14 | 1 + target/linux/ramips/mt7620/config-4.14 | 1 + target/linux/ramips/mt7621/config-4.14 | 1 + target/linux/ramips/mt76x8/config-4.14 | 1 + target/linux/ramips/rt288x/config-4.14 | 1 + target/linux/ramips/rt305x/config-4.14 | 1 + target/linux/ramips/rt3883/config-4.14 | 1 + 9 files changed, 12 insertions(+) diff --git a/target/linux/ar71xx/config-4.14 b/target/linux/ar71xx/config-4.14 index 535b5195c..61290b515 100644 --- a/target/linux/ar71xx/config-4.14 +++ b/target/linux/ar71xx/config-4.14 @@ -483,3 +483,4 @@ CONFIG_SYS_SUPPORTS_ZBOOT=y CONFIG_SYS_SUPPORTS_ZBOOT_UART_PROM=y CONFIG_TICK_CPU_ACCOUNTING=y CONFIG_USB_SUPPORT=y +CONFIG_MIPS_FPU_EMULATOR=y diff --git a/target/linux/ar71xx/config-4.9 b/target/linux/ar71xx/config-4.9 index 8d25692ec..28ca1a196 100644 --- a/target/linux/ar71xx/config-4.9 +++ b/target/linux/ar71xx/config-4.9 @@ -282,6 +282,8 @@ CONFIG_ATH79=y # CONFIG_ATH79_PCI_ATH9K_FIXUP is not set # CONFIG_ATH79_ROUTERBOOT is not set CONFIG_ATH79_WDT=y +CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE=y +# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set CONFIG_CEVT_R4K=y CONFIG_CLKDEV_LOOKUP=y CONFIG_CLONE_BACKWARDS=y @@ -397,6 +399,7 @@ CONFIG_MIPS_ASID_SHIFT=0 CONFIG_MIPS_CLOCK_VSYSCALL=y # CONFIG_MIPS_CMDLINE_BUILTIN_EXTEND is not set CONFIG_MIPS_CMDLINE_FROM_BOOTLOADER=y +CONFIG_MIPS_FPU_EMULATOR=y # CONFIG_MIPS_HUGE_TLB_SUPPORT is not set CONFIG_MIPS_L1_CACHE_SHIFT=5 CONFIG_MIPS_MACHINE=y @@ -452,6 +455,7 @@ CONFIG_RTL8367_PHY=y # CONFIG_SERIAL_8250_FSL is not set CONFIG_SERIAL_8250_NR_UARTS=1 CONFIG_SERIAL_8250_RUNTIME_UARTS=1 +# CONFIG_SHORTCUT_FE is not set # CONFIG_SOC_AR71XX is not set # CONFIG_SOC_AR724X is not set # CONFIG_SOC_AR913X is not set diff --git a/target/linux/ath79/config-4.14 b/target/linux/ath79/config-4.14 index a8349040a..2b0cd4fe5 100644 --- a/target/linux/ath79/config-4.14 +++ b/target/linux/ath79/config-4.14 @@ -230,3 +230,4 @@ CONFIG_TICK_CPU_ACCOUNTING=y CONFIG_TINY_SRCU=y CONFIG_USB_SUPPORT=y CONFIG_USE_OF=y +CONFIG_MIPS_FPU_EMULATOR=y diff --git a/target/linux/ramips/mt7620/config-4.14 b/target/linux/ramips/mt7620/config-4.14 index 1162ed47b..bc68005cc 100644 --- a/target/linux/ramips/mt7620/config-4.14 +++ b/target/linux/ramips/mt7620/config-4.14 @@ -233,3 +233,4 @@ CONFIG_TINY_SRCU=y CONFIG_USB_SUPPORT=y CONFIG_USE_OF=y CONFIG_WATCHDOG_CORE=y +CONFIG_MIPS_FPU_EMULATOR=y diff --git a/target/linux/ramips/mt7621/config-4.14 b/target/linux/ramips/mt7621/config-4.14 index 0e0602378..c4daff781 100644 --- a/target/linux/ramips/mt7621/config-4.14 +++ b/target/linux/ramips/mt7621/config-4.14 @@ -287,3 +287,4 @@ CONFIG_WEAK_ORDERING=y CONFIG_XPS=y CONFIG_ZLIB_DEFLATE=y CONFIG_ZLIB_INFLATE=y +CONFIG_MIPS_FPU_EMULATOR=y diff --git a/target/linux/ramips/mt76x8/config-4.14 b/target/linux/ramips/mt76x8/config-4.14 index 81e084893..c9c9abcab 100644 --- a/target/linux/ramips/mt76x8/config-4.14 +++ b/target/linux/ramips/mt76x8/config-4.14 @@ -228,3 +228,4 @@ CONFIG_TINY_SRCU=y CONFIG_USB_SUPPORT=y CONFIG_USE_OF=y CONFIG_WATCHDOG_CORE=y +CONFIG_MIPS_FPU_EMULATOR=y diff --git a/target/linux/ramips/rt288x/config-4.14 b/target/linux/ramips/rt288x/config-4.14 index de4dffe88..ff358c8b4 100644 --- a/target/linux/ramips/rt288x/config-4.14 +++ b/target/linux/ramips/rt288x/config-4.14 @@ -220,3 +220,4 @@ CONFIG_USB_OHCI_HCD_PLATFORM=m CONFIG_USB_SUPPORT=y CONFIG_USE_OF=y CONFIG_WATCHDOG_CORE=y +CONFIG_MIPS_FPU_EMULATOR=y diff --git a/target/linux/ramips/rt305x/config-4.14 b/target/linux/ramips/rt305x/config-4.14 index 346a8a881..e667e0c94 100644 --- a/target/linux/ramips/rt305x/config-4.14 +++ b/target/linux/ramips/rt305x/config-4.14 @@ -197,3 +197,4 @@ CONFIG_TICK_CPU_ACCOUNTING=y CONFIG_USB_SUPPORT=y CONFIG_USE_OF=y CONFIG_WATCHDOG_CORE=y +CONFIG_MIPS_FPU_EMULATOR=y diff --git a/target/linux/ramips/rt3883/config-4.14 b/target/linux/ramips/rt3883/config-4.14 index 93d803e2e..08a99c15e 100644 --- a/target/linux/ramips/rt3883/config-4.14 +++ b/target/linux/ramips/rt3883/config-4.14 @@ -223,3 +223,4 @@ CONFIG_TINY_SRCU=y CONFIG_USB_SUPPORT=y CONFIG_USE_OF=y CONFIG_WATCHDOG_CORE=y +CONFIG_MIPS_FPU_EMULATOR=y From 255607e1ed629e2b46694f8caaa49497ffb7fb2e Mon Sep 17 00:00:00 2001 From: coolsnowwolf Date: Mon, 10 Sep 2018 18:15:16 +0800 Subject: [PATCH 2/5] Enable kernel 4.9 TCP BBR and YEAH --- target/linux/generic/config-4.9 | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/target/linux/generic/config-4.9 b/target/linux/generic/config-4.9 index 77cf3b5dc..fe9310bd8 100644 --- a/target/linux/generic/config-4.9 +++ b/target/linux/generic/config-4.9 @@ -1003,7 +1003,8 @@ CONFIG_DEBUG_KERNEL=y # CONFIG_DEBUG_WX is not set # CONFIG_DEBUG_ZBOOT is not set # CONFIG_DECNET is not set -CONFIG_DEFAULT_CUBIC=y +CONFIG_DEFAULT_BBR=y +# CONFIG_DEFAULT_CUBIC is not set CONFIG_DEFAULT_DEADLINE=y CONFIG_DEFAULT_HOSTNAME="(none)" CONFIG_DEFAULT_IOSCHED="deadline" @@ -1012,7 +1013,8 @@ CONFIG_DEFAULT_MMAP_MIN_ADDR=4096 # CONFIG_DEFAULT_RENO is not set CONFIG_DEFAULT_SECURITY="" CONFIG_DEFAULT_SECURITY_DAC=y -CONFIG_DEFAULT_TCP_CONG="cubic" +CONFIG_DEFAULT_TCP_CONG="bbr" +# CONFIG_DEFAULT_VEGAS is not set CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" # CONFIG_DELL_RBTN is not set # CONFIG_DELL_SMO8800 is not set @@ -4505,7 +4507,7 @@ CONFIG_SYSVIPC_SYSCTL=y # CONFIG_TCG_XEN is not set # CONFIG_TCIC is not set CONFIG_TCP_CONG_ADVANCED=y -# CONFIG_TCP_CONG_BBR is not set +CONFIG_TCP_CONG_BBR=y # CONFIG_TCP_CONG_BIC is not set # CONFIG_TCP_CONG_CDG is not set CONFIG_TCP_CONG_CUBIC=y @@ -4517,10 +4519,10 @@ CONFIG_TCP_CONG_CUBIC=y # CONFIG_TCP_CONG_LP is not set # CONFIG_TCP_CONG_NV is not set # CONFIG_TCP_CONG_SCALABLE is not set -# CONFIG_TCP_CONG_VEGAS is not set +CONFIG_TCP_CONG_VEGAS=y # CONFIG_TCP_CONG_VENO is not set # CONFIG_TCP_CONG_WESTWOOD is not set -# CONFIG_TCP_CONG_YEAH is not set +CONFIG_TCP_CONG_YEAH=y # CONFIG_TCP_MD5SIG is not set # CONFIG_TCS3414 is not set # CONFIG_TCS3472 is not set From 51b05f165ff8221e4c6de43ecc46a417100fce3b Mon Sep 17 00:00:00 2001 From: coolsnowwolf Date: Mon, 10 Sep 2018 19:57:02 +0800 Subject: [PATCH 3/5] refresh 4.14 ppp patch --- package/network/services/ppp/Makefile | 16 +++++++++++----- .../network/services/ppp/files/etc/ppp/options | 2 -- package/network/services/ppp/files/ppp.sh | 11 ++--------- .../services/ppp/patches/001-honor-ldflags.patch | 6 +++--- .../services/ppp/patches/203-opt_flags.patch | 11 +++++++++++ .../ppp/patches/500-add-pptp-plugin.patch | 3 ++- .../services/ppp/patches/511-pptp_cflags.patch | 11 +++++++++++ 7 files changed, 40 insertions(+), 20 deletions(-) create mode 100644 package/network/services/ppp/patches/511-pptp_cflags.patch diff --git a/package/network/services/ppp/Makefile b/package/network/services/ppp/Makefile index 282e8f17f..9fbee90f1 100644 --- a/package/network/services/ppp/Makefile +++ b/package/network/services/ppp/Makefile @@ -10,13 +10,14 @@ include $(INCLUDE_DIR)/kernel.mk PKG_NAME:=ppp PKG_VERSION:=2.4.7 -PKG_RELEASE:=12 +PKG_RELEASE:=13 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=https://download.samba.org/pub/ppp/ PKG_HASH:=02e0a3dd3e4799e33103f70ec7df75348c8540966ee7c948e4ed8a42bbccfb30 PKG_MAINTAINER:=Felix Fietkau PKG_LICENSE:=BSD-4-Clause +PKG_CPE_ID:=cpe:/a:samba:ppp PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION) @@ -35,7 +36,7 @@ endef define Package/ppp $(call Package/ppp/Default) - DEPENDS:=+kmod-ppp +libpthread +shellsync + DEPENDS:=+kmod-ppp TITLE:=PPP daemon VARIANT:=default endef @@ -177,14 +178,19 @@ $(call Build/Configure/Default,, \ UNAME_M="$(ARCH)" \ ) mkdir -p $(PKG_BUILD_DIR)/pppd/plugins/pppoatm/linux - cp \ + $(CP) \ $(LINUX_DIR)/include/linux/compiler.h \ $(LINUX_DIR)/include/$(LINUX_UAPI_DIR)linux/atm*.h \ $(PKG_BUILD_DIR)/pppd/plugins/pppoatm/linux/ + + # Kernel 4.14.9+ only, ignore the exit status of cp in case the file + # doesn't exits + -$(CP) $(LINUX_DIR)/include/linux/compiler_types.h \ + $(PKG_BUILD_DIR)/pppd/plugins/pppoatm/linux/ endef -TARGET_CFLAGS += -ffunction-sections -fdata-sections -TARGET_LDFLAGS += -Wl,--gc-sections +TARGET_CFLAGS += -ffunction-sections -fdata-sections -flto +TARGET_LDFLAGS += -Wl,--gc-sections -flto -fuse-linker-plugin MAKE_FLAGS += COPTS="$(TARGET_CFLAGS)" \ PRECOMPILED_FILTER=1 \ diff --git a/package/network/services/ppp/files/etc/ppp/options b/package/network/services/ppp/files/etc/ppp/options index 6b93f7bdb..dbb2bdb3e 100644 --- a/package/network/services/ppp/files/etc/ppp/options +++ b/package/network/services/ppp/files/etc/ppp/options @@ -6,5 +6,3 @@ nopcomp nocrtscts lock maxfail 0 -lcp-echo-failure 5 -lcp-echo-interval 1 diff --git a/package/network/services/ppp/files/ppp.sh b/package/network/services/ppp/files/ppp.sh index 875714b35..99d5e4939 100755 --- a/package/network/services/ppp/files/ppp.sh +++ b/package/network/services/ppp/files/ppp.sh @@ -120,6 +120,8 @@ ppp_generic_setup() { } } + [ -n "$keepalive" ] || keepalive="5 1" + local lcp_failure="${keepalive%%[, ]*}" local lcp_interval="${keepalive##*[, ]}" local lcp_adaptive="lcp-echo-adaptive" @@ -223,16 +225,7 @@ proto_pppoe_setup() { json_get_var service service json_get_var host_uniq host_uniq -#By 蝈蝈:并发拨号同步的前期准备 - syncppp_option="" - [ "$(uci get syncdial.config.enabled)" == "1" ] && { - ppp_if_cnt=$(cat /etc/config/network | grep -c "proto 'pppoe'") - syncppp_option="syncppp $ppp_if_cnt" - shellsync $ppp_if_cnt 10 - } - ppp_generic_setup "$config" \ - $syncppp_option \ plugin rp-pppoe.so \ ${ac:+rp_pppoe_ac "$ac"} \ ${service:+rp_pppoe_service "$service"} \ diff --git a/package/network/services/ppp/patches/001-honor-ldflags.patch b/package/network/services/ppp/patches/001-honor-ldflags.patch index 132881153..fae66a5ec 100644 --- a/package/network/services/ppp/patches/001-honor-ldflags.patch +++ b/package/network/services/ppp/patches/001-honor-ldflags.patch @@ -5,15 +5,15 @@ radius.so: radius.o libradiusclient.a - $(CC) -o radius.so -shared radius.o libradiusclient.a -+ $(CC) $(COPTS) -o radius.so -shared radius.o libradiusclient.a ++ $(CC) $(CFLAGS) -o radius.so -shared radius.o libradiusclient.a radattr.so: radattr.o - $(CC) -o radattr.so -shared radattr.o -+ $(CC) $(COPTS) -o radattr.so -shared radattr.o ++ $(CC) $(CFLAGS) -o radattr.so -shared radattr.o radrealms.so: radrealms.o - $(CC) -o radrealms.so -shared radrealms.o -+ $(CC) $(COPTS) -o radrealms.so -shared radrealms.o ++ $(CC) $(CFLAGS) -o radrealms.so -shared radrealms.o CLIENTOBJS = avpair.o buildreq.o config.o dict.o ip_util.o \ clientid.o sendserver.o lock.o util.o md5.o diff --git a/package/network/services/ppp/patches/203-opt_flags.patch b/package/network/services/ppp/patches/203-opt_flags.patch index d0eb91829..069b8585f 100644 --- a/package/network/services/ppp/patches/203-opt_flags.patch +++ b/package/network/services/ppp/patches/203-opt_flags.patch @@ -30,3 +30,14 @@ Signed-off-by: Jo-Philipp Wich OBJS = pppdump.o bsd-comp.o deflate.o zlib.o INSTALL= install +--- a/pppd/plugins/rp-pppoe/Makefile.linux ++++ b/pppd/plugins/rp-pppoe/Makefile.linux +@@ -39,7 +39,7 @@ debug.o: debug.c + $(CC) $(CFLAGS) -c -o debug.o debug.c + + rp-pppoe.so: plugin.o discovery.o if.o common.o +- $(CC) $(CFLAGS) -o rp-pppoe.so -shared plugin.o discovery.o if.o common.o ++ $(CC) $(CFLAGS) -fPIC -o rp-pppoe.so -shared plugin.o discovery.o if.o common.o + + install: all + $(INSTALL) -d -m 755 $(LIBDIR) diff --git a/package/network/services/ppp/patches/500-add-pptp-plugin.patch b/package/network/services/ppp/patches/500-add-pptp-plugin.patch index d984e1b16..5ed861d54 100644 --- a/package/network/services/ppp/patches/500-add-pptp-plugin.patch +++ b/package/network/services/ppp/patches/500-add-pptp-plugin.patch @@ -1064,7 +1064,7 @@ + struct in_addr localbind); --- /dev/null +++ b/pppd/plugins/pptp/pptp_ctrl.c -@@ -0,0 +1,1077 @@ +@@ -0,0 +1,1078 @@ +/* pptp_ctrl.c ... handle PPTP control connection. + * C. Scott Ananian + * @@ -1083,6 +1083,7 @@ +#include +#include +#include ++#include "pppd.h" +#include "pptp_msg.h" +#include "pptp_ctrl.h" +#include "pptp_options.h" diff --git a/package/network/services/ppp/patches/511-pptp_cflags.patch b/package/network/services/ppp/patches/511-pptp_cflags.patch new file mode 100644 index 000000000..548bf41c1 --- /dev/null +++ b/package/network/services/ppp/patches/511-pptp_cflags.patch @@ -0,0 +1,11 @@ +--- a/pppd/plugins/pptp/Makefile.linux ++++ b/pppd/plugins/pptp/Makefile.linux +@@ -20,7 +20,7 @@ all: pptp.so + $(CC) $(CFLAGS) -c -o $@ $< + + pptp.so: dirutil.o orckit_quirks.o pptp.o pptp_callmgr.o pptp_ctrl.o pptp_quirks.o util.o vector.o +- $(CC) -o pptp.so -shared dirutil.o orckit_quirks.o pptp.o pptp_callmgr.o pptp_ctrl.o pptp_quirks.o util.o vector.o ++ $(CC) -fPIC -o pptp.so -shared dirutil.o orckit_quirks.o pptp.o pptp_callmgr.o pptp_ctrl.o pptp_quirks.o util.o vector.o + + install: all + $(INSTALL) -d -m 755 $(LIBDIR) From 32fccaed212beccfabb9c731ad3f194cdd2188ea Mon Sep 17 00:00:00 2001 From: coolsnowwolf Date: Mon, 10 Sep 2018 20:03:10 +0800 Subject: [PATCH 4/5] add ppp sync dep --- package/network/services/ppp/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package/network/services/ppp/Makefile b/package/network/services/ppp/Makefile index 9fbee90f1..0c81c46a8 100644 --- a/package/network/services/ppp/Makefile +++ b/package/network/services/ppp/Makefile @@ -36,7 +36,7 @@ endef define Package/ppp $(call Package/ppp/Default) - DEPENDS:=+kmod-ppp + DEPENDS:=+kmod-ppp +libpthread +shellsync TITLE:=PPP daemon VARIANT:=default endef From 1df474ba02a1f92cf801fb6b16bb20f69d2f3855 Mon Sep 17 00:00:00 2001 From: coolsnowwolf Date: Mon, 10 Sep 2018 20:08:58 +0800 Subject: [PATCH 5/5] fix ppp.sh sync option --- package/network/services/ppp/files/ppp.sh | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/package/network/services/ppp/files/ppp.sh b/package/network/services/ppp/files/ppp.sh index 99d5e4939..b56b83c72 100755 --- a/package/network/services/ppp/files/ppp.sh +++ b/package/network/services/ppp/files/ppp.sh @@ -225,7 +225,15 @@ proto_pppoe_setup() { json_get_var service service json_get_var host_uniq host_uniq - ppp_generic_setup "$config" \ +#By 壺ͬǰ׼ + syncppp_option="" + [ "$(uci get syncdial.config.enabled)" == "1" ] && { + ppp_if_cnt=$(cat /etc/config/network | grep -c "proto 'pppoe'") + syncppp_option="syncppp $ppp_if_cnt" + shellsync $ppp_if_cnt 10 + } + ppp_generic_setup "$config" \ + $syncppp_option \ plugin rp-pppoe.so \ ${ac:+rp_pppoe_ac "$ac"} \ ${service:+rp_pppoe_service "$service"} \