net/mlx5: report duplex full when speed is known
Subsystems (7)
PATCH 1/1 net/mlx5: report duplex full when speed is known
Prior commit in Fixes, duplex is always reported full as long as the speed is known. Restore this behavior. Besides, modern Mellanox doesn't seem to care about half duplex. This change mitigates duplex unknown issue on Azure Mellanox 5.
--- drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c +3 -1
@@ -1118,9 +1118,11 @@ static void get_link_properties(struct net_device *netdev,if (info) { speed = info->speed; lanes = info->lanes; - duplex =DUPLEX_FULL ; }else if (data_rate_oper) speed =100 * data_rate_oper; +if (!speed) + goto out; + duplex =DUPLEX_FULL ; out: link_ksettings->base.duplex = duplex;
Signature · 1 line
2.50.0
Quoted 6 lines · Li Tian
Prior commit in Fixes, duplex is always reported full as long as the speed is known. Restore this behavior. Besides, modern Mellanox doesn't seem to care about half duplex. This change mitigates duplex unknown issue on Azure Mellanox 5.
Fixes c268ca6087f55 ("net/mlx5: Expose port speed when possible")
I'm confused with your commit message. You say DUPLEX used to be reported as Full if the speed is known. How does c268ca6087f55 change this? You don't say in the commit message. Why is Half duplex important to this fix? I don't see Half anywhere in the code.
Also, what sort of problems do you see with duplex unknown? When somebody has a problem and is looking to find a patch which might fix it, seeing a description of the problem fixed in the commit message is useful.
Andrew
Quoted 3 lines · Andrew Lunn
I'm confused with your commit message. You say DUPLEX used to be reported as Full if the speed is known. How does
c268ca6087f55change this?
Because in some circumstances like Azure, mlx5e_port_ptys2speed (now mlx5_port_ptys2info) does not return a speed. And thus it relies on data_rate_oper. It reads to me as long as there's no issue acquiring the speed duplex should be set to full.
Quoted 2 lines
You don't say in the commit message. Why is Half duplex important to this fix? I don't see Half anywhere in the code.
It does not return half duplex at all. It would be unknown. I'm just saying that half duplex shouldn't exist in modern Mellanox 5.
Quoted 1 line
Also, what sort of problems do you see with duplex unknown?
There were reports of RHEL seeing duplex unknown in ethtool on Azure Mellanox 5. The intention is to fix this.
Thanks for reviewing.
Li Tian
Quoted 8 lines · Li Tian
Quoted 3 lines · Andrew Lunn
I'm confused with your commit message. You say DUPLEX used to be reported as Full if the speed is known. How does
c268ca6087f55change this?Because in some circumstances like Azure,
mlx5e_port_ptys2speed(nowmlx5_port_ptys2info) does not return a speed.
So it can have link up without a speed? Speed is returned unknown? But Azure is virtual? So both speed and duplex are both meaningless? There is no physical communication medium. So unknown is reasonable.
Quoted 2 lines
It does not return half duplex at all. It would be unknown. I'm just saying that half duplex shouldn't exist in modern Mellanox 5.
And that is relevant because?
Quoted 4 lines
Quoted 1 line
Also, what sort of problems do you see with duplex unknown?
There were reports of RHEL seeing duplex unknown in ethtool on Azure Mellanox 5. The intention is to fix this.
Just reports of ethtool returning unknown? But nothing actually broken?
Andrew