Hello Genodians
While testing my changed usb_net driver that supports SMSC95XX on arm_v8a I discovered, that the link state isn't propagated to the connected nic_router as it has been with the old version.
With the old driver the log output of nic_router was as follows when the cable was connected/disconnected:
<connect cable> [init -> nic_router] [secondary_nic] NIC sessions: 1 [init -> nic_router] [secondary_nic] dynamic IP config: interface 10.10.10.10/16, ...
<disconnect cable> [init -> nic_router] [secondary_nic] dynamic IP config: none [init -> nic_router] [secondary_nic] NIC sessions: 0
With the new driver nic_router always reports:
[init -> nic_router] [secondary_nic] NIC sessions: 1
As I do not have any other devices that need the usb_net driver, I'm not sure, if this only happens for my driver or if this is consistent with all other device types.
Could someone with an other usb_net driven device give me feedback, if other devices show the same log outputs?
Regards, Pirmin
Hello Pirmin,
On 02.02.24 10:22, Pirmin Duss wrote:
Hello Genodians
While testing my changed usb_net driver that supports SMSC95XX on arm_v8a I discovered, that the link state isn't propagated to the connected nic_router as it has been with the old version.
With the old driver the log output of nic_router was as follows when the cable was connected/disconnected:
<connect cable> [init -> nic_router] [secondary_nic] NIC sessions: 1 [init -> nic_router] [secondary_nic] dynamic IP config: interface 10.10.10.10/16, ...
<disconnect cable> [init -> nic_router] [secondary_nic] dynamic IP config: none [init -> nic_router] [secondary_nic] NIC sessions: 0
With the new driver nic_router always reports:
[init -> nic_router] [secondary_nic] NIC sessions: 1
As I do not have any other devices that need the usb_net driver, I'm not sure, if this only happens for my driver or if this is consistent with all other device types.
Could someone with an other usb_net driven device give me feedback, if other devices show the same log outputs?
It works and is tested for all drivers except SMC95xx, where it is not working. The reason is that the driver registers itself as an mdio driver for itself and uses the PHY and IRQ domain infrastructure (see: smsc95xx_bind -> phy_connect_direct) to track link state changes. The old Linux driver did not it this way and I have not taken the time to look into it because to enable the MDIO/PHY parts for virt_linux is non-trivial. You could try and find out how the old Linux driver implemented link-state changes and maybe there is an easier way to do it.
Btw, I had to patch the driver so it will not report link state down ("NIC sessions: 0") all the time ;)
Regards,
Sebastian
Hello Sebastian,
On 02.02.24 10:57, Sebastian Sumpf wrote:
It works and is tested for all drivers except SMC95xx, where it is not working. The reason is that the driver registers itself as an mdio driver for itself and uses the PHY and IRQ domain infrastructure (see: smsc95xx_bind -> phy_connect_direct) to track link state changes. The old Linux driver did not it this way and I have not taken the time to look into it because to enable the MDIO/PHY parts for virt_linux is non-trivial. You could try and find out how the old Linux driver implemented link-state changes and maybe there is an easier way to do it.
Btw, I had to patch the driver so it will not report link state down ("NIC sessions: 0") all the time ;)
Thanks for the information. I will try to look in to this, but first I have more important tasks to complete.
I will also have to figure out why I do have sporadically the log line below while my new usb_net driver is running:
[init -> usb_host_drv] Error: lx_emul_mem_free called with invalid ptr 0x10305
The address is changing. I did never see the message before introducing my new usb_net driver.
Regards, Pirmin