diff options
author | Daniel Golle <daniel@makrotopia.org> | 2022-09-25 16:56:45 +0100 |
---|---|---|
committer | Daniel Golle <daniel@makrotopia.org> | 2022-09-27 17:07:20 +0100 |
commit | e8b00cfdcb78ebd20e097eb21862376a4b4f8313 (patch) | |
tree | 4f05420cf1d70c674c9003ddbc992ebbb5a529b2 /target/linux/generic/backport-5.15/725-v6.0-net-ethernet-mtk_eth_soc-fix-usage-of-foe_entry_size.patch | |
parent | 3e2ea10e5e53540fa62bae549e9526999b95f74b (diff) | |
download | upstream-e8b00cfdcb78ebd20e097eb21862376a4b4f8313.tar.gz upstream-e8b00cfdcb78ebd20e097eb21862376a4b4f8313.tar.bz2 upstream-e8b00cfdcb78ebd20e097eb21862376a4b4f8313.zip |
kernel: rename upstreamed patches and import fixes
Move and rename patches which were merged upstream and import follow-up
fixes for MediaTek Ethernet offloading features on MT7622 and Filogic
platforms. Remove patch
793-net-ethernet-mtk_eth_soc-fix-typo-in-__mtk_foe_entry.patch
which breaks hardware flow offloading on MT7622, it will be reverted
upstream as well.
Fixes: c93c5365c0 ("kernel: pick patches for MediaTek Ethernet from linux-next")
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
Diffstat (limited to 'target/linux/generic/backport-5.15/725-v6.0-net-ethernet-mtk_eth_soc-fix-usage-of-foe_entry_size.patch')
-rw-r--r-- | target/linux/generic/backport-5.15/725-v6.0-net-ethernet-mtk_eth_soc-fix-usage-of-foe_entry_size.patch | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/target/linux/generic/backport-5.15/725-v6.0-net-ethernet-mtk_eth_soc-fix-usage-of-foe_entry_size.patch b/target/linux/generic/backport-5.15/725-v6.0-net-ethernet-mtk_eth_soc-fix-usage-of-foe_entry_size.patch new file mode 100644 index 0000000000..bb02f401a2 --- /dev/null +++ b/target/linux/generic/backport-5.15/725-v6.0-net-ethernet-mtk_eth_soc-fix-usage-of-foe_entry_size.patch @@ -0,0 +1,49 @@ +From fcf14c2c5deae8f8c3d25530bab10856f63f8a63 Mon Sep 17 00:00:00 2001 +From: Daniel Golle <daniel@makrotopia.org> +Date: Sun, 25 Sep 2022 15:18:54 +0100 +Subject: [PATCH 2/2] net: ethernet: mtk_eth_soc: fix usage of foe_entry_size +To: linux-mediatek@lists.infradead.org, + netdev@vger.kernel.org, + Lorenzo Bianconi <lorenzo@kernel.org> +Cc: Sujuan Chen <sujuan.chen@mediatek.com>, + Bo Jiao <Bo.Jiao@mediatek.com>, + Felix Fietkau <nbd@nbd.name>, + John Crispin <john@phrozen.org>, + Sean Wang <sean.wang@mediatek.com>, + Mark Lee <Mark-MC.Lee@mediatek.com>, + David S. Miller <davem@davemloft.net>, + Eric Dumazet <edumazet@google.com>, + Jakub Kicinski <kuba@kernel.org>, + Paolo Abeni <pabeni@redhat.com>, + Matthias Brugger <matthias.bgg@gmail.com>, + Chen Minqiang <ptpt52@gmail.com> + +As sizeof(hwe->data) can now longer be used as the actual size depends +on foe_entry_size, in commit 9d8cb4c096ab02 +("net: ethernet: mtk_eth_soc: add foe_entry_size to mtk_eth_soc") the +use of sizeof(hwe->data) is hence replaced. +However, replacing it with ppe->eth->soc->foe_entry_size is wrong as +foe_entry_size represents the size of the whole descriptor and not just +the 'data' field. +Fix this by subtracing the size of the only other field in the struct +'ib1', so we actually end up with the correct size to be copied to the +data field. + +Reported-by: Chen Minqiang <ptpt52@gmail.com> +Fixes: 9d8cb4c096ab02 ("net: ethernet: mtk_eth_soc: add foe_entry_size to mtk_eth_soc") +Signed-off-by: Daniel Golle <daniel@makrotopia.org> +--- + drivers/net/ethernet/mediatek/mtk_ppe.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/net/ethernet/mediatek/mtk_ppe.c ++++ b/drivers/net/ethernet/mediatek/mtk_ppe.c +@@ -547,7 +547,7 @@ __mtk_foe_entry_commit(struct mtk_ppe *p + } + + hwe = mtk_foe_get_entry(ppe, hash); +- memcpy(&hwe->data, &entry->data, eth->soc->foe_entry_size); ++ memcpy(&hwe->data, &entry->data, eth->soc->foe_entry_size - sizeof(hwe->ib1)); + wmb(); + hwe->ib1 = entry->ib1; + |