Ethtool not working with linux 4.4

In Linux, when running ifconfig, I got the following response:

eth0      Link encap:Ethernet  HWaddr 00:14:2D:XX:XX:XX ......

When running ethtool -i eth0, I got the following:

driver: eth-switch
version:
firmware-version:
bus-info: 400e8000.l2-switch
supports-statistics: no
supports-test: no
supports-eeprom-access: no
supports-register-dump: no
supports-priv-flags: no

Please help. We need the result of the ethtool command for production testing.

thank you

The same ethtool program was working in the older Linux kernel (3.0.15). But not working in 4.4.

hi @weixiong100

Could you provide the version of the hardware and software of your module? Which carrier board are you using?

When running ethtool -i eth0, I got the following:

So what exactly is the issue?
What is your application? What are you trying to do?

Best regards,
Jaski

hi Jaski,

Our board is vf50, 1.2A. running on our own carrier board. We moved from Linux kernel 3.0.15 (BSP 2.3) to kernel 4.4 (BSP 2.8) recently, and ethtool does not work on the newer kernel. We are using an external Micrel switch KSZ8863 on our carrier board. I modified the dual-Ethernet board device tree for our carrier board.

The issue is that ethtool eth0 does not display the switch information. We use ethtool eth0 in our production testing, to verify the Ethernet speed.

in vf-colibri-dual-eth.dtsi, I modify such that:
Ethernet0 = &esw;

&esw {
    pinctrl-names = "default";
    pinctrl-0 = <&pinctrl_fec0 & pinctrl_fec1>;
    status = "okay";
};

After some experiment, it seems it seems it is what causing the issue. it works fine after I change back to:
Ethernet0 = &fec0;

&fec0 {
    phy-mode = "rmii";
    pinctrl-names = "default";
    pinctrl-0 = <&pinctrl_fec0>;
    status = "okay";
};

However, I would like to keep using ethernet0=&esw; Is there a way to make ethtool displaying Ethernet link setting by keeping ethernet0=&esw;?

The reason I need to use esw, is because our external Micrel switch connects has two physical Ethernet ports: port1 and port2. With ehterenet0=&fec0 in the device tree, the Linux would think the Ethernet link is up if-and-only-if port1 is connected with a cable. We would like to make the Linux think the Ethernet link is up if EITHER port1 OR port2 is connected. That is why we had to use ethernet0=&esw instead. Because by doing that, the Linux will always think the Ethernet link is always up, no matter if any cables connected. Not optimal, but at least not blocking our product development.

thank you for your help.

I’m not sure whether your issue may be related to the following:

However, given you are also connecting an external switch you may be better off integrating that one’s switchdev capabilities. You may find more information here as well:

I modified the phy_drivers.c, so that it would check the status of port1 and port2.

Perfect, thanks for letting us know.