From 82a0fc5096b6ae01114fd7a498999ba20a0fa374 Mon Sep 17 00:00:00 2001 From: "Ycarus (Yannick Chabanois)" Date: Tue, 8 Dec 2020 09:24:17 +0100 Subject: [PATCH 1/3] BBR2 patch only work on 64bits images for now --- build.sh | 13 ++++++++----- config | 1 - config-bpi-r64 | 1 + config-espressobin | 1 + config-r2s | 1 + config-rpi3 | 1 + config-rpi4 | 1 + config-x86_64 | 1 + 8 files changed, 14 insertions(+), 6 deletions(-) diff --git a/build.sh b/build.sh index b3be739c..3c35db31 100755 --- a/build.sh +++ b/build.sh @@ -236,12 +236,15 @@ if ! patch -Rf -N -p1 -s --dry-run < ../../patches/nanqinlang.patch; then fi echo "Done" -echo "Checking if BBRv2 patch is set or not" -if ! patch -Rf -N -p1 -s --dry-run < ../../patches/bbr2.patch; then - echo "apply..." - patch -N -p1 -s < ../../patches/bbr2.patch +# Add BBR2 patch, only working on 64bits images for now +if [ "$OMR_TARGET" = "x86_64" ] || [ "$OMR_TARGET" = "bpi-r64" ] || [ "$OMR_TARGET" = "rpi4" ] || [ "$OMR_TARGET" = "espressobin" ] || [ "$OMR_TARGET" = "r2s" ] || [ "$OMR_TARGET" = "rpi3" ]; then + echo "Checking if BBRv2 patch is set or not" + if ! patch -Rf -N -p1 -s --dry-run < ../../patches/bbr2.patch; then + echo "apply..." + patch -N -p1 -s < ../../patches/bbr2.patch + fi + echo "Done" fi -echo "Done" echo "Checking if smsc75xx patch is set or not" if ! patch -Rf -N -p1 -s --dry-run < ../../patches/smsc75xx.patch; then diff --git a/config b/config index 79a77f3f..9f0e4e5a 100644 --- a/config +++ b/config @@ -191,7 +191,6 @@ CONFIG_KERNEL_TCP_CONG_WESTWOOD=y CONFIG_KERNEL_TCP_CONG_YEAH=y CONFIG_KERNEL_TCP_CONG_LIA=y CONFIG_KERNEL_TCP_CONG_BBR=y -CONFIG_KERNEL_TCP_CONG_BBR2=y CONFIG_KERNEL_TCP_CONG_NANQINLANG=y CONFIG_KERNEL_TCP_CONG_OLIA=y CONFIG_KERNEL_TCP_CONG_WVEGAS=y diff --git a/config-bpi-r64 b/config-bpi-r64 index c2eefeed..74443ce7 100644 --- a/config-bpi-r64 +++ b/config-bpi-r64 @@ -7,3 +7,4 @@ CONFIG_PACKAGE_uboot-mediatek=y CONFIG_PACKAGE_uboot-envtools=y CONFIG_PACKAGE_mt7622-preloader=y CONFIG_KERNEL_ARM64_MODULE_PLTS=y +CONFIG_KERNEL_TCP_CONG_BBR2=y diff --git a/config-espressobin b/config-espressobin index 6e43d5d0..ed5b4188 100644 --- a/config-espressobin +++ b/config-espressobin @@ -6,3 +6,4 @@ CONFIG_PACKAGE_luci-app-advanced-reboot=y # CONFIG_KERNEL_CC_OPTIMIZE_FOR_PERFORMANCE is not set CONFIG_KERNEL_CC_OPTIMIZE_FOR_SIZE=y CONFIG_KERNEL_ARM_MODULE_PLTS=y +CONFIG_KERNEL_TCP_CONG_BBR2=y diff --git a/config-r2s b/config-r2s index af12d580..32b989e7 100644 --- a/config-r2s +++ b/config-r2s @@ -3,3 +3,4 @@ CONFIG_TARGET_rockchip_armv8=y CONFIG_TARGET_rockchip_armv8_DEVICE_friendlyarm_nanopi-r2s=y CONFIG_PACKAGE_kmod-6lowpan=y CONFIG_KERNEL_ARM_MODULE_PLTS=y +CONFIG_KERNEL_TCP_CONG_BBR2=y diff --git a/config-rpi3 b/config-rpi3 index da6c42db..70db978f 100644 --- a/config-rpi3 +++ b/config-rpi3 @@ -4,3 +4,4 @@ CONFIG_TARGET_bcm27xx_bcm2710_DEVICE_rpi-3=y CONFIG_PACKAGE_kmod-ath10k-ct=n CONFIG_PACKAGE_kmod-ath9k=y CONFIG_KERNEL_ARM_MODULE_PLTS=y +CONFIG_KERNEL_TCP_CONG_BBR2=y diff --git a/config-rpi4 b/config-rpi4 index 673501f4..c2840279 100644 --- a/config-rpi4 +++ b/config-rpi4 @@ -6,3 +6,4 @@ CONFIG_PACKAGE_kmod-ath9k=y CONFIG_PACKAGE_bcm27xx-eeprom=y CONFIG_PACKAGE_bcm27xx-userland=y CONFIG_KERNEL_ARM64_MODULE_PLTS=y +CONFIG_KERNEL_TCP_CONG_BBR2=y diff --git a/config-x86_64 b/config-x86_64 index 25699d13..78b1a42c 100644 --- a/config-x86_64 +++ b/config-x86_64 @@ -9,3 +9,4 @@ CONFIG_PACKAGE_kmod-ath9k=y CONFIG_GRUB_IMAGES=y CONFIG_EFI_IMAGES=y # CONFIG_VMDK_IMAGES is not set +CONFIG_KERNEL_TCP_CONG_BBR2=y From 2915c063de5f736c9344e82f3b8de2ce4af47f42 Mon Sep 17 00:00:00 2001 From: "Ycarus (Yannick Chabanois)" Date: Tue, 8 Dec 2020 21:09:49 +0100 Subject: [PATCH 2/3] Fix compilation --- build.sh | 12 +++++------- .../target/linux/generic/hack-5.4/693-tcp_bbr2.patch | 4 ++-- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/build.sh b/build.sh index 3c35db31..c9d66079 100755 --- a/build.sh +++ b/build.sh @@ -237,14 +237,12 @@ fi echo "Done" # Add BBR2 patch, only working on 64bits images for now -if [ "$OMR_TARGET" = "x86_64" ] || [ "$OMR_TARGET" = "bpi-r64" ] || [ "$OMR_TARGET" = "rpi4" ] || [ "$OMR_TARGET" = "espressobin" ] || [ "$OMR_TARGET" = "r2s" ] || [ "$OMR_TARGET" = "rpi3" ]; then - echo "Checking if BBRv2 patch is set or not" - if ! patch -Rf -N -p1 -s --dry-run < ../../patches/bbr2.patch; then - echo "apply..." - patch -N -p1 -s < ../../patches/bbr2.patch - fi - echo "Done" +echo "Checking if BBRv2 patch is set or not" +if ! patch -Rf -N -p1 -s --dry-run < ../../patches/bbr2.patch; then + echo "apply..." + patch -N -p1 -s < ../../patches/bbr2.patch fi +echo "Done" echo "Checking if smsc75xx patch is set or not" if ! patch -Rf -N -p1 -s --dry-run < ../../patches/smsc75xx.patch; then diff --git a/root/target/linux/generic/hack-5.4/693-tcp_bbr2.patch b/root/target/linux/generic/hack-5.4/693-tcp_bbr2.patch index c8d419d7..32913f78 100644 --- a/root/target/linux/generic/hack-5.4/693-tcp_bbr2.patch +++ b/root/target/linux/generic/hack-5.4/693-tcp_bbr2.patch @@ -282,7 +282,7 @@ index 32772d6ded4e..2d6677521575 100644 + u32 gso_max_size) +{ + u32 segs; -+ u64 bytes; ++ u32 bytes; + + /* Budget a TSO/GSO burst size allowance based on bw (pacing_rate). */ + bytes = sk->sk_pacing_rate >> sk->sk_pacing_shift; @@ -345,7 +345,7 @@ index 32772d6ded4e..2d6677521575 100644 + u32 gso_max_size) +{ + u32 segs; -+ u64 bytes; ++ u32 bytes; + + /* Budget a TSO/GSO burst size allowance based on bw (pacing_rate). */ + bytes = sk->sk_pacing_rate >> sk->sk_pacing_shift; From 3e039afbf3f5594a0663ffc059a8e973825d0b33 Mon Sep 17 00:00:00 2001 From: "Ycarus (Yannick Chabanois)" Date: Tue, 8 Dec 2020 21:10:16 +0100 Subject: [PATCH 3/3] Small changes --- config-p2w_r619ac | 2 +- root/rules.mk | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/config-p2w_r619ac b/config-p2w_r619ac index 7a6014fe..3ce74bfc 100644 --- a/config-p2w_r619ac +++ b/config-p2w_r619ac @@ -10,4 +10,4 @@ CONFIG_DEFAULT_kmod-ath10k-ct=y CONFIG_PACKAGE_kmod-ath10k-ct=y CONFIG_ATH10K-CT_LEDS=y CONFIG_PACKAGE_ath10k-firmware-qca4019-ct=y -CONFIG_KERNEL_ARM_MODULE_PLTS=y \ No newline at end of file +CONFIG_KERNEL_ARM_MODULE_PLTS=y diff --git a/root/rules.mk b/root/rules.mk index 9337a1f3..a33ba4bf 100644 --- a/root/rules.mk +++ b/root/rules.mk @@ -77,7 +77,7 @@ IS_PACKAGE_BUILD := $(if $(filter package/%,$(BUILD_SUBDIR)),1) OPTIMIZE_FOR_CPU=$(subst i386,i486,$(ARCH)) -ifeq ($(ARCH),powerpc) +ifneq (,$(findstring $(ARCH) , aarch64 aarch64_be powerpc )) FPIC:=-fPIC else FPIC:=-fpic