ipq807x: fix vlan offload support in v5.10 eBPF backport

Signed-off-by: John Crispin <john@phrozen.org>
This commit is contained in:
John Crispin
2021-10-29 19:50:10 +02:00
parent 63e8b90656
commit a3125e6ab2

View File

@@ -1,4 +1,4 @@
From 164756923b3e89cb2fc825a80d4cc4236fb6dc89 Mon Sep 17 00:00:00 2001
From 640973dcc794f43d99df7674209d9532711c49b4 Mon Sep 17 00:00:00 2001
From: John Crispin <john@phrozen.org>
Date: Sat, 18 Jul 2020 08:53:44 +0200
Subject: [PATCH 01/30] ipq807x: add the Qualcomm AX target support
@@ -63,9 +63,9 @@ Signed-off-by: John Crispin <john@phrozen.org>
.../ipq807x/patches/110-add-esmt-nand.patch | 37 +
target/linux/ipq807x/patches/111-eap106.patch | 765 +
target/linux/ipq807x/patches/112-pstore.patch | 147 +
.../ipq807x/patches/200-bpf_backport.patch | 44635 ++++++++++++++++
.../ipq807x/patches/200-bpf_backport.patch | 44763 ++++++++++++++++
toolchain/kernel-headers/Makefile | 8 +
60 files changed, 56539 insertions(+), 2 deletions(-)
60 files changed, 56667 insertions(+), 2 deletions(-)
create mode 100644 package/boot/uboot-envtools/files/ipq807x
create mode 100644 target/linux/ipq807x/109-logspam.patch
create mode 100644 target/linux/ipq807x/Makefile
@@ -16570,10 +16570,10 @@ index 0000000000..dc3960306d
+ * The following routines scan a subtree and registers a device for
diff --git a/target/linux/ipq807x/patches/200-bpf_backport.patch b/target/linux/ipq807x/patches/200-bpf_backport.patch
new file mode 100644
index 0000000000..3e730c313e
index 0000000000..915f965fa0
--- /dev/null
+++ b/target/linux/ipq807x/patches/200-bpf_backport.patch
@@ -0,0 +1,44635 @@
@@ -0,0 +1,44763 @@
+--- a/arch/arm/Kconfig
++++ b/arch/arm/Kconfig
+@@ -38,7 +38,7 @@ config ARM
@@ -61209,6 +61209,134 @@ index 0000000000..3e730c313e
+ if (IS_ERR(fp))
+ return PTR_ERR(fp);
+
+--- a/net/8021q/vlan_core.c
++++ b/net/8021q/vlan_core.c
+@@ -50,7 +50,7 @@ bool vlan_do_receive(struct sk_buff **sk
+ }
+
+ skb->priority = vlan_get_ingress_priority(vlan_dev, skb->vlan_tci);
+- skb->vlan_tci = 0;
++ __vlan_hwaccel_clear_tag(skb);
+
+ rx_stats = this_cpu_ptr(vlan_dev_priv(vlan_dev)->vlan_pcpu_stats);
+
+--- a/net/ipv4/ip_tunnel_core.c
++++ b/net/ipv4/ip_tunnel_core.c
+@@ -128,7 +128,7 @@ int iptunnel_pull_header(struct sk_buff
+ secpath_reset(skb);
+ skb_clear_hash_if_not_l4(skb);
+ skb_dst_drop(skb);
+- skb->vlan_tci = 0;
++ __vlan_hwaccel_clear_tag(skb);
+ skb_set_queue_mapping(skb, 0);
+ skb->pkt_type = PACKET_HOST;
+
+--- a/net/bridge/br_netfilter_hooks.c
++++ b/net/bridge/br_netfilter_hooks.c
+@@ -673,10 +673,8 @@ static int br_nf_push_frag_xmit(struct n
+ return 0;
+ }
+
+- if (data->vlan_tci) {
+- skb->vlan_tci = data->vlan_tci;
+- skb->vlan_proto = data->vlan_proto;
+- }
++ if (data->vlan_proto)
++ __vlan_hwaccel_put_tag(skb, data->vlan_proto, data->vlan_tci);
+
+ skb_copy_to_linear_data_offset(skb, -data->size, data->mac, data->size);
+ __skb_push(skb, data->encap_size);
+@@ -740,8 +738,13 @@ static int br_nf_dev_queue_xmit(struct n
+
+ data = this_cpu_ptr(&brnf_frag_data_storage);
+
+- data->vlan_tci = skb->vlan_tci;
+- data->vlan_proto = skb->vlan_proto;
++ if (skb_vlan_tag_present(skb)) {
++ data->vlan_tci = skb->vlan_tci;
++ data->vlan_proto = skb->vlan_proto;
++ } else {
++ data->vlan_proto = 0;
++ }
++
+ data->encap_size = nf_bridge_encap_header_len(skb);
+ data->size = ETH_HLEN + data->encap_size;
+
+--- a/net/bridge/br_private.h
++++ b/net/bridge/br_private.h
+@@ -751,7 +751,7 @@ static inline int br_vlan_get_tag(const
+ int err = 0;
+
+ if (skb_vlan_tag_present(skb)) {
+- *vid = skb_vlan_tag_get(skb) & VLAN_VID_MASK;
++ *vid = skb_vlan_tag_get_id(skb);
+ } else {
+ *vid = 0;
+ err = -EINVAL;
+--- a/net/bridge/br_vlan.c
++++ b/net/bridge/br_vlan.c
+@@ -354,7 +354,7 @@ struct sk_buff *br_handle_vlan(struct ne
+ }
+ }
+ if (v->flags & BRIDGE_VLAN_INFO_UNTAGGED)
+- skb->vlan_tci = 0;
++ __vlan_hwaccel_clear_tag(skb);
+
+ out:
+ return skb;
+@@ -420,8 +420,8 @@ static bool __allowed_ingress(struct net
+ __vlan_hwaccel_put_tag(skb, proto, pvid);
+ else
+ /* Priority-tagged Frame.
+- * At this point, We know that skb->vlan_tci had
+- * VLAN_TAG_PRESENT bit and its VID field was 0x000.
++ * At this point, we know that skb->vlan_tci VID
++ * field was 0.
+ * We update only VID field and preserve PCP field.
+ */
+ skb->vlan_tci |= pvid;
+--- a/net/core/dev.c
++++ b/net/core/dev.c
+@@ -3988,7 +3988,7 @@ ncls:
+ * and set skb->priority like in vlan_do_receive()
+ * For the time being, just ignore Priority Code Point
+ */
+- skb->vlan_tci = 0;
++ __vlan_hwaccel_clear_tag(skb);
+ }
+
+ type = skb->protocol;
+@@ -4211,7 +4211,9 @@ static void gro_list_prepare(struct napi
+ }
+
+ diffs = (unsigned long)p->dev ^ (unsigned long)skb->dev;
+- diffs |= p->vlan_tci ^ skb->vlan_tci;
++ diffs |= skb_vlan_tag_present(p) ^ skb_vlan_tag_present(skb);
++ if (skb_vlan_tag_present(p))
++ diffs |= p->vlan_tci ^ skb->vlan_tci;
+ diffs |= skb_metadata_dst_cmp(p, skb);
+ if (maclen == ETH_HLEN)
+ diffs |= compare_ether_header(skb_mac_header(p),
+@@ -4452,7 +4454,7 @@ static void napi_reuse_skb(struct napi_s
+ __skb_pull(skb, skb_headlen(skb));
+ /* restore the reserve we had after netdev_alloc_skb_ip_align() */
+ skb_reserve(skb, NET_SKB_PAD + NET_IP_ALIGN - skb_headroom(skb));
+- skb->vlan_tci = 0;
++ __vlan_hwaccel_clear_tag(skb);
+ skb->dev = napi->dev;
+ skb->skb_iif = 0;
+ skb->encapsulation = 0;
+--- a/net/core/skbuff.c
++++ b/net/core/skbuff.c
+@@ -4491,7 +4491,7 @@ int skb_vlan_pop(struct sk_buff *skb)
+ int err;
+
+ if (likely(skb_vlan_tag_present(skb))) {
+- skb->vlan_tci = 0;
++ __vlan_hwaccel_clear_tag(skb);
+ } else {
+ if (unlikely((skb->protocol != htons(ETH_P_8021Q) &&
+ skb->protocol != htons(ETH_P_8021AD)) ||
diff --git a/toolchain/kernel-headers/Makefile b/toolchain/kernel-headers/Makefile
index c33f26d46d..06236b5a47 100644
--- a/toolchain/kernel-headers/Makefile