ghw icon indicating copy to clipboard operation
ghw copied to clipboard

net: replace the ethtool external program calls with the `safchain/ethtool` package

Open ffromani opened this issue 2 years ago • 13 comments

replace the ethtool invocation and related output parsing with the ethtool package which can now provide the same information natively (e.g. the package will NOT call the binary bug it will query the kernel)

Fixes: https://github.com/jaypipes/ghw/issues/317

ffromani avatar May 10 '22 16:05 ffromani

test failures are intentional (!!!) to make sure we don't merge without explicit action!

ffromani avatar May 11 '22 06:05 ffromani

proposed PR: https://github.com/safchain/ethtool/pull/49

ffromani avatar May 11 '22 13:05 ffromani

I'm glad to see refactoring with the native Go ethtool library removed many package dependencies and even simplified the code!

If we decide to go this route, I can contribute a PR which refactors #338 #342 to also use github.com/safchain/ethtool.

jak3kaj avatar May 15 '23 18:05 jak3kaj

I'm glad to see refactoring with the native Go ethtool library removed many package dependencies and even simplified the code!

If we decide to go this route, I can contribute a PR which refactors #338 #342 to also use github.com/safchain/ethtool.

I'm happy there's interest in this approach! The main and only blocker here seems that the upstream project is a bit slowmoving. I'll look for other alternatives. I'm also considering a fork tailored for ghw purposes, but I'm still considering the maintainership costs.

ffromani avatar May 16 '23 05:05 ffromani

@jaypipes just wondering: would a minimal ethtool package (perhaps unexported, like in internal/?) tailored for the needs of the project be a welcome addition to ghw? I'd like to move forward here and I'm considering which options we have on the table.

ffromani avatar May 16 '23 10:05 ffromani

@jaypipes just wondering: would a minimal ethtool package (perhaps unexported, like in internal/?) tailored for the needs of the project be a welcome addition to ghw? I'd like to move forward here and I'm considering which options we have on the table.

If there isn't a viable option out there in the open source world that is well-maintained and documented, I'd be perfectly fine doing an internal/ package, yes!

jaypipes avatar May 16 '23 12:05 jaypipes

@jaypipes just wondering: would a minimal ethtool package (perhaps unexported, like in internal/?) tailored for the needs of the project be a welcome addition to ghw? I'd like to move forward here and I'm considering which options we have on the table.

If there isn't a viable option out there in the open source world that is well-maintained and documented, I'd be perfectly fine doing an internal/ package, yes!

perfect, my thoughts exactly. Let me try harder not to have this internal package if we can help it.

ffromani avatar May 16 '23 12:05 ffromani