]> git.ipfire.org Git - thirdparty/openwrt.git/commit
realtek: eth: cleanup packet length calculation
authorMarkus Stockhausen <markus.stockhausen@gmx.de>
Thu, 12 Feb 2026 13:53:11 +0000 (14:53 +0100)
committerRobert Marko <robimarko@gmail.com>
Thu, 19 Feb 2026 09:47:55 +0000 (10:47 +0100)
commit47d0773d7deb0f9d9670bdf0d9e13bd863cbdc4c
treea59959f49be357dc4739942c164121273342e457
parenta36ab12454e401bdc581e9f96458fa860ddfce73
realtek: eth: cleanup packet length calculation

During transmit the driver must adapt the packet length. The
hardware requires at least a memory space of ETH_ZLEN bytes
data plus four bytes for layer 2 FCS. This was calculated
(somehow) but skb->len never got updated and for the minimum
length a RTL838x specific workaround was in place. Clean up
the code and use skb_put_padto() so the length change gets
reflected in skb->len.

While we are here drop zeroing DSA tag because it will be
overwritten by hardware for FCS.

Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
Link: https://github.com/openwrt/openwrt/pull/21999
Signed-off-by: Robert Marko <robimarko@gmail.com>
target/linux/realtek/files-6.12/drivers/net/ethernet/rtl838x_eth.c