Unable to obtain network access through DHCP

Environment:
  • FreeBSD 13.2 official version
  • RPi 400 (bootloader 8ba17717 2023/01/11)
  • GENET version 5.0 phy 0x0000
Bug description:
After booting with an Ethernet cable plugged in, we noticed that the ifconfig command did not display the status for the genet0 interface, which make it unable to obtain network access through DHCP.
We have 24 RPi 400 (their bootloaders are the same), 7 of them have this problem.

Steps to reproduce:
However, we found a way to enable the network connection, but we don’t know the reasons behind it:
  1. Use an Ethernet dongle to plug into RPi 400
  2. Although there is still no network connectivity after using the ethernet dongle, it appears that the dongle activates the interface status.
  3. Switch back to the original Ethernet port without using the dongle, the genet0 interface status changed to active, and we were able to connect to the network.
Expected result:
We suppose to have the genet0 status to be active after turning on RPi 400:
1698125065483.png

Also, if we follow the steps mentioned above, we can get the “status: active”.

Actual result:
We can not get the genet0 status after booting with an Ethernet cable plugged in:
1698125139529.png
 
If you want to see the state of all NICs use ifconfig -a.

I have seen references to genet(4) Ethernet NICs not working well with energy saving switches.

Have you tried a manual setup with dhclient genet0?
 
Yes, but it seems that it still can't obtain an IP address.
Screen Shot 2023-10-27 at 10.52.15 PM.png
This is why I'm curious why it gets an IP address after using the dongle first and then switching to an ethernet cable.
 
This is why I'm curious why it gets an IP address after using the dongle first and then switching to an ethernet cable.
Assuming that you are using the same cable, plugged into the same switch, it strongly suggests that your problem is to do with the on-board NIC.

Consider the theory that, when the system boots, a sleeping switch port is not being woken up by the on-board NIC, but will be woken by the USB dongle. This is consistent with reports regarding the genet NIC I have seen on the Internet (it dos not play well with "green" switches that "sleep" when not in use).

Do you have a different switch to test with?

Edit: you could try power cycling the switch just before executing dhclient genet0.
 
try to force media with ifconfig
ifconfig genet0 media 100basetx-fdx
and see if you get link
look in dmesg for the phy for supported media options
 
After manually forcing media with ifconfig, the system can get the link now.

I wonder why when using the same machine and the same installation procedure, some can get a network link by simply plugging in an Ethernet cable, while others need to manually configure 'ifconfig media.' Is this related to some hardware or driver issues?
 
There's a lot of negotiations to be done when two NICs (one on your Pi, the other on your switch) open a converstaion. There's a lot of "standards" to be observed, and options to be negotiated. Every Ethernet driver and every type of hardware NIC has the opportunity to behave differently -- and to fail some negotiation in some subtle way. The problem you experienced was probably due to quirks in how the genet Ethernet driver deals with waking up the switch NIC from its "green" sleep.
 
Back
Top