]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
net: fec: add rx_shift to indicate the extra bytes padded in front of RX frame
authorWei Fang <wei.fang@nxp.com>
Thu, 5 Feb 2026 08:57:30 +0000 (16:57 +0800)
committerPaolo Abeni <pabeni@redhat.com>
Tue, 10 Feb 2026 09:58:19 +0000 (10:58 +0100)
commit385d19b56761b9a1c8eac8c94606854a01e9142f
tree2961aa6eb911da7b8b8de1c7bbe491c3fb7fb43d
parentff306e9a1963ffd5c8b800eb86213f88fac8dd3b
net: fec: add rx_shift to indicate the extra bytes padded in front of RX frame

The FEC of some platforms supports RX FIFO shift-16, it means the actual
frame data starts at bit 16 of the first word read from RX FIFO aligning
the Ethernet payload on a 32-bit boundary. The MAC writes two additional
bytes in front of each frame received into the RX FIFO. Currently, the
fec_enet_rx_queue() updates the data_start, sub_len and the rx_bytes
statistics by checking whether FEC_QUIRK_HAS_RACC is set. This makes the
code less concise, so rx_shift is added to represent the number of extra
bytes padded in front of the RX frame. Furthermore, when adding separate
RX handling functions for XDP copy mode and zero copy mode in the future,
it will no longer be necessary to check FEC_QUIRK_HAS_RACC to update the
corresponding variables.

Signed-off-by: Wei Fang <wei.fang@nxp.com>
Reviewed-by: Frank Li <Frank.Li@nxp.com>
Link: https://patch.msgid.link/20260205085742.2685134-4-wei.fang@nxp.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
drivers/net/ethernet/freescale/fec.h
drivers/net/ethernet/freescale/fec_main.c