DPDK patches and discussions
 help / color / mirror / Atom feed
From: Stephen Hemminger <stephen@networkplumber.org>
To: Erik Gabriel Carrillo <erik.g.carrillo@intel.com>
Cc: jerinj@marvell.com, dev@dpdk.org, stable@dpdk.org
Subject: Re: [PATCH] eventdev/timer: fix overflow issue
Date: Tue, 24 Jan 2023 18:47:31 -0800	[thread overview]
Message-ID: <20230124184731.29b7de96@hermes.local> (raw)
In-Reply-To: <20230124160945.3003303-1-erik.g.carrillo@intel.com>

On Tue, 24 Jan 2023 10:09:45 -0600
Erik Gabriel Carrillo <erik.g.carrillo@intel.com> wrote:

> The software timer adapter converts event timer timeout ticks to a
> number of CPU cycles at which an rte_timer should expire. The
> computation uses integer operations that can result in overflow.
> 
> Use floating point operations instead to perform the computation, and
> convert the final result back to an integer type when returning. Also
> move the logic that checks the timeout range into the function that
> performs the above computation.
> 
> Fixes: 6750b21bd6af ("eventdev: add default software timer adapter")
> Cc: stable@dpdk.org

Don't like this solution.
Floating point is slow and inaccurate.
You can do it with fixed point math if you are careful.

  parent reply	other threads:[~2023-01-25  2:47 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-24 16:09 Erik Gabriel Carrillo
2023-01-24 20:45 ` [PATCH v2] " Erik Gabriel Carrillo
2023-02-07  6:00   ` Jerin Jacob
2023-02-07 22:02     ` Carrillo, Erik G
2023-02-09 15:13   ` [PATCH v3] " Erik Gabriel Carrillo
2023-02-10  6:47     ` Jerin Jacob
2023-01-25  2:47 ` Stephen Hemminger [this message]
2023-01-25  5:07   ` [PATCH] " Jerin Jacob
2023-01-25 14:53     ` Stephen Hemminger

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=20230124184731.29b7de96@hermes.local \
    --to=stephen@networkplumber.org \
    --cc=dev@dpdk.org \
    --cc=erik.g.carrillo@intel.com \
    --cc=jerinj@marvell.com \
    --cc=stable@dpdk.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).