[dpdk-dev] [PATCH v6] sched: make RED scaling configurable

Stephen Hemminger stephen at networkplumber.org
Mon Jan 15 17:52:52 CET 2018


On Mon, 15 Jan 2018 16:16:09 +0000
alangordondewar at gmail.com wrote:

Looks like a good idea, minor editing feedback.


> -	red_cfg->min_th = ((uint32_t) min_th) << (wq_log2 + RTE_RED_SCALING);
> -	red_cfg->max_th = ((uint32_t) max_th) << (wq_log2 + RTE_RED_SCALING);
> -	red_cfg->pa_const = (2 * (max_th - min_th) * maxp_inv) << RTE_RED_SCALING;
> +	red_cfg->min_th = ((uint32_t) min_th) << (wq_log2 + rte_red_scaling);
> +	red_cfg->max_th = ((uint32_t) max_th) << (wq_log2 + rte_red_scaling);

While you are at it remove unnecessary parenthesis here.

> +	red_cfg->pa_const = (2 * (max_th - min_th) * maxp_inv) <<
> +		rte_red_scaling;

It reads easier if the the shift operator on the next line

	red_cfg->pa_const = (2 * (max_th - min_th) * maxp_inv)
		 << rte_red_scaling;

Why do functional tests have to be in same file and clutter the code?


More information about the dev mailing list