Re: [PATCH net-next v3 10/47] net: phylink: Adjust link settings based on rate adaptation

From
Andrew Lunn <andrew@lunn.ch>
Date
2022-07-17 01:39:55
Also in
linux-arm-kernel, lkml
Reply to
Sean Anderson, 2022-07-16
quoted
I would not do this. If the requirements for rate adaptation are not
fulfilled, you should turn off rate adaptation.

A MAC which knows rate adaptation is going on can help out, by not
advertising 10Half, 100Half etc. Autoneg will then fail for modes
where rate adaptation does not work.
OK, so maybe it is better to phylink_warn here. Something along the
lines of "phy using pause-based rate adaptation, but duplex is %s".
You say 1/2 duplex simply does not work with rate adaptation. So i
would actually return -EINVAL at the point the MAC indicates what
modes it supports if there is a 1/2 duplex mode in the list.
quoted
The MAC should also be declaring what sort of pause it supports, so
disable rate adaptation if it does not have async pause.
That's what we do in the previous patch.

The problem is that rx_pause and tx_pause are resolved based on our
advertisement and the link partner's advertisement. However, the link
partner may not support pause frames at all. In that case, we will get
rx_pause and tx_pause as false. However, we still want to enable rx_pause,
because we know that the phy will be emitting pause frames. And of course
the user can always force disable pause frames anyway through ethtool.
Right, so we need a table somewhere in the documentation listing the
different combinations and what should happen.

If the MAC does not support rx_pause, rate adaptation is turned off.
If the negotiation results in no rx_pause, force it on anyway with
Pause based adaptation. If ethtool turns pause off, turn off rate
adaptation.

Does 802.3 say anything about this?

We might also want to add an additional state to the ethtool get for
pause, to indicate rx_pause is enabled because of rate adaptation, not
because of autoneg.

       Andrew
Thread (123 messages) 123 messages, 7 authors, last reply 2022-07-26
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help