Re: [PATCH net] selftests: drv-net: pause: detect the link partner from the remote side

From: Matthieu Baerts

Date: Tue Nov 24 2026 - 11:16:13 EST


On 24/11/2026 15:28, Maxime Chevallier wrote:
> On 11/24/26 12:29, Matthieu Baerts wrote:
>> Hi Maxime,
>>
>> On 23/11/2026 21:14, Maxime Chevallier (Netdev Foundation) wrote:
>>> The logic used to detect if the kselftest remote we're interacting with
>>> is directly connected to us uses link renegotiation to flap the link,
>>> that way we know if there's a switch between the remote and the DUT.
>>>
>>> However the current logic is racy. It triggers a link renegotiation,
>>> wait for the link to come back up locally, and looks on the remote if
>>> the link flap counter changed.
>>>
>>> It's possible that this entire cycle happens locally before the peer
>>> reports the link flap, in which case it reports that we're not directly
>>> connected to the peer when we actually are.
>>>
>>> Solve that by reversing the logic : Trigger a link renegotiation on the
>>> peer, and check if we see the link flap locally. The current
>>> wait_for_aneg() already waits for a full "up - down - up" cycle, so
>>> it doens't really matter which side of the link flaps first here.
>>>
>>> This was found in the stmmac CI setup, between an Intel I350-T4 card and
>>> an iMX8mp + KSZ9131 board. The Pause test was failing seemingly at
>>> random, due to the link flap occuring either on the host or the remote
>>> first.
>>
>> Thank you for the fix, but it looks like it is introducing new issues on
>> BCM57508:
>>
>>
>> https://netdev.bots.linux.dev/branch_deltas/net-next-hw-2026-11-24--08-00.html
>
> Arg seems that on this setup, the remote (I don't know which one it is) doesn't
> support 'ethtool -r', damn :(

These hosts are running Fedora 44. They have ethtool 7.0. I can upgrade
to the latest from F44 repos (7.2) if it can help.

> I'll take another approach then.
>
>>
>> Do you mind looking at that, and mask this test on your side for the two
>> boards you mentioned, please? :)
>
> Np, tests are masked on all boards though, I've done more runs and the race
> shows on all of them (all are now connected to the same type of NIC).

Thanks!

Cheers,
Matt