The flags to enable the outgoing port mask is in bits 43, with bit 0
being the leftmost bit of the header. This corresponds to BIT(4) in the
third 16-bit value of the header.

Correctly set AS_DPM by fixing the off-by-one error.

Fixes: 9eab76c84e31 ("realtek: Improve TX CPU-Tag usage")
Signed-off-by: Sander Vanheule <san...@svanheule.net>
---
 .../realtek/files-5.10/drivers/net/ethernet/rtl838x_eth.c     | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/target/linux/realtek/files-5.10/drivers/net/ethernet/rtl838x_eth.c 
b/target/linux/realtek/files-5.10/drivers/net/ethernet/rtl838x_eth.c
index 170fc9247bdf..5fa156935798 100644
--- a/target/linux/realtek/files-5.10/drivers/net/ethernet/rtl838x_eth.c
+++ b/target/linux/realtek/files-5.10/drivers/net/ethernet/rtl838x_eth.c
@@ -110,7 +110,8 @@ static void rtl839x_create_tx_header(struct p_hdr *h, 
unsigned int dest_port, in
 {
        // cpu_tag[0] is reserved on the RTL83XX SoCs
        h->cpu_tag[1] = 0x0100; // RTL8390_CPU_TAG marker
-       h->cpu_tag[2] = h->cpu_tag[3] = h->cpu_tag[4] = h->cpu_tag[5] = 0;
+       h->cpu_tag[2] = BIT(4); /* AS_DPM flag */
+       h->cpu_tag[3] = h->cpu_tag[4] = h->cpu_tag[5] = 0;
        // h->cpu_tag[1] |= BIT(1) | BIT(0); // Bypass filter 1/2
        if (dest_port >= 32) {
                dest_port -= 32;
@@ -120,7 +121,6 @@ static void rtl839x_create_tx_header(struct p_hdr *h, 
unsigned int dest_port, in
                h->cpu_tag[4] = BIT(dest_port) >> 16;
                h->cpu_tag[5] = BIT(dest_port) & 0xffff;
        }
-       h->cpu_tag[2] |= BIT(5); // Enable destination port mask use
        h->cpu_tag[2] |= BIT(8); // Enable L2 Learning
 
        /* Set internal priority (PRI) and enable (AS_PRI) */
-- 
2.36.1


_______________________________________________
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel

Reply via email to