Hi, I have applied the attached patch and received the attached output in the dmesg. I hope it helps a bit.
MIZSEI Zoltán írta 2026. jan.. 27, K-n 14:01 órakor:
> Hi,
>
> thanks for the hint, I just did a quick check with FreeBSD 15 RELEASE,
> it works fine, i see the following:
>
> (...)
> em0: <Intel(R) I219-LM TGP(13)> mem 0xa2300000-0xa231ffff at device 31.6 on
> pci0
> em0: EEPROM V0.8-4
> em0: Using 1024 TX descriptors and 1024 RX descriptors
> em0: Using an MSI interrupt
> em0: Ethernet address: RE:DA:CT:ED:12
> em0: netmap quotes/slots: TX 1/1024, RX 1/1024
> (...)
>
> So if the driver employs some workarounds, then FreeBSD clearly uses a
> different set or some extra workarounds for this specific hardware than
> OpenBSD. Would it be possible to implement those workarounds for
> OpenBSD?
> Interestingly Illumos also works just fine with this NIC.
>
> Best Regards,
> -- e
>
> Crystal Kolipe írta 2026. jan.. 27, K-n 10:48 órakor:
>> On Mon, Jan 26, 2026 at 07:21:54PM +0100, MIZSEI Zoltn wrote:
>>> sys/dev/pci/if_em.c I have commented out the following section, effectively
>>> disabling the cheksum check:
>>>
>>> #ifdef TEST
>>> /* Make sure we have a good EEPROM before we read from it */
>>> if (em_get_flash_presence_i210(&sc->hw) &&
>>> em_validate_eeprom_checksum(&sc->hw) < 0) {
>>> /*
>>> * Some PCIe parts fail the first check due to
>>> * the link being in sleep state, call it again,
>>> * if it fails a second time its a real issue.
>>> */
>>> if (em_validate_eeprom_checksum(&sc->hw) < 0) {
>>> printf("%s: The EEPROM Checksum Is Not Valid\n",
>>> DEVNAME(sc));
>>> return (EIO);
>>> }
>>> }
>>> #endif
>>
>> You might want to look at em_validate_eeprom_checksum() in if_em_hw.c, and
>> try
>> to find out exactly where it's failing.
>>
>> If you search around on-line, you'll find a fair amount of discussion about
>> issues with the non-volatile memory on various i219 series network adaptors.
>>
>> These issues are not limited to OpenBSD, you'll find discussion on Linux
>> forums as well.
>>
>> Having said that, there is already code to address one of the known issues in
>> em_validate_eeprom_checksum(), and this was imported from FreeBSD a long time
>> ago, so most of these devices are indeed expected to just work with OpenBSD,
>> and presumably your device is doing something different.
>
> --
> --Z--
--
--Z--
em_debug_checksum.patch
Description: Binary data
Feb 6 21:22:02 dell /bsd: em0 at pci0 dev 31 function 6 "Intel I219-LM" rev 0x20: msiem_validate_eeprom_checksum: START Feb 6 21:22:02 dell /bsd: mac_type = 33 (em_pch_tgp) Feb 6 21:22:02 dell /bsd: revision_id = 0x20 Feb 6 21:22:02 dell /bsd: IS_ICH8 = 1 Feb 6 21:22:02 dell /bsd: checksum_reg = 0x003f Feb 6 21:22:02 dell /bsd: Entering IS_ICH8 workaround section Feb 6 21:22:02 dell /bsd: Using EEPROM_COMPAT workaround (I217+/I218+/I219+) Feb 6 21:22:02 dell /bsd: Reading word 0x0003, mask = 0x0001 Feb 6 21:22:02 dell /bsd: Read value = 0x0800 Feb 6 21:22:02 dell /bsd: Masked value = 0x0000 Feb 6 21:22:02 dell /bsd: Valid checksum bit NOT set, attempting to set it Feb 6 21:22:02 dell /bsd: Updated checksum Feb 6 21:22:02 dell /bsd: Starting checksum calculation (0 to 0x003f) Feb 6 21:22:02 dell /bsd: NVM[0x0000] = 0x7874 Feb 6 21:22:02 dell /bsd: NVM[0x0001] = 0x8327 Feb 6 21:22:02 dell /bsd: NVM[0x0002] = 0x7a75 Feb 6 21:22:02 dell /bsd: NVM[0x0003] = 0x0800 Feb 6 21:22:02 dell /bsd: NVM[0x0004] = 0xffff Feb 6 21:22:02 dell /bsd: NVM[0x0005] = 0x0084 Feb 6 21:22:02 dell /bsd: NVM[0x0006] = 0x0001 Feb 6 21:22:02 dell /bsd: NVM[0x0007] = 0x006c Feb 6 21:22:02 dell /bsd: NVM[0x0008] = 0xffff Feb 6 21:22:02 dell /bsd: NVM[0x0009] = 0xffff Feb 6 21:22:02 dell /bsd: NVM[0x000a] = 0x10c9 Feb 6 21:22:02 dell /bsd: NVM[0x000b] = 0x0000 Feb 6 21:22:02 dell /bsd: NVM[0x000c] = 0x8086 Feb 6 21:22:02 dell /bsd: NVM[0x000d] = 0x15fb Feb 6 21:22:02 dell /bsd: NVM[0x000e] = 0x0000 Feb 6 21:22:02 dell /bsd: NVM[0x000f] = 0x0000 Feb 6 21:22:02 dell /bsd: Calculated checksum = 0xbcba Feb 6 21:22:02 dell /bsd: Expected checksum = 0xbaba Feb 6 21:22:02 dell /bsd: Difference = 0x0200 Feb 6 21:22:02 dell /bsd: Checksum INVALID! Feb 6 21:22:02 dell /bsd: em_validate_eeprom_checksum: START Feb 6 21:22:02 dell /bsd: mac_type = 33 (em_pch_tgp) Feb 6 21:22:02 dell /bsd: revision_id = 0x20 Feb 6 21:22:02 dell /bsd: IS_ICH8 = 1 Feb 6 21:22:02 dell /bsd: checksum_reg = 0x003f Feb 6 21:22:02 dell /bsd: Entering IS_ICH8 workaround section Feb 6 21:22:02 dell /bsd: Using EEPROM_COMPAT workaround (I217+/I218+/I219+) Feb 6 21:22:02 dell /bsd: Reading word 0x0003, mask = 0x0001 Feb 6 21:22:02 dell /bsd: Read value = 0x0800 Feb 6 21:22:02 dell /bsd: Masked value = 0x0000 Feb 6 21:22:02 dell /bsd: Valid checksum bit NOT set, attempting to set it Feb 6 21:22:02 dell /bsd: Updated checksum Feb 6 21:22:02 dell /bsd: Starting checksum calculation (0 to 0x003f) Feb 6 21:22:02 dell /bsd: NVM[0x0000] = 0x7874 Feb 6 21:22:02 dell /bsd: NVM[0x0001] = 0x8327 Feb 6 21:22:02 dell /bsd: NVM[0x0002] = 0x7a75 Feb 6 21:22:02 dell /bsd: NVM[0x0003] = 0x0800 Feb 6 21:22:02 dell /bsd: NVM[0x0004] = 0xffff Feb 6 21:22:02 dell /bsd: NVM[0x0005] = 0x0084 Feb 6 21:22:02 dell /bsd: NVM[0x0006] = 0x0001 Feb 6 21:22:02 dell /bsd: NVM[0x0007] = 0x006c Feb 6 21:22:02 dell /bsd: NVM[0x0008] = 0xffff Feb 6 21:22:02 dell /bsd: NVM[0x0009] = 0xffff Feb 6 21:22:02 dell /bsd: NVM[0x000a] = 0x10c9 Feb 6 21:22:02 dell /bsd: NVM[0x000b] = 0x0000 Feb 6 21:22:02 dell /bsd: NVM[0x000c] = 0x8086 Feb 6 21:22:02 dell /bsd: NVM[0x000d] = 0x15fb Feb 6 21:22:02 dell /bsd: NVM[0x000e] = 0x0000 Feb 6 21:22:02 dell /bsd: NVM[0x000f] = 0x0000 Feb 6 21:22:02 dell /bsd: Calculated checksum = 0xbcba Feb 6 21:22:02 dell /bsd: Expected checksum = 0xbaba Feb 6 21:22:02 dell /bsd: Difference = 0x0200 Feb 6 21:22:02 dell /bsd: Checksum INVALID! Feb 6 21:22:02 dell /bsd: em0: The EEPROM Checksum Is Not Valid Feb 6 21:22:02 dell /bsd: em0: Unable to initialize the hardware
