Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The Speed shows 65535 Mbps when the ethernet cable is unplug #77

Open
chnguyen-ampere opened this issue Dec 12, 2024 · 3 comments
Open

Comments

@chnguyen-ampere
Copy link
Contributor

chnguyen-ampere commented Dec 12, 2024

  • Description

The Speed property from /xyz/openbmc_project/network/ethX dbus object shows 65535 (decimal number) Mbps when unplug the ethernet cable.

  • Reproduce the issue:
  1. Unplug the ethernet cable
  2. Check the Speed property from /xyz/openbmc_project/network/ethX dbus object.
root@board:~# busctl introspect xyz.openbmc_project.Network /xyz/openbmc_project/network/eth0 | grep "Speed"
.Speed                                            property  u         65535                                                                  emits-change
  • Analyst issue

The phosphor-networkd will report Speed property by int type from the Ethernet PHY Linux driver (https://elixir.bootlin.com/linux/v6.6/source/include/linux/phy.h#L682)

But the Speed property was defined as a uint32 type (phosphor-dbus-interfaces/yaml/xyz/openbmc_project/Network/EthernetInterface.interface.yaml at master · openbmc/phosphor-dbus-interfaces)

A mismatch value type will happen when unplug the RJ45 cable, the Ethernet PHY Linux driver will return -1 value (SPEED_UNKNOWN macro) but the phosphor-networkd reports an uint32 value to the Speed property (phosphor-dbus-interfaces/yaml/xyz/openbmc_project/Network/EthernetInterface.interface.yaml at master · openbmc/phosphor-dbus-interfaces ). So, the Speed property will be 65535 (decimal number).

@williamspatrick
Copy link
Member

phosphor-networkd should probably catch the -1 condition and set the property to either 0 or max_int to indicate unknown.

@chnguyen-ampere
Copy link
Contributor Author

phosphor-networkd should probably catch the -1 condition and set the property to either 0 or max_int to indicate unknown.

Thank @williamspatrick , I'll push a patch to support probably catching the -1 condition and then set the property to 0 to indicate unknown.

@chnguyen-ampere
Copy link
Contributor Author

Hi @williamspatrick , I pushed a patch to fix this issue https://gerrit.openbmc.org/c/openbmc/phosphor-networkd/+/76647 . Please help me take look it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants