DPDK-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] ethdev: fix SFF-8472 external Rx power calibration
@ 2026-09-29 17:22 Roman Khromenok
  2026-09-29 17:22 ` [PATCH 1/2] " Roman Khromenok
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Roman Khromenok @ 2026-09-29 17:22 UTC (permalink / raw)
  To: dev; +Cc: Stephen Hemminger, Thomas Monjalon, Andrew Rybchenko

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


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2026-09-30 16:27 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-09-29 17:22 [PATCH 0/2] ethdev: fix SFF-8472 external Rx power calibration Roman Khromenok
2026-09-29 17:22 ` [PATCH 1/2] " Roman Khromenok
2026-09-29 17:22 ` [PATCH 2/2] test: check " Roman Khromenok
2026-09-30 16:27 ` [PATCH 0/2] ethdev: fix " Stephen Hemminger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox