[PATCH v2] eventdev/timer: fix overflow issue

Carrillo, Erik G erik.g.carrillo at intel.com
Tue Feb 7 23:02:00 CET 2023



> -----Original Message-----
> From: Jerin Jacob <jerinjacobk at gmail.com>
> Sent: Tuesday, February 7, 2023 12:01 AM
> To: Carrillo, Erik G <erik.g.carrillo at intel.com>; Stephen Hemminger
> <stephen at networkplumber.org>
> Cc: jerinj at marvell.com; dev at dpdk.org; stable at dpdk.org
> Subject: Re: [PATCH v2] eventdev/timer: fix overflow issue
> 
> On Wed, Jan 25, 2023 at 2:16 AM Erik Gabriel Carrillo
> <erik.g.carrillo at 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 at dpdk.org
> >
> > Signed-off-by: Erik Gabriel Carrillo <erik.g.carrillo at intel.com>
> > ---
> > v2:
> > * Fix implicit int to float conversion build warning on Clang
> 
> Not yet addressed the @Stephen Hemminger  comments on using of
> rte_reciprocal. Also means to check what compute can be moved to
> slowpath.
> Marking as "Change requested", Looking for next version.
> 
> 

Ok - thanks for the pointer to rte_reciprocal.   I'll rework and submit a new version.

Regards,
Erik


More information about the stable mailing list