iRWX.RU

Personal IT notes.

Linux: Добавляем поддержку любых SFP+ трансиверов для сетевой карты Intel

Дано:
ОС — Ubuntu 16.04.2 LTS
NIC — Intel X520-DA2
Трансивер — Opticin SFP-Plus-WDM-1270-1330.40
Версия драйвера Intel — 5.0.4

В логах видим:

ixgbe : failed to load because an unsupported SFP+ or QSFP module type was detected.
ixgbe : Reload the driver after installing a supported module.

Добавление allow_unsupported_sfp = 1,1 не помогло.

Патчим драйвер.

Скачиваем исходники драйвера с сайта производителя, распаковываем.

Правим файл (ixgbe_driver_dir)/src/ixgbe_phy.c

Ищем в нем секцию:

s32 ixgbe_identify_sfp_module_generic(struct ixgbe_hw *hw)

В ней ищем:

ixgbe_get_device_caps(hw, &enforce_sfp);

(В разных версиях драйвера возможен разный синтаксис. Как вариант искать «get_device_caps»)

и добавляем после нее строки:

/* PATCH Start*/
enforce_sfp |= IXGBE_DEVICE_CAPS_ALLOW_ANY_SFP;
/* PATCH End */

В итоге должно получиться подобное:

	ixgbe_get_device_caps(hw, &enforce_sfp);
	/* PATCH Start*/
	enforce_sfp |= IXGBE_DEVICE_CAPS_ALLOW_ANY_SFP;
	/* PATCH End */
	if (!(enforce_sfp & IXGBE_DEVICE_CAPS_ALLOW_ANY_SFP) &&
		!(hw->phy.sfp_type == ixgbe_sfp_type_1g_cu_core0 ||
		hw->phy.sfp_type == ixgbe_sfp_type_1g_cu_core1 ||
		hw->phy.sfp_type == ixgbe_sfp_type_1g_lx_core0 ||
		hw->phy.sfp_type == ixgbe_sfp_type_1g_lx_core1 ||
		hw->phy.sfp_type == ixgbe_sfp_type_1g_sx_core0 ||
		hw->phy.sfp_type == ixgbe_sfp_type_1g_sx_core1)) {
		/* Make sure we're a supported PHY type */
		if (hw->phy.type == ixgbe_phy_sfp_intel) {
			status = IXGBE_SUCCESS;
		} else {
			if (hw->allow_unsupported_sfp == true) {
			EWARN(hw, "WARNING: Intel (R) Network "
				"Connections are quality tested "
				"using Intel (R) Ethernet Optics."
				" Using untested modules is not "
				"supported and may cause unstable"
				" operation or damage to the "
				"module or the adapter. Intel "
				"Corporation is not responsible "
				"for any harm caused by using "
				"untested modules.\n", status);
			status = IXGBE_SUCCESS;
		} else {
			DEBUGOUT("SFP+ module not supported\n");
				hw->phy.type =
				ixgbe_phy_sfp_unsupported;
			status = IXGBE_ERR_SFP_NOT_SUPPORTED;
			}
		}
		} else {
		status = IXGBE_SUCCESS;
		}
		}

Далее собираем драйвер по инструкции в (ixgbe_driver_dir)/README

1 thought

  1. Столкнулся с такой же проблемой, по сути то что добавление опции не помогало — скорее всего из за того, что не добавляли опцию ядру при загрузке. Протестить можно переинициализацией драйвара через modprobe. Тут подробнее https://tech4fun.ru/2017/09/16/intel-unsupported-sfp/

Добавить комментарий

Ваш адрес email не будет опубликован. Обязательные поля помечены *