> -----Original Message----- > From: Jerin Jacob <jerinjac...@gmail.com> > Sent: Tuesday, February 7, 2023 12:01 AM > To: Carrillo, Erik G <erik.g.carri...@intel.com>; Stephen Hemminger > <step...@networkplumber.org> > Cc: jer...@marvell.com; dev@dpdk.org; sta...@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.carri...@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: sta...@dpdk.org > > > > Signed-off-by: Erik Gabriel Carrillo <erik.g.carri...@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