diff options
author | Birger Koblitz <git@birger-koblitz.de> | 2022-01-01 14:12:21 +0100 |
---|---|---|
committer | Daniel Golle <daniel@makrotopia.org> | 2022-02-17 15:21:47 +0000 |
commit | 9d847244d9fd22f2c0d44891d06edc0a0f0f3238 (patch) | |
tree | 548bb738dd719b6afc9339f7f61094f7977955f3 /target/linux | |
parent | 6b79484268879d0a68530147964a793fafac6716 (diff) | |
download | upstream-9d847244d9fd22f2c0d44891d06edc0a0f0f3238.tar.gz upstream-9d847244d9fd22f2c0d44891d06edc0a0f0f3238.tar.bz2 upstream-9d847244d9fd22f2c0d44891d06edc0a0f0f3238.zip |
realtek: fix RTL839X receive tag decoding
Correct offset in RX tag structure. Correct offload decision flagging.
Signed-off-by: Birger Koblitz <git@birger-koblitz.de>
Diffstat (limited to 'target/linux')
-rw-r--r-- | target/linux/realtek/files-5.10/drivers/net/ethernet/rtl838x_eth.c | 9 |
1 files changed, 5 insertions, 4 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 3d84551940..9e5dfe9640 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 @@ -280,16 +280,17 @@ bool rtl838x_decode_tag(struct p_hdr *h, struct dsa_tag *t) bool rtl839x_decode_tag(struct p_hdr *h, struct dsa_tag *t) { - t->reason = h->cpu_tag[4] & 0x1f; + t->reason = h->cpu_tag[5] & 0x1f; t->queue = (h->cpu_tag[3] & 0xe000) >> 13; t->port = h->cpu_tag[1] & 0x3f; t->crc_error = h->cpu_tag[3] & BIT(2); pr_debug("Reason: %d\n", t->reason); - if ((t->reason != 7) && (t->reason != 8)) // NIC_RX_REASON_RMA_USR - t->l2_offloaded = 1; - else + if ((t->reason >= 7 && t->reason <= 13) || // NIC_RX_REASON_RMA + (t->reason >= 23 && t->reason <= 25)) // NIC_RX_REASON_SPECIAL_TRAP t->l2_offloaded = 0; + else + t->l2_offloaded = 1; return t->l2_offloaded; } |