Skip to content

Supported Link modes: Strange output #46

@gutjuri

Description

@gutjuri

Hello, if I do

e, err := ethtool.NewEthtool()
if err != nil {
	panic(err.Error())
}
defer e.Close()
cmdGet, err := e.CmdGetMapped(*name)
if err != nil {
	panic(err.Error())
}
fmt.Printf("cmd get: %+d\n", cmdGet["Supported"])

i get 25327, which is a bitmask (01100010 11101111) that has 10 bits set. These bits correspond to the linkmodes 10baseT_Half 10baseT_Full 100baseT_Half 100baseT_Full 1000baseT_Full 10000baseT_Full 2500baseX_Full 10000baseKX4_Full 20000baseKR2_Full 40000baseKR4_Full.

If I run the command ethtool however, I only get 5 supported linkmodes, namely 10baseT/Half 10baseT/Full 100baseT/Half 100baseT/Full 1000baseT/Full.

How can this difference be explained? Unfortunately, there is no documentation on the ethtool (https://mirrors.edge.kernel.org/pub/software/network/ethtool/devel.html). Like this tool, they also use the SIOCETHTOOL syscall, for which I can't find any documentation either.

I'd be grateful for any advice :)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions