All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stephen Hemminger <stephen@networkplumber.org>
To: Roman Khromenok <roma55592@yandex.ru>
Cc: dev@dpdk.org, Thomas Monjalon <thomas@monjalon.net>,
	Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Subject: Re: [PATCH 0/3] ethdev: fix SFF-8472 calibration overflow
Date: Fri, 2 Oct 2026 10:18:19 -0700	[thread overview]
Message-ID: <20261002101819.528d44d4@phoenix.local> (raw)
In-Reply-To: <cover.1790935333.git.roma55592@yandex.ru>

On Fri,  2 Oct 2026 14:52:34 +0200
Roman Khromenok <roma55592@yandex.ru> wrote:

> This follows up on the review of the SFF-8472 Rx power calibration fix,
> where the automated review pointed out the remaining issues in
> sff_8472_calibration().
> 
> Calibration formula 1 (temperature, voltage, Tx bias, Tx power) scales
> the 16-bit fields in place by a slope of up to 255.996 and adds a signed
> 16-bit offset. A result out of the field range is undefined behavior
> for the float to integer conversion; a negative sum wraps around.
> UBSan reports float-cast-overflow on randomly generated externally
> calibrated SFP dumps.
> 
> Patch 1 computes formula 1 in double precision and saturates the result
> to the field range, as already done for the Rx power. It is intended
> for stable.
> Patch 2 rounds the calibrated values to the nearest integer instead
> of truncating them: RX_PWR(1) = 0.7 is stored as 0.69999999 and
> a raw reading of 1000 gave 699 instead of 700.
> Patch 3 adds unit tests for saturation at both ends and for rounding.
> 
> Based on dpdk-next-net for-main.
> 
> Depends-on: series-39455 ("ethdev: fix SFF-8472 external Rx power calibration")

 Applied to next-net

      parent reply	other threads:[~2026-10-02 17:18 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-02 12:52 [PATCH 0/3] ethdev: fix SFF-8472 calibration overflow Roman Khromenok
2026-10-02 12:52 ` [PATCH 1/3] " Roman Khromenok
2026-10-02 12:52 ` [PATCH 2/3] ethdev: round SFF-8472 calibrated values Roman Khromenok
2026-10-02 12:52 ` [PATCH 3/3] test: check SFF-8472 calibration saturation and rounding Roman Khromenok
2026-10-02 17:18 ` Stephen Hemminger [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261002101819.528d44d4@phoenix.local \
    --to=stephen@networkplumber.org \
    --cc=andrew.rybchenko@oktetlabs.ru \
    --cc=dev@dpdk.org \
    --cc=roma55592@yandex.ru \
    --cc=thomas@monjalon.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.