diff mbox series

[v2,3/4] realtek: fix port mask on rtl839x

Message ID a335ec5670bc5a8e221459ac1be604a82bd1f89e.1655639125.git.sander@svanheule.net
State Accepted
Delegated to: Sander Vanheule
Headers show
Series realtek: egress frame header fixes | expand

Commit Message

Sander Vanheule June 19, 2022, 11:46 a.m. UTC
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 <sander@svanheule.net>
---
 .../realtek/files-5.10/drivers/net/ethernet/rtl838x_eth.c     | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff mbox series

Patch

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) */