Re: [PATCH net] selftests: drv-net: pause: detect the link partner from the remote side
From: Maxime Chevallier
Date: Tue Nov 24 2026 - 11:26:22 EST
On 11/24/26 17:15, Matthieu Baerts wrote:
> 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.
Looks like it's rather the HW or driver that doesn't support this :(
But that's OK, I think we should ask the least possible features from the
remotes, the rest of the selftest should already handle the missing capabilities
just fine,
Thanks :)
Maxime