How to eliminate the variation in Ethernet link-up time

Hi,

When using the R-Car H3 Starter Kit, there are variations in the time from system startup to Ethernet link-up.

What causes the Ethernet link-up time to vary?
Also, can you tell me what to do to eliminate the variation in Ethernet link-up time?

[Details]
We have confirmed how often the Ethernet link-up time varies.
After booting a total of 10 times, the Ethernet link-up time after system booting is as follows.
2.5-3 sec: 6 times
5.5-6 sec: 4 times


After checking the details, there is no change in the driver initialization processing time, and the link-up notification from the Ethernet phy is uneven.

・ Reference (variation check)
Driver initialization completion time: 48msec
Ethernet link-up time: 5643 msec

Driver initialization completion time: 48msec
Ethernet link-up time: 5643 msec

Driver initialization completion time: 48msec
Ethernet link-up time: 3047 msec

Driver initialization completion time: 48msec
Ethernet link-up time: 2442 msec

In addition, I tried setting Auto MDI / MDI-X to "OFF", setting Auto Negotiation to "OFF", and fixing it to 100Base Full, but I could not suppress the variation in Ethernet link-up time.

Thanks & Regards,

Parents Reply
  • Hi,

    Thank you so much to do these operation on BSP v5.1.0.
    Just a question since R-Car H3 Starter kit doesn't have an Intel Gigabit adapter,
    can you confirm that the behaviour that you are observing is also true by comparing

    these two logs ?

    [ 3.946419] Micrel KSZ9031 Gigabit PHY e6800000.ethernet-ffffffff:00: attached PHY driver (mii_bus:phy_addr=e6800000.ethernet-ffffffff:00, irq=185)
    [ 6.828844] ravb e6800000.ethernet eth0: Link is Up - 1Gbps/Full - flow control off

    Thanks,

    Julien

Children
  • Hi,

    Yes, that's right.
    My log:
    1)
    [ 3.789082] Micrel KSZ9031 Gigabit PHY e6800000.ethernet-ffffffff:00: attached PHY driver [Micrel KSZ9031 Gigabit PHY] (mii_bus:phy_addr=e6800000.ethernet-ffffffff:00, irq=211)
    [ 14.777634] ravb e6800000.ethernet eth0: Link is Up - 1Gbps/Full - flow control off
    => diff: 10.988552

    2)
    [ 3.917814] Micrel KSZ9031 Gigabit PHY e6800000.ethernet-ffffffff:00: attached PHY driver [Micrel KSZ9031 Gigabit PHY] (mii_bus:phy_addr=e6800000.ethernet-ffffffff:00, irq=211)
    [ 9.592506] ravb e6800000.ethernet eth0: Link is Up - 1Gbps/Full - flow control off
    => diff: 5.674696

    3)
    [ 3.817427] Micrel KSZ9031 Gigabit PHY e6800000.ethernet-ffffffff:00: attached PHY driver [Micrel KSZ9031 Gigabit PHY] (mii_bus:phy_addr=e6800000.ethernet-ffffffff:00, irq=211)
    [ 10.525095] ravb e6800000.ethernet eth0: Link is Up - 1Gbps/Full - flow control off
    => diff: 6.707663

    BunBun
  • Hi BunBun,


    I tried to dive into the ethernet driver, it result that most of this delay is spent while starting
    autonegociation on PHY_UP event.

    https://github.com/renesas-rcar/linux-bsp/blob/v5.10/rcar-5.0.0.rc4/drivers/net/phy/phy.c#L1174

    We then start auto negociation on the micrel phy component and wait for an interrupt which will turn the ethernet adapter to running state.

    Regards,

    Julien