From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stephen Hemminger Subject: Re: [PATCH v6] sched: make RED scaling configurable Date: Mon, 15 Jan 2018 08:52:52 -0800 Message-ID: <20180115085252.1ea5d456@xeon-e3> References: <1515425232-18888-1-git-send-email-alan.dewar@att.com> <1516032969-23894-1-git-send-email-alan.dewar@att.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: cristian.dumitrescu@intel.com, tomasz.kantecki@intel.com, jasvinder.singh@intel.com, dev@dpdk.org, Alan Dewar To: alangordondewar@gmail.com Return-path: Received: from mail-pf0-f177.google.com (mail-pf0-f177.google.com [209.85.192.177]) by dpdk.org (Postfix) with ESMTP id 0F4B33250 for ; Mon, 15 Jan 2018 17:52:57 +0100 (CET) Received: by mail-pf0-f177.google.com with SMTP id e11so8341980pff.6 for ; Mon, 15 Jan 2018 08:52:56 -0800 (PST) In-Reply-To: <1516032969-23894-1-git-send-email-alan.dewar@att.com> List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On Mon, 15 Jan 2018 16:16:09 +0000 alangordondewar@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?