Netdev List
 help / color / mirror / Atom feed
* [PATCH net-next v3 08/14] net: ethernet: oa_tc6: Remove FCS size in RX frame
@ 2026-05-29 18:41 Selvamani Rajagopal
  2026-05-31 14:50 ` Andrew Lunn
  0 siblings, 1 reply; 4+ messages in thread
From: Selvamani Rajagopal @ 2026-05-29 18:41 UTC (permalink / raw)
  To: Piergiorgio Beruto, parthiban.veerasooran@microchip.com,
	andrew+netdev@lunn.ch, davem@davemloft.net, edumazet@google.com,
	kuba@kernel.org, pabeni@redhat.com, netdev@vger.kernel.org,
	linux-kernel@vger.kernel.org

When MAC-PHY appends FCS to the incoming frame, FCS,
it is removed from the frame before passing it to the stack.

Signed-off-by: Selvamani Rajagopal <Selvamani.Rajagopal@onsemi.com>
---
 drivers/net/ethernet/oa_tc6/oa_tc6.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/net/ethernet/oa_tc6/oa_tc6.c b/drivers/net/ethernet/oa_tc6/oa_tc6.c
index d2b05f98765b..de5f1548139f 100644
--- a/drivers/net/ethernet/oa_tc6/oa_tc6.c
+++ b/drivers/net/ethernet/oa_tc6/oa_tc6.c
@@ -786,6 +786,9 @@ static void oa_tc6_submit_rx_skb(struct oa_tc6 *tc6)
 	tc6->netdev->stats.rx_packets++;
 	tc6->netdev->stats.rx_bytes += tc6->rx_skb->len;
 
+	if ((tc6->netdev->hw_features & NETIF_F_RXFCS) != 0)
+		skb_trim(tc6->rx_skb, tc6->rx_skb->len - ETH_FCS_LEN);
+
 	netif_rx(tc6->rx_skb);
 
 	tc6->rx_skb = NULL;
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH net-next v3 08/14] net: ethernet: oa_tc6: Remove FCS size in RX frame
  2026-05-29 18:41 [PATCH net-next v3 08/14] net: ethernet: oa_tc6: Remove FCS size in RX frame Selvamani Rajagopal
@ 2026-05-31 14:50 ` Andrew Lunn
  2026-06-02  2:40   ` Selvamani Rajagopal
  0 siblings, 1 reply; 4+ messages in thread
From: Andrew Lunn @ 2026-05-31 14:50 UTC (permalink / raw)
  To: Selvamani Rajagopal
  Cc: Piergiorgio Beruto, parthiban.veerasooran@microchip.com,
	andrew+netdev@lunn.ch, davem@davemloft.net, edumazet@google.com,
	kuba@kernel.org, pabeni@redhat.com, netdev@vger.kernel.org,
	linux-kernel@vger.kernel.org

On Fri, May 29, 2026 at 06:41:00PM +0000, Selvamani Rajagopal wrote:
> When MAC-PHY appends FCS to the incoming frame, FCS,
> it is removed from the frame before passing it to the stack.

What is missing from this commit message is an answer to the question
"Why?". Does the stack do something wrong if there is a FCS at the end
of the frame?

   Andrew

^ permalink raw reply	[flat|nested] 4+ messages in thread

* RE: [PATCH net-next v3 08/14] net: ethernet: oa_tc6: Remove FCS size in RX frame
  2026-05-31 14:50 ` Andrew Lunn
@ 2026-06-02  2:40   ` Selvamani Rajagopal
  2026-06-02  3:01     ` Qingfang Deng
  0 siblings, 1 reply; 4+ messages in thread
From: Selvamani Rajagopal @ 2026-06-02  2:40 UTC (permalink / raw)
  To: Andrew Lunn
  Cc: Piergiorgio Beruto, parthiban.veerasooran@microchip.com,
	andrew+netdev@lunn.ch, davem@davemloft.net, edumazet@google.com,
	kuba@kernel.org, pabeni@redhat.com, netdev@vger.kernel.org,
	linux-kernel@vger.kernel.org

> 
> On Fri, May 29, 2026 at 06:41:00PM +0000, Selvamani Rajagopal wrote:
> > When MAC-PHY appends FCS to the incoming frame, FCS,
> > it is removed from the frame before passing it to the stack.
> 
> What is missing from this commit message is an answer to the question
> "Why?". Does the stack do something wrong if there is a FCS at the end
> of the frame?

That was a little mystery to me as well when our SQA alerted me with the issue.
When I tested, ping worked fine without any issue even with the frames with FCS appended. 
But strangely ptp4l utility failed with invalid data size. Once we removed FCS, it worked fine.

Will add this reason in the commit message.

> 
> Andrew


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH net-next v3 08/14] net: ethernet: oa_tc6: Remove FCS size in RX frame
  2026-06-02  2:40   ` Selvamani Rajagopal
@ 2026-06-02  3:01     ` Qingfang Deng
  0 siblings, 0 replies; 4+ messages in thread
From: Qingfang Deng @ 2026-06-02  3:01 UTC (permalink / raw)
  To: Selvamani Rajagopal
  Cc: Andrew Lunn, Piergiorgio Beruto,
	parthiban.veerasooran@microchip.com, David S. Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, Jacob Keller,
	Richard Cochran, netdev, linux-kernel

On Tue, 2 Jun 2026 at 02:40:13, Selvamani Rajagopal wrote:
> But strangely ptp4l utility failed with invalid data size. Once we removed FCS, it worked fine.

This is because ptp4l misinterprets the FCS as a TLV. There are already
several discussions and patches about this issue, however the maintainer
insists that the ethernet driver needs to be fixed instead:

https://sourceforge.net/p/linuxptp/mailman/message/37858618/
https://sourceforge.net/p/linuxptp/mailman/linuxptp-devel/thread/20190205170652.476c9676%40redhat.com/#msg36579297
https://sourceforge.net/p/linuxptp/mailman/linuxptp-devel/thread/CA%2BDf%2BjcRN98GpUi%3DF_4Ls7miEPbUZYb8O-gpSw0TQoqczVqMfw%40mail.gmail.com/#msg37858491
https://sourceforge.net/p/linuxptp/mailman/linuxptp-devel/thread/8ed1dc74-bf4c-2f13-4ed0-a70d0c4512f6%40cisco.com/#msg37137818

Regards,
Qingfang

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2026-06-02  3:01 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-29 18:41 [PATCH net-next v3 08/14] net: ethernet: oa_tc6: Remove FCS size in RX frame Selvamani Rajagopal
2026-05-31 14:50 ` Andrew Lunn
2026-06-02  2:40   ` Selvamani Rajagopal
2026-06-02  3:01     ` Qingfang Deng

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox