Giter Club home page Giter Club logo

Comments (1)

thombashi avatar thombashi commented on May 30, 2024 1

@dastergon
Thank you for your detailed investigation and the pull request.
That's good to know.
I did not know that the para-virtualized network drivers return -1 to /sys/class/net/<iface>/speed.

ethtool seems to accept SPEED_UNKNOWN (-1):
https://github.com/torvalds/linux/blob/a090bd4ff8387c409732a8e059fbf264ea0bdd56/include/uapi/linux/ethtool.h#L1509

static inline int ethtool_validate_speed(__u32 speed)
{
	return speed <= INT_MAX || speed == SPEED_UNKNOWN;
}

https://github.com/torvalds/linux/blob/a090bd4ff8387c409732a8e059fbf264ea0bdd56/include/uapi/linux/ethtool.h#L1652

 * struct ethtool_link_settings - link control and status
...
 * is up they represent the negotiated link mode; if the link is down,
 * the speed is 0, %SPEED_UNKNOWN or the highest enabled speed and
 * @duplex is %DUPLEX_UNKNOWN or the best enabled duplex mode.

So would it make sense to add a handling in the code to default to the iproute2 upper bound when it encounters a -1 speed?

That makes sense.

I've made some modification for tests (no logic changes), and add test cases.
And now, published at tcconfig 0.13.1.
Thank you for your help.

from tcconfig.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.