On Tue, 14 Dec 2021 14:12:42 +0000
Ronan Randles <ronan.rand...@intel.com> wrote:

> +             /* Track time since last token add and calculate number
> +              * of tokens to give per second to implement line rate limiting
> +              */
> +             uint64_t now = rte_rdtsc();
> +             uint64_t tsc_delta = now - token_last_add_tsc;
> +             float token_scalar = (float)tsc_delta / tsc_hz_f;
> +             float add_tokens = args->target_tx_pps * token_scalar;

floating point math is slow, could you do this fixed point with
reciprocal divide?

Reply via email to