[PATCH 0/2] ethdev: fix SFF-8472 external Rx power calibration

Roman Khromenok roma55592 at yandex.ru
Tue Sep 29 19:22:08 CEST 2026


The SFF-8472 decoder does not apply the external Rx power calibration
as defined by the specification: the fourth order polynomial is reduced
to RX_PWR(0) + x * (RX_PWR(1) + RX_PWR(2) + RX_PWR(3)) and RX_PWR(4)
is never used. The code came from ethtool sfpdiag.c.

This was pointed out by Stephen during the review of the module EEPROM
decoding series; this series is based on it (dpdk-next-net).

Patch 1 fixes the formula and is intended for stable.
It also clamps the result to the 16-bit range, as the polynomial
easily overflows it with unexpected coefficients and converting
an out of range double to an integer is undefined behavior.
Patch 2 adds a unit test with all coefficients set.

Note: the calibration formula 1 (Tx bias, Tx power, temperature,
voltage) has the same out of range conversion issue; it is left
for a separate patch.

Depends-on: series-39436 ("ethdev: add API to decode module EEPROM")

Roman Khromenok (2):
  ethdev: fix SFF-8472 external Rx power calibration
  test: check SFF-8472 external Rx power calibration

 app/test/test_ethdev_module_eeprom.c | 37 ++++++++++++++++++++++++++++
 lib/ethdev/sff_8472.c                | 27 +++++++++++++-------
 2 files changed, 55 insertions(+), 9 deletions(-)

-- 
2.47.3



More information about the dev mailing list