1
0
mirror of https://git.openwrt.org/openwrt/openwrt.git synced 2024-10-18 13:29:16 +02:00

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@gmail.com>
Signed-off-by: Sander Vanheule <sander@svanheule.net>
This commit is contained in:
Sander Vanheule 2022-06-28 21:14:03 +02:00
parent ef3d0a3029
commit d9516cacb0

@ -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[4] = BIT(dest_port) >> 16;
h->cpu_tag[5] = BIT(dest_port) & 0xffff; 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 h->cpu_tag[2] |= BIT(8); // Enable L2 Learning
// Set internal priority and AS_PRIO // Set internal priority and AS_PRIO
if (prio >= 0) if (prio >= 0)