mirror of
https://github.com/torvalds/linux.git
synced 2026-07-27 17:47:41 +02:00
net: ethernet: oa_tc6: Remove FCS size in RX frame
OA TC6 MAC-PHY appends FCS to the incoming frame. It must be
removed from the frame before being passed to the stack.
With FCS in the frame, many applications, like ping or any
application that uses IP layer may work as they may
carry the packet size information in the protocol.
Application like ptp4l, particularly if it uses layer 2
for its communication, it will fail with "bad message" due to
the extra 4 bytes added by the presence of FCS.
Fixes: d70a0d8f2f ("net: ethernet: oa_tc6: implement receive path to receive rx ethernet frames")
Signed-off-by: Selvamani Rajagopal <Selvamani.Rajagopal@onsemi.com>
Link: https://patch.msgid.link/20260611-level-trigger-v5-3-4533a9e85ce2@onsemi.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
parent
a221d3f7e3
commit
a5a1d11dd3
|
|
@ -785,6 +785,17 @@ static int oa_tc6_process_rx_chunk_footer(struct oa_tc6 *tc6, u32 footer)
|
|||
|
||||
static void oa_tc6_submit_rx_skb(struct oa_tc6 *tc6)
|
||||
{
|
||||
/* MAC-PHY delivers each frame with its Ethernet FCS attached.
|
||||
* Strip it before handing over to the stack, unless the user
|
||||
* has asked to keep it via NETIF_F_RXFCS. Keeping the FCS
|
||||
* in the frame is harmless for IP traffic, but is parsed as
|
||||
* a (malformed) suffix TLV by PTP, which makes ptp4l reject
|
||||
* every message with "bad message" error.
|
||||
*/
|
||||
if (!(tc6->netdev->features & NETIF_F_RXFCS) &&
|
||||
tc6->rx_skb->len > ETH_FCS_LEN)
|
||||
skb_trim(tc6->rx_skb, tc6->rx_skb->len - ETH_FCS_LEN);
|
||||
|
||||
tc6->rx_skb->protocol = eth_type_trans(tc6->rx_skb, tc6->netdev);
|
||||
tc6->netdev->stats.rx_packets++;
|
||||
tc6->netdev->stats.rx_bytes += tc6->rx_skb->len;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user