Re: [PATCH net v5] rtase: Workaround for TX hang caused by hardware packet parsing

From: Simon Horman

Date: Thu Jul 16 2026 - 05:23:07 EST


On Thu, Jul 09, 2026 at 06:34:56PM +0800, Justin Lai wrote:
> The hardware performs packet parsing before packet transmission.
> Parsing incomplete IPv4, IPv6, TCP, or UDP headers may trigger a TX
> hang because the hardware parser expects additional protocol header
> data that is not present in the packet.
>
> The hardware performs additional PTP parsing on UDP packets identified
> by destination ports 319/320 at the expected UDP destination port
> offset.
>
> If such a packet has transport data smaller than RTASE_MIN_PAD_LEN,
> the hardware parser expects additional packet data and may trigger a
> TX hang.
>
> To avoid these hardware issues, the driver applies the following
> workarounds.
>
> Drop malformed packets that may trigger this hardware issue before
> transmission.
>
> For IPv4 non-initial fragments, the hardware does not check the
> fragment offset before parsing the expected transport header location.
> As a result, these packets are still subject to transport header
> parsing even though they do not contain a transport header. If the
> transport data is shorter than the minimum transport header required
> by the hardware parser, pad the transport data to the minimum
> transport header length required by the hardware parser. Packets that
> also match the hardware PTP parsing conditions continue to follow the
> corresponding workaround.
>
> For IPv6 fragmented packets, neither of the above hardware issues
> occurs because the hardware only continues packet parsing when the
> IPv6 Base Header Next Header field directly indicates UDP. Packets
> carrying a Fragment Header do not continue through the subsequent
> packet parsing stages.
>
> For packets identified for hardware PTP parsing, pad the transport
> data so it reaches RTASE_MIN_PAD_LEN before transmission.
>
> Fixes: d6e882b89fdf ("rtase: Implement .ndo_start_xmit function")
> Cc: stable@xxxxxxxxxxxxxxx
> Signed-off-by: Justin Lai <justinlai0215@xxxxxxxxxxx>

Reviewed-by: Simon Horman <horms@xxxxxxxxxx>

FTR, the AI-generated reviews of this patch on both sashiko.dev and
https://netdev-ai.bots.linux.dev/sashiko/ flag issues. However, I do
not believe they should impede progress of this patch.