Skip to content

Instantly share code, notes, and snippets.

@vfreex
Last active December 21, 2023 15:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vfreex/228f318c85abe44ad9ab76331c3c0933 to your computer and use it in GitHub Desktop.
Save vfreex/228f318c85abe44ad9ab76331c3c0933 to your computer and use it in GitHub Desktop.
ixgbe driver hack for 3rd-party SFP+ transceivers compatibility
// If both allow_unsupported_sfp=1 option and https://forums.servethehome.com/index.php?threads/patching-intel-x520-eeprom-to-unlock-all-sfp-transceivers.24634/ are not working,
// your SFP+ transceivers may be too old to support Transceiver Compliance Codes in EEPROM.
// Inspired from https://mails.dpdk.org/archives/dev/2019-May/131512.html.
// Looking for the following content in src/ixgbe_phy.c:
status = hw->phy.ops.read_i2c_eeprom(hw,
IXGBE_SFF_10GBE_COMP_CODES,
&comp_codes_10g);
if (status != IXGBE_SUCCESS)
goto err_read_i2c_eeprom;
status = hw->phy.ops.read_i2c_eeprom(hw,
IXGBE_SFF_CABLE_TECHNOLOGY,
&cable_tech);
if (status != IXGBE_SUCCESS)
goto err_read_i2c_eeprom;
// add the following lines
if (comp_codes_10g == 0 && cable_tech == 0) {
printk(KERN_ALERT "yuxzhu: SPF+ transceiver may not support SFF compliance code. Set comp_codes_10g=32");
comp_codes_10g = 32;
}
@mseflek
Copy link

mseflek commented Sep 26, 2022

Thanks for this! Helped a ton. For future searchers: you can make this same patch for the pfsense/opnsense ix driver by:

  1. setting up a FreeBSD VM (must choose to install src component when installing!)
  2. adding the above fix to the latest intel ix driver for FreeBSD
  3. compiling by running make in the src directory
  4. copying the generated if_ix.ko file to the /boot/kernel/ directory in your pfsense machine.
  5. running chmod 555 /boot/kernel/if_ix.ko
    6.if_ix_load="YES" to /boot/loader.conf

This process borrowed liberally from this gist for the Realtek driver here.

There are some small syntax changes you'll need to make. I believe I changed the code snippet to:

if (comp_codes_10g == 0 && cable_tech == 0) {
    printf("yuxzhu: SPF+ transceiver may not support SFF compliance code. Set comp_codes_10g=32");
    comp_codes_10g = 32;
}

@andycristea
Copy link

Thank you both! I need both the Linux and FreeBSD fixes. ISP updated their infra to 10gbit and gave me their SFP+ modules which, of course, were incompatible with the Intel cards in the servers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment