[openwrt/openwrt] realtek: fix egress port mask on rtl839x

LEDE Commits lede-commits at lists.infradead.org
Thu Jul 21 12:30:22 PDT 2022


svanheule pushed a commit to openwrt/openwrt.git, branch openwrt-22.03:
https://git.openwrt.org/8614b8eb5f465742343a2b16ebc1a980b20e33d0

commit 8614b8eb5f465742343a2b16ebc1a980b20e33d0
Author: Sander Vanheule <sander at svanheule.net>
AuthorDate: Tue Jun 28 21:14:03 2022 +0200

    realtek: fix egress port mask on rtl839x
    
    The flag to enable the outgoing port mask is in CPU header bit 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")
    Tested-by: Luiz Angelo Daros de Luca <luizluca at gmail.com>
    Signed-off-by: Sander Vanheule <sander at svanheule.net>
    (cherry picked from commit d9516cacb087fed7716b34b1e02ce956bb6c27f1)
---
 target/linux/realtek/files-5.10/drivers/net/ethernet/rtl838x_eth.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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 cf6aabc614..aece1356e4 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
@@ -126,7 +126,7 @@ static void rtl839x_create_tx_header(struct p_hdr *h, int dest_port, int prio)
 			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(4); // Enable destination port mask use
 		h->cpu_tag[2] |= BIT(8); // Enable L2 Learning
 		// Set internal priority and AS_PRIO
 		if (prio >= 0)




More information about the lede-commits mailing list