Transferring FreeBSD disk and two ethernet interfaces to a new more modern PC, but

em3: <Intel(R) Legacy PRO/1000 MT 82546EB (Copper)> port 0xc000-0xc03f mem 0xfd200000-0xfd21ffff,0xfd140000-0xfd17ffff irq 96 at device 6.1 on pci5
em3: EEPROM V15.255-15
em3: Using 1024 TX descriptors and 1024 RX descriptors
em3: failed to allocate IRQ for rid 0, name irq0.
em3: iflib_legacy_setup failed 12
device_attach: em3 attach returned 12

FreeBSD 15.0-RELEASE-p5 GENERIC

em0/em1/em2 all work. But em3 failed.

The two ethernet interfaces worked fine on the old machine.

Thanks for help.
 
The two ethernet interfaces worked fine on the old machine.

Hi TomHsiung -- So a few questions:
  • What kind of Hardware is this?
  • What FreeBSD version were you on before you migrated to 15.x?
  • What type of cards are the Ethernet cards?
Maybe my counting is off ... but (em0/em1/em2 == 3 working Ethernet cards?)

And the 4th Ethernet card (em3) does not?
 
I'm unsure as to what you are asking.
Sounds like you have hardware with em[0-3] that worked on "old machine" but on "new machine" only em[0-2] work.

That is 3 out of 4 not "2".
Does the new machine acutally identify the hardware at em[0-3]
 
Thanks for the feedback. I upgraded from FreeBSD 13 to 15 across a few years. The issue is for two Intel ethernet cards both of which have two ports.

Code:
pciconf -lv | grep -B3 network
re0@pci0:2:0:0: class=0x020000 rev=0x09 hdr=0x00 vendor=0x10ec device=0x8168 subvendor=0x1043 subdevice=0x8505
    vendor     = 'Realtek Semiconductor Co., Ltd.'
    device     = 'RTL8111/8168/8211/8411 PCI Express Gigabit Ethernet Controller'
    class      = network
--
em0@pci0:5:5:0: class=0x020000 rev=0x01 hdr=0x00 vendor=0x8086 device=0x1010 subvendor=0x8086 subdevice=0x1012
    vendor     = 'Intel Corporation'
    device     = '82546EB Gigabit Ethernet Controller (Copper)'
    class      = network
--
em1@pci0:5:5:1: class=0x020000 rev=0x01 hdr=0x00 vendor=0x8086 device=0x1010 subvendor=0x8086 subdevice=0x1012
    vendor     = 'Intel Corporation'
    device     = '82546EB Gigabit Ethernet Controller (Copper)'
    class      = network
--
em2@pci0:5:6:0: class=0x020000 rev=0x03 hdr=0x00 vendor=0x8086 device=0x1010 subvendor=0x8086 subdevice=0x1012
    vendor     = 'Intel Corporation'
    device     = '82546EB Gigabit Ethernet Controller (Copper)'
    class      = network
--
none0@pci0:5:6:1:       class=0x020000 rev=0x03 hdr=0x00 vendor=0x8086 device=0x1010 subvendor=0x8086 subdevice=0x1012
    vendor     = 'Intel Corporation'
    device     = '82546EB Gigabit Ethernet Controller (Copper)'
    class      = network
 
vendor = 'Realtek Semiconductor Co., Ltd.'

This (might not be helpful) :cool: ..

But back in the days when I was doing PCI hardware stuff - I used a lot of Realtek cards. If you have another Realtek PCi card lying around somewhere I would try that.
 
That's interesting. The one Intel not registered has the same identifying info as one of the others (rev, vendor, deviceid etc) so it should be captured by the same em device driver.
I don't think there is anything that would limit the number of devices that would use that driver.
 
the clue is in the error message for em3
Code:
em3: failed to allocate IRQ for rid 0, name irq0.
for some reason, the driver was not able to find a free irq for em3. Perhaps there is a limitation on which irq's it can use.
Unfortunately no clues in the em(4) man page.
 
imo make sure you've got the latest BIOS on the motherboard, and then, yes, go into the config and mess around with IRQ setting until it works.
 
My motherboard is ASUS M5A97 R2.0 and I just upgraded to the latest BIOS. Still, it failed.

Code:
sudo devctl rescan pci0:5:6:1
devctl: Failed to rescan pci0:5:6:1: Device not configured
 
Try with just one interface card installed at a time to prove that the hardware is still fully functional and has not been static zapped during the transplant. Test each card separately so that you see them working as em0 and em1. If both prove OK after the final test, power off the machine and install the other card to test both cards again em0-em3. Your testing from this point can eliminate hardware faults.

It is not a good idea to install or remove cards when the mains power lead is connected as power will be present on the interface slot even if the machine is powered off. Wake-On-LAN works because the NIC remains powered in order to receive the magic packet when the rest of the machine is off. Some interface cards are more tolerant than others when being installed or removed with the mains cable is still connected.

It is best to not take the chance with a powered up bus, disconnect the main lead and use a separate grounding cable. However, If your mains power cable contains a ground/earth conductor and the power outlet is correctly grounded, you can use it for grounding leaving the power lead connected to the PSU. Switch the PSU off at the wall socket. The ground wire will remain connected even if the power is off. Touch the grounded PSU case with both hands before touching any circuit board. This will safely discharge any static electricity on you before you touch any circuit boards.
 
PCI Slot 1 shares the interrupt with the onboard Realtek network. You're probably not going to need the onboard LAN so I would suggest disabling it in the BIOS.


But, you're probably better off replacing those old PCI cards with a modern PCIe variant. That second (black) PCIe x16 slot has 4 lanes, so you could stick a PCIe x4 network card in there. Way better performance too.

If you don't need an external graphics card you could stick a PCIe x8 network card in the (blue) PCIe x16 slot.
 
My motherboard is ASUS M5A97 R2.0 and I just upgraded to the latest BIOS. Still, it failed.

Code:
sudo devctl rescan pci0:5:6:1
devctl: Failed to rescan pci0:5:6:1: Device not configured

`dmesg` might have more details when this error occurs.

As for the BIOS, as I said before: mess with all options that have "irq" in the name.
 
I disabled re0 in BIOS. The issue remains. em2/em3 are on the ethernet card installed on PCI slot 2
pciconf -lv | grep -B3 network
Code:
em0@pci0:4:5:0: class=0x020000 rev=0x01 hdr=0x00 vendor=0x8086 device=0x1010 subvendor=0x8086 subdevice=0x1012
    vendor     = 'Intel Corporation'
    device     = '82546EB Gigabit Ethernet Controller (Copper)'
    class      = network
--
em1@pci0:4:5:1: class=0x020000 rev=0x01 hdr=0x00 vendor=0x8086 device=0x1010 subvendor=0x8086 subdevice=0x1012
    vendor     = 'Intel Corporation'
    device     = '82546EB Gigabit Ethernet Controller (Copper)'
    class      = network
--
em2@pci0:4:6:0: class=0x020000 rev=0x03 hdr=0x00 vendor=0x8086 device=0x1010 subvendor=0x8086 subdevice=0x1012
    vendor     = 'Intel Corporation'
    device     = '82546EB Gigabit Ethernet Controller (Copper)'
    class      = network
--
none0@pci0:4:6:1:       class=0x020000 rev=0x03 hdr=0x00 vendor=0x8086 device=0x1010 subvendor=0x8086 subdevice=0x1012
    vendor     = 'Intel Corporation'
    device     = '82546EB Gigabit Ethernet Controller (Copper)'
    class      = network

sudo devctl rescan pci0:4:6:1
Code:
devctl: Failed to rescan pci0:4:6:1: Device not configured

dmesg | tail -n 5
Code:
em0: link state changed to UP
em1: link state changed to UP
WARNING: sysctl vfs.zfs.min_auto_ashift is deprecated. Use vfs.zfs.vdev.min_auto_ashift instead.
Limiting tcp reset response from 241 to 188 packets/sec
Limiting tcp reset response from 319 to 215 packets/sec
 
vmstat -i
Code:
interrupt                          total       rate
irq16: hdac0                          73          0
irq18: ohci0 ohci2                     4          0
irq19: ahci0                        5654          2
irq20: ohci1+                     423303        184
irq21: ehci1++                    270679        118
irq22: ohci3                           2          0
irq56: hpet0:t0                   251382        109
irq59: re0                            68          0
irq60: xhci0                          80          0
Total                             951245        414

Is this info useful, guys?
 
Back
Top