From 988cd5165c2136b55b5ed5f1c843f9e94c5aeb2e Mon Sep 17 00:00:00 2001 From: awlx Date: Sun, 2 May 2021 15:26:20 +0200 Subject: [PATCH 1/7] Bump to Gluon v2020.2.3 --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index afe7ae01..ab4ceb34 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,6 @@ GLUON_BUILD_DIR := gluon-build GLUON_GIT_URL := https://github.com/freifunk-gluon/gluon.git -GLUON_GIT_REF := v2020.2.2 +GLUON_GIT_REF := v2020.2.3 PATCH_DIR := ${GLUON_BUILD_DIR}/site/patches SECRET_KEY_FILE ?= ${HOME}/.gluon-secret-key From ba8e3924b446b3b9b1686711459d64126ccc9a8a Mon Sep 17 00:00:00 2001 From: awlx Date: Sun, 2 May 2021 15:29:13 +0200 Subject: [PATCH 2/7] Maximize build space --- .github/workflows/firmware.yml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.github/workflows/firmware.yml b/.github/workflows/firmware.yml index 6926cd9c..c768935d 100644 --- a/.github/workflows/firmware.yml +++ b/.github/workflows/firmware.yml @@ -14,6 +14,15 @@ jobs: target: [ar71xx-generic, ar71xx-tiny, ar71xx-nand, ath79-generic, brcm2708-bcm2708, brcm2708-bcm2709, ipq40xx-generic, ipq806x-generic, lantiq-xrx200, lantiq-xway, mpc85xx-generic, mpc85xx-p1020, ramips-mt7620, ramips-mt7621, ramips-mt76x8, ramips-rt305x, sunxi-cortexa7, x86-generic, x86-geode, x86-legacy, x86-64, ar71xx-mikrotik, brcm2708-bcm2710, mvebu-cortexa9] runs-on: ubuntu-latest steps: + steps: + - name: Maximize build space + uses: easimon/maximize-build-space@master + with: + root-reserve-mb: 4096 + swap-size-mb: 1024 + remove-dotnet: 'true' + remove-android: 'true' + remove-haskell: 'true' - name: Checkout uses: actions/checkout@master - name: Extract branch name From 9842928dad82d584141b5bcdc6831d071923d2fe Mon Sep 17 00:00:00 2001 From: awlx Date: Sun, 2 May 2021 15:30:12 +0200 Subject: [PATCH 3/7] Maximize build space --- .github/workflows/firmware.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/firmware.yml b/.github/workflows/firmware.yml index c768935d..20cbde40 100644 --- a/.github/workflows/firmware.yml +++ b/.github/workflows/firmware.yml @@ -13,7 +13,6 @@ jobs: matrix: target: [ar71xx-generic, ar71xx-tiny, ar71xx-nand, ath79-generic, brcm2708-bcm2708, brcm2708-bcm2709, ipq40xx-generic, ipq806x-generic, lantiq-xrx200, lantiq-xway, mpc85xx-generic, mpc85xx-p1020, ramips-mt7620, ramips-mt7621, ramips-mt76x8, ramips-rt305x, sunxi-cortexa7, x86-generic, x86-geode, x86-legacy, x86-64, ar71xx-mikrotik, brcm2708-bcm2710, mvebu-cortexa9] runs-on: ubuntu-latest - steps: steps: - name: Maximize build space uses: easimon/maximize-build-space@master From e402e92af1e75711b5076efd2df5be3fcfddd5a0 Mon Sep 17 00:00:00 2001 From: Malte Wedel Date: Sun, 2 May 2021 23:53:28 +0200 Subject: [PATCH 4/7] Adapt patches for Gluon v2020.2.3 --- Makefile | 2 +- patches/batman-v-respondd-ptq1.patch | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index ab4ceb34..79f2dbe1 100644 --- a/Makefile +++ b/Makefile @@ -89,7 +89,7 @@ gluon-patch: fi (cd ${GLUON_BUILD_DIR}; git checkout -B patching) if [ -d "gluon-build/site/patches" -a "gluon-build/site/patches/*.patch" ]; then \ - (cd ${GLUON_BUILD_DIR}; git apply --ignore-space-change --ignore-whitespace --whitespace=nowarn site/patches/*.patch) || ( \ + (cd ${GLUON_BUILD_DIR}; git apply --ignore-space-change --ignore-whitespace --whitespace=nowarn --verbose site/patches/*.patch) || ( \ cd ${GLUON_BUILD_DIR}; \ git clean -fd; \ git checkout -B patched; \ diff --git a/patches/batman-v-respondd-ptq1.patch b/patches/batman-v-respondd-ptq1.patch index 748a54c5..578755b5 100644 --- a/patches/batman-v-respondd-ptq1.patch +++ b/patches/batman-v-respondd-ptq1.patch @@ -102,7 +102,7 @@ index e7a88fd1..549e5239 100644 /** * Merges two JSON objects -@@ -253,6 +253,14 @@ char * gluonutil_get_primary_domain(void) { +@@ -254,6 +254,14 @@ char * gluonutil_get_primary_domain(void) { return strdup(primary_domain_code); } @@ -121,8 +121,8 @@ diff --git a/package/libgluonutil/src/libgluonutil.h b/package/libgluonutil/src/ index 39b253ba..2ca171be 100644 --- a/package/libgluonutil/src/libgluonutil.h +++ b/package/libgluonutil/src/libgluonutil.h -@@ -44,4 +44,6 @@ bool gluonutil_has_domains(void); - char * gluonutil_get_domain(void); +@@ -45,4 +45,6 @@ bool gluonutil_has_domains(void); + char * gluonutil_get_primary_domain(void); struct json_object * gluonutil_load_site_config(void); +uint8_t gluonutil_get_pseudo_tq(uint32_t throughput); From 5b0e5180641cff9b9f8d9af434146f2426d61ed0 Mon Sep 17 00:00:00 2001 From: Malte Wedel Date: Mon, 3 May 2021 01:11:35 +0200 Subject: [PATCH 5/7] Fixed typo in libustream-openssl --- contrib/genpkglist.py | 2 +- site.mk | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/contrib/genpkglist.py b/contrib/genpkglist.py index e26d56d9..2f99d1d8 100644 --- a/contrib/genpkglist.py +++ b/contrib/genpkglist.py @@ -165,7 +165,7 @@ def render(self): PKGS_TLS = PackageList('TLS', [ 'ca-bundle', - 'libustream-opensl' + 'libustream-openssl' ]) pkglists.append(PKGS_TLS) diff --git a/site.mk b/site.mk index 06157ee0..534877e9 100644 --- a/site.mk +++ b/site.mk @@ -151,11 +151,11 @@ EXCLUDE_PCI_NET := \ INCLUDE_TLS := \ ca-bundle \ - libustream-opensl + libustream-openssl EXCLUDE_TLS := \ -ca-bundle \ - -libustream-opensl + -libustream-openssl ifeq ($(GLUON_TARGET),ar71xx-generic) GLUON_SITE_PACKAGES += $(INCLUDE_TLS) $(INCLUDE_USB) $(INCLUDE_USB_NET) $(INCLUDE_USB_SERIAL) $(INCLUDE_USB_STORAGE) From 5140bc10594d617c00784bd07082afb97db068bf Mon Sep 17 00:00:00 2001 From: goligo Date: Mon, 3 May 2021 02:42:05 +0200 Subject: [PATCH 6/7] Delete 0004-vxlan-fix-performance-issues.patch Removing the vxlan patch, as it is no longer working with the latest version and not worth the effort to follow up on it. --- .../0004-vxlan-fix-performance-issues.patch | 100 ------------------ 1 file changed, 100 deletions(-) delete mode 100644 patches/0004-vxlan-fix-performance-issues.patch diff --git a/patches/0004-vxlan-fix-performance-issues.patch b/patches/0004-vxlan-fix-performance-issues.patch deleted file mode 100644 index 58e5cb31..00000000 --- a/patches/0004-vxlan-fix-performance-issues.patch +++ /dev/null @@ -1,100 +0,0 @@ -From 486d735cb74f3c66ba08747de2b1cefc7e63b8d9 Mon Sep 17 00:00:00 2001 -From: CodeFetch -Date: Tue, 22 Dec 2020 04:44:39 +0100 -Subject: [PATCH 1/1] vxlan: fix performance issues - -This commit includes the patches for fixing issue #2155. ---- - ...ance-issues-with-VXLAN-encapsulation.patch | 80 +++++++++++++++++++ - 1 file changed, 80 insertions(+) - create mode 100644 patches/openwrt/9010-kernel-fix-performance-issues-with-VXLAN-encapsulation.patch - -diff --git a/patches/openwrt/9010-kernel-fix-performance-issues-with-VXLAN-encapsulation.patch b/patches/openwrt/9010-kernel-fix-performance-issues-with-VXLAN-encapsulation.patch -new file mode 100644 -index 00000000..14b4cc78 ---- /dev/null -+++ b/patches/openwrt/9010-kernel-fix-performance-issues-with-VXLAN-encapsulation.patch -@@ -0,0 +1,80 @@ -+From: CodeFetch -+Date: Tue, 22 Dec 2020 04:35:17 +0100 -+Subject: kernel: fix performance issues with VXLAN encapsulation -+ -+VXLAN did not consider the needed headroom of it's lower device which thus -+lead to costly expansions of the headroom. See: -+https://patchwork.ozlabs.org/project/netdev/list/?series=216897 -+ -+This commit includes the needed patches. -+ -+Signed-off-by: Vincent Wiemann -+ -+diff --git a/target/linux/generic/pending-4.14/690-vxlan-add_needed_headroom_for_lower_device.patch b/target/linux/generic/pending-4.14/690-vxlan-add_needed_headroom_for_lower_device.patch -+new file mode 100644 -+index 0000000000000000000000000000000000000000..1a380e62289094f0819a058ab07df0e60f0070cd -+--- /dev/null -++++ b/target/linux/generic/pending-4.14/690-vxlan-add_needed_headroom_for_lower_device.patch -+@@ -0,0 +1,35 @@ -++From: Sven Eckelmann -++Subject: [PATCH 1/2] vxlan: Add needed_headroom for lower device -++Date: Thu, 26 Nov 2020 13:52:46 +0100 -++ -++It was observed that sending data via batadv over vxlan (on top of -++wireguard) reduced the performance massively compared to raw ethernet or -++batadv on raw ethernet. A check of perf data showed that the -++vxlan_build_skb was calling all the time pskb_expand_head to allocate -++enough headroom for: -++ -++ min_headroom = LL_RESERVED_SPACE(dst->dev) + dst->header_len -++ + VXLAN_HLEN + iphdr_len; -++ -++But the vxlan_config_apply only requested needed headroom for: -++ -++ lowerdev->hard_header_len + VXLAN6_HEADROOM or VXLAN_HEADROOM -++ -++So it completely ignored the needed_headroom of the lower device. The first -++caller of net_dev_xmit could therefore never make sure that enough headroom -++was allocated for the rest of the transmit path. -++ -++Cc: Annika Wickert -++Signed-off-by: Sven Eckelmann -++Tested-by: Annika Wickert -++Signed-off-by: Vincent Wiemann -++--- a/drivers/net/vxlan.c -+++++ b/drivers/net/vxlan.c -++@@ -3184,6 +3184,7 @@ static void vxlan_config_apply(struct ne -++ dev->gso_max_segs = lowerdev->gso_max_segs; -++ -++ needed_headroom = lowerdev->hard_header_len; -+++ needed_headroom += lowerdev->needed_headroom; -++ -++ max_mtu = lowerdev->mtu - (use_ipv6 ? VXLAN6_HEADROOM : -++ VXLAN_HEADROOM); -+diff --git a/target/linux/generic/pending-4.14/691-vxlan-copy_needed_tailroom_from_lowerdev.patch b/target/linux/generic/pending-4.14/691-vxlan-copy_needed_tailroom_from_lowerdev.patch -+new file mode 100644 -+index 0000000000000000000000000000000000000000..a02aa2e1d84993b3fc994823978d8aee8dcc482e -+--- /dev/null -++++ b/target/linux/generic/pending-4.14/691-vxlan-copy_needed_tailroom_from_lowerdev.patch -+@@ -0,0 +1,21 @@ -++From: Sven Eckelmann -++Subject: [PATCH 2/2] vxlan: Copy needed_tailroom from lowerdev -++Date: Thu, 26 Nov 2020 13:52:47 +0100 -++ -++While vxlan doesn't need any extra tailroom, the lowerdev might need it. In -++that case, copy it over to reduce the chance for additional (re)allocations -++in the transmit path. -++ -++Signed-off-by: Sven Eckelmann -++Signed-off-by: Vincent Wiemann -++--- a/drivers/net/vxlan.c -+++++ b/drivers/net/vxlan.c -++@@ -3186,6 +3186,8 @@ static void vxlan_config_apply(struct ne -++ needed_headroom = lowerdev->hard_header_len; -++ needed_headroom += lowerdev->needed_headroom; -++ -+++ dev->needed_tailroom = lowerdev->needed_tailroom; -+++ -++ max_mtu = lowerdev->mtu - (use_ipv6 ? VXLAN6_HEADROOM : -++ VXLAN_HEADROOM); -++ if (max_mtu < ETH_MIN_MTU) --- -2.29.2 - From b9438ee582fdb0061225dfe26d5940764c01c3fa Mon Sep 17 00:00:00 2001 From: goligo Date: Mon, 3 May 2021 15:08:49 +0200 Subject: [PATCH 7/7] Delete 0005-batman-adv-improve-fragmentation-performance.patch Remove batman-adv performance patches, as they are already included/fixed in upstream --- ...dv-improve-fragmentation-performance.patch | 142 ------------------ 1 file changed, 142 deletions(-) delete mode 100644 patches/0005-batman-adv-improve-fragmentation-performance.patch diff --git a/patches/0005-batman-adv-improve-fragmentation-performance.patch b/patches/0005-batman-adv-improve-fragmentation-performance.patch deleted file mode 100644 index d758b1e0..00000000 --- a/patches/0005-batman-adv-improve-fragmentation-performance.patch +++ /dev/null @@ -1,142 +0,0 @@ -From ad9d77de22ca5bb27b8544c1c57fa8b6afa9fba8 Mon Sep 17 00:00:00 2001 -From: CodeFetch -Date: Tue, 22 Dec 2020 05:24:06 +0100 -Subject: [PATCH] batman-adv: improve fragmentation performance - -This commit fixes the fragmentation issues mentioned in issue #2155. ---- - ...dv-improve-fragmentation-performance.patch | 122 ++++++++++++++++++ - 1 file changed, 122 insertions(+) - create mode 100644 patches/packages/routing/0004-batman-adv-improve-fragmentation-performance.patch - -diff --git a/patches/packages/routing/0004-batman-adv-improve-fragmentation-performance.patch b/patches/packages/routing/0004-batman-adv-improve-fragmentation-performance.patch -new file mode 100644 -index 00000000..6556ad8a ---- /dev/null -+++ b/patches/packages/routing/0004-batman-adv-improve-fragmentation-performance.patch -@@ -0,0 +1,122 @@ -+From: CodeFetch -+Date: Tue, 22 Dec 2020 05:07:17 +0100 -+Subject: batman-adv: improve fragmentation performance -+ -+See freifunk-gluon issue #2155 for details. -+ -+Signed-off-by: Vincent Wiemann -+ -+diff --git a/batman-adv/patches/1100-batman-adv-consider-fragmentation-for-needed_headroom.patch b/batman-adv/patches/1100-batman-adv-consider-fragmentation-for-needed_headroom.patch -+new file mode 100644 -+index 0000000000000000000000000000000000000000..95fc85a3ea27cd5c16657e986bfaffddb9c326c4 -+--- /dev/null -++++ b/batman-adv/patches/1100-batman-adv-consider-fragmentation-for-needed_headroom.patch -+@@ -0,0 +1,12 @@ -++--- a/net/batman-adv/hard-interface.c -+++++ b/net/batman-adv/hard-interface.c -++@@ -553,6 +553,9 @@ static void batadv_hardif_recalc_extra_s -++ needed_headroom = lower_headroom + (lower_header_len - ETH_HLEN); -++ needed_headroom += batadv_max_header_len(); -++ -+++ /* fragmentation headers don't strip the unicast/... header */ -+++ needed_headroom += sizeof(struct batadv_frag_packet); -+++ -++ soft_iface->needed_headroom = needed_headroom; -++ soft_iface->needed_tailroom = lower_tailroom; -++ } -+diff --git a/batman-adv/patches/1101-batman-adv-reserve-needed-room-for-fragments.patch b/batman-adv/patches/1101-batman-adv-reserve-needed-room-for-fragments.patch -+new file mode 100644 -+index 0000000000000000000000000000000000000000..59e02149b49210dae0700d943a0310b3dce054f8 -+--- /dev/null -++++ b/batman-adv/patches/1101-batman-adv-reserve-needed-room-for-fragments.patch -+@@ -0,0 +1,62 @@ -++--- a/net/batman-adv/fragmentation.c -+++++ b/net/batman-adv/fragmentation.c -++@@ -391,6 +391,7 @@ out: -++ -++ /** -++ * batadv_frag_create() - create a fragment from skb -+++ * @net_dev: outgoing device for fragment -++ * @skb: skb to create fragment from -++ * @frag_head: header to use in new fragment -++ * @fragment_size: size of new fragment -++@@ -401,22 +402,25 @@ out: -++ * -++ * Return: the new fragment, NULL on error. -++ */ -++-static struct sk_buff *batadv_frag_create(struct sk_buff *skb, -+++static struct sk_buff *batadv_frag_create(struct net_device *net_dev, -+++ struct sk_buff *skb, -++ struct batadv_frag_packet *frag_head, -++ unsigned int fragment_size) -++ { -+++ unsigned int ll_reserved = LL_RESERVED_SPACE(net_dev); -+++ unsigned int tailroom = net_dev->needed_tailroom; -++ struct sk_buff *skb_fragment; -++ unsigned int header_size = sizeof(*frag_head); -++ unsigned int mtu = fragment_size + header_size; -++ -++- skb_fragment = netdev_alloc_skb(NULL, mtu + ETH_HLEN); -+++ skb_fragment = dev_alloc_skb(ll_reserved + mtu + tailroom); -++ if (!skb_fragment) -++ goto err; -++ -++ skb_fragment->priority = skb->priority; -++ -++ /* Eat the last mtu-bytes of the skb */ -++- skb_reserve(skb_fragment, header_size + ETH_HLEN); -+++ skb_reserve(skb_fragment, ll_reserved + header_size); -++ skb_split(skb, skb_fragment, skb->len - fragment_size); -++ -++ /* Add the header */ -++@@ -439,11 +443,12 @@ int batadv_frag_send_packet(struct sk_bu -++ struct batadv_orig_node *orig_node, -++ struct batadv_neigh_node *neigh_node) -++ { -+++ struct net_device *net_dev = neigh_node->if_incoming->net_dev; -++ struct batadv_priv *bat_priv; -++ struct batadv_hard_iface *primary_if = NULL; -++ struct batadv_frag_packet frag_header; -++ struct sk_buff *skb_fragment; -++- unsigned int mtu = neigh_node->if_incoming->net_dev->mtu; -+++ unsigned int mtu = net_dev->mtu; -++ unsigned int header_size = sizeof(frag_header); -++ unsigned int max_fragment_size, num_fragments; -++ int ret; -++@@ -503,7 +508,7 @@ int batadv_frag_send_packet(struct sk_bu -++ goto put_primary_if; -++ } -++ -++- skb_fragment = batadv_frag_create(skb, &frag_header, -+++ skb_fragment = batadv_frag_create(net_dev, skb, &frag_header, -++ max_fragment_size); -++ if (!skb_fragment) { -++ ret = -ENOMEM; -+diff --git a/batman-adv/patches/1102-batman-adv-dont-always-reallocate-the-fragmentation-skb-head.patch b/batman-adv/patches/1102-batman-adv-dont-always-reallocate-the-fragmentation-skb-head.patch -+new file mode 100644 -+index 0000000000000000000000000000000000000000..4ba8b2f755925c37a1365e59842612dbe0febbfb -+--- /dev/null -++++ b/batman-adv/patches/1102-batman-adv-dont-always-reallocate-the-fragmentation-skb-head.patch -+@@ -0,0 +1,22 @@ -++--- a/net/batman-adv/fragmentation.c -+++++ b/net/batman-adv/fragmentation.c -++@@ -527,13 +527,14 @@ int batadv_frag_send_packet(struct sk_bu -++ frag_header.no++; -++ } -++ -++- /* Make room for the fragment header. */ -++- if (batadv_skb_head_push(skb, header_size) < 0 || -++- pskb_expand_head(skb, header_size + ETH_HLEN, 0, GFP_ATOMIC) < 0) { -++- ret = -ENOMEM; -+++ /* make sure that there is at least enough head for the fragmentation -+++ * and ethernet headers -+++ */ -+++ ret = skb_cow_head(skb, ETH_HLEN + header_size); -+++ if (ret < 0) -++ goto put_primary_if; -++- } -++ -+++ skb_push(skb, header_size); -++ memcpy(skb->data, &frag_header, header_size); -++ -++ /* Send the last fragment */ --- -2.29.2 -