From: Felix Fietkau Date: Thu, 23 Mar 2023 09:08:51 +0000 (+0100) Subject: kernel: update flow offload fix based on upstream suggestions X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=07b550890c5ecbc003ab0419b321dbdd65bdd4bd;p=openwrt%2Fstaging%2Fblocktrron.git kernel: update flow offload fix based on upstream suggestions Signed-off-by: Felix Fietkau --- diff --git a/target/linux/generic/pending-5.15/735-net-ethernet-mtk_eth_soc-fix-flow_offload-related-re.patch b/target/linux/generic/pending-5.15/735-net-ethernet-mtk_eth_soc-fix-flow_offload-related-re.patch index acbdec2159..b7304906c0 100644 --- a/target/linux/generic/pending-5.15/735-net-ethernet-mtk_eth_soc-fix-flow_offload-related-re.patch +++ b/target/linux/generic/pending-5.15/735-net-ethernet-mtk_eth_soc-fix-flow_offload-related-re.patch @@ -14,43 +14,15 @@ Signed-off-by: Felix Fietkau --- a/drivers/net/ethernet/mediatek/mtk_ppe_offload.c +++ b/drivers/net/ethernet/mediatek/mtk_ppe_offload.c -@@ -561,6 +561,7 @@ mtk_eth_setup_tc_block(struct net_device - struct mtk_eth *eth = mac->hw; - static LIST_HEAD(block_cb_list); - struct flow_block_cb *block_cb; -+ bool register_block = false; - flow_setup_cb_t *cb; +@@ -583,6 +583,7 @@ mtk_eth_setup_tc_block(struct net_device + if (IS_ERR(block_cb)) + return PTR_ERR(block_cb); - if (!eth->soc->offload_version) -@@ -575,23 +576,27 @@ mtk_eth_setup_tc_block(struct net_device - switch (f->command) { - case FLOW_BLOCK_BIND: - block_cb = flow_block_cb_lookup(f->block, cb, dev); -- if (block_cb) { -- flow_block_cb_incref(block_cb); -- return 0; -+ if (!block_cb) { -+ block_cb = flow_block_cb_alloc(cb, dev, dev, NULL); -+ if (IS_ERR(block_cb)) -+ return PTR_ERR(block_cb); -+ -+ register_block = true; - } -- block_cb = flow_block_cb_alloc(cb, dev, dev, NULL); -- if (IS_ERR(block_cb)) -- return PTR_ERR(block_cb); - -- flow_block_cb_add(block_cb, f); -- list_add_tail(&block_cb->driver_list, &block_cb_list); + flow_block_cb_incref(block_cb); -+ -+ if (register_block) { -+ flow_block_cb_add(block_cb, f); -+ list_add_tail(&block_cb->driver_list, &block_cb_list); -+ } + flow_block_cb_add(block_cb, f); + list_add_tail(&block_cb->driver_list, &block_cb_list); return 0; - case FLOW_BLOCK_UNBIND: - block_cb = flow_block_cb_lookup(f->block, cb, dev); +@@ -591,7 +592,7 @@ mtk_eth_setup_tc_block(struct net_device if (!block_cb) return -ENOENT;