From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr0-f195.google.com (mail-wr0-f195.google.com [209.85.128.195]) by dpdk.org (Postfix) with ESMTP id 11DCD1B2BB for ; Tue, 16 Jan 2018 16:50:27 +0100 (CET) Received: by mail-wr0-f195.google.com with SMTP id 100so15682519wrb.7 for ; Tue, 16 Jan 2018 07:50:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=6ojMjxt2qkCw5Ujo3/N9v+GnXrbuoB9EFrMagnWJUik=; b=TWdm30C1CxcZC74X4GeHgIOBOY0sKIA8+WgDyeGei+G+rViwgpnf/zalMjw4/zF/aE IXJ/sWhfE7GNKiuQLGnyppQ9V5OpPp0EiEOWiFzAy2KtVm4zl/LH5gKzN6k6fHL6dQqA YSWe4Z53WVamaitMuJokfwNNej6qzANPaCFc5p4Oid7/Ip4Qf7NCY1UIwbrdd+Qvskum BQTVvZD/gbiaLMqZipBKsipxA9FosFXnDzq5ZbmXqkC+do0vOdIAEhKqvzM2w5Gzm8qF 3Aw97cKHH/Dk7SLHgs//+rYkL/4r4QxvpdTFdcbA8Fq3qIze6ttsnY+Z4o93MweSwzkq S6NA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=6ojMjxt2qkCw5Ujo3/N9v+GnXrbuoB9EFrMagnWJUik=; b=SmVr45Takyjppkp1bRarawhgDPy2+rToKvjN5L3tTSUo6bntxeD0QR/ZxwSs53Ukeu 0I44b8frSIYtPrZiOKPzFNKVseDC0Xe3pMSytGc4gKI7GALkWFR7J9z/U+1J2mBWbhIo tGZc3OL/JC7U2mQa3jvUVu2WHH0JiobBv5iWPRTRd8tVE4YA4kkDG63/qJLOG75cj4zw cqxFCgDqE4rtOsweQlavaQfEJ4pNzNldSBtd0d84TuHagUFLFw5973E/FbrPwCLnupyw k7jgw2HdogcXNtZqpaTswnxc47ikfjNuiClqdj2fbozfBvEP7I8MhTiPBfPO65IwqBnd Dn6w== X-Gm-Message-State: AKwxytcHFZOWK0IiKxMN17GA2wt6dg+AF05kbYMU6m63kWzqD2rVEUbS 5wUHKw/cdUHYWQXXLkhAJ4tzvlux8ynANxbC5g== X-Google-Smtp-Source: ACJfBosgv5JUJG5og7AYgGHPxsUXmXMovyZZ+YFcTMbhfCEhMTeUebJ0wj+A7J5igpME5I4tRc25bcUGIgCHX+i1CtM= X-Received: by 10.223.199.206 with SMTP id y14mr2445376wrg.158.1516117827742; Tue, 16 Jan 2018 07:50:27 -0800 (PST) MIME-Version: 1.0 Received: by 10.223.186.195 with HTTP; Tue, 16 Jan 2018 07:50:27 -0800 (PST) In-Reply-To: <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> <20180115085252.1ea5d456@xeon-e3> From: Alan Dewar Date: Tue, 16 Jan 2018 15:50:27 +0000 Message-ID: To: Stephen Hemminger Cc: cristian.dumitrescu@intel.com, tomasz.kantecki@intel.com, jasvinder.singh@intel.com, dev@dpdk.org, Alan Dewar Content-Type: text/plain; charset="UTF-8" Subject: Re: [dpdk-dev] [PATCH v6] sched: make RED scaling configurable X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Jan 2018 15:50:28 -0000 On Mon, Jan 15, 2018 at 4:52 PM, Stephen Hemminger wrote: > > 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. > Okay will do. > > + 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; > Okay will do. > Why do functional tests have to be in same file and clutter the code? Do you mean the same patch file or the same unit-test file? I received feedback previously (might not have been this patch) where I had split the functional changes and the new unit-tests into separate patches and was asked to combine them into a single patch. I like the idea of if you have the fix you also have the new unit-tests. As for having the new tests in the same file as existing tests, the red tests are table driven so most of the changes to the unit-test code are just adding new table entries to exercise the RED code with a different scaling factor.