Re: [PATCH net-next v4 0/4] net: selftest: improve test string formatting and checksum handling

From: Jakub Kicinski
Date: Wed Jun 25 2025 - 16:21:33 EST


On Wed, 25 Jun 2025 07:07:42 +0200 Oleksij Rempel wrote:
> Hm... at least part of this behavior can be verified with self-tests:
>
> - Send a TCP packet with an intentionally incorrect checksum,
> ensuring its state is CHECKSUM_NONE so the transmit path doesn't change it.
> - Test if we receive this packet back via the PHY loopback.
> - If received: The test checks the ip_summed status of the
> received packet.
> - A status of CHECKSUM_NONE indicates the hardware correctly passed
> the packet up without validating it.

_NONE or _COMPLETE are both fine in this case.

> - A status of CHECKSUM_UNNECESSARY indicates a failure, as the hardware
> or driver incorrectly marked a bad checksum as good.
> - If not received (after a timeout): The test then checks the device's
> error statistics.
> - If the rx_errors counter has incremented
> - If the counter has not incremented, the packet was lost for an unknown
> reason, and the test fails.
>
> What do you think?

Sounds like a good idea! Not sure if I'd bother with the rx_error
handling. Hopefully the drivers can be configured to pass the packet
thru.