DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Dumitrescu, Cristian" <cristian.dumitrescu@intel.com>
To: Alan Dewar <alangordondewar@gmail.com>,
	Stephen Hemminger <stephen@networkplumber.org>
Cc: "Kantecki, Tomasz" <tomasz.kantecki@intel.com>,
	"Singh, Jasvinder" <jasvinder.singh@intel.com>,
	"dev@dpdk.org" <dev@dpdk.org>, Alan Dewar <alan.dewar@att.com>
Subject: Re: [dpdk-dev] [PATCH v6] sched: make RED scaling configurable
Date: Tue, 16 Jan 2018 16:44:16 +0000	[thread overview]
Message-ID: <3EB4FA525960D640B5BDFFD6A3D891267BAFED5C@IRSMSX108.ger.corp.intel.com> (raw)
In-Reply-To: <CAOEQf6gZA7B6+w1mQu-m3W_qpSdNnkMD5aUei=m1_uH8zLLk8w@mail.gmail.com>



> -----Original Message-----
> From: Alan Dewar [mailto:alangordondewar@gmail.com]
> Sent: Tuesday, January 16, 2018 3:58 PM
> To: Stephen Hemminger <stephen@networkplumber.org>
> Cc: Dumitrescu, Cristian <cristian.dumitrescu@intel.com>; Kantecki, Tomasz
> <tomasz.kantecki@intel.com>; Singh, Jasvinder
> <jasvinder.singh@intel.com>; dev@dpdk.org; Alan Dewar
> <alan.dewar@att.com>
> Subject: Re: [dpdk-dev] [PATCH v6] sched: make RED scaling configurable
> 
> On Tue, Jan 16, 2018 at 3:50 PM, Alan Dewar
> <alangordondewar@gmail.com> wrote:
> > On Mon, Jan 15, 2018 at 4:52 PM, Stephen Hemminger
> > <stephen@networkplumber.org> 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.
> 
> Ah - the compiler doesn't like it if I remove all the unnecessary
> parenthesis. it gives the following error:
> 
> /home/adewar/git-repos/dpdk/lib/librte_sched/rte_red.c:153:49: error:
> suggest parentheses around ‘+’ inside ‘<<’ [-Werror=parentheses]
>   red_cfg->min_th = (uint32_t) min_th << wq_log2 + rte_red_scaling;
> 
> I'll reinstate the ones around the addition.

Alan,

I have a different view here, I suggest we keep the parenthesis as they are, as the code is easier to read and maintain. RED is not the code where you want to play with compiler typecasts and arithmetic.

Regards,
Cristian


  reply	other threads:[~2018-01-16 16:44 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1507022514-21831-1>
2018-01-08 15:27 ` [dpdk-dev] [PATCH v5] " alangordondewar
2018-01-11 13:11   ` Dumitrescu, Cristian
2018-01-12  9:38     ` Dewar, Alan
2018-01-12 11:09       ` Dumitrescu, Cristian
2018-01-12 11:52         ` Dumitrescu, Cristian
2018-01-15 15:36           ` Dewar, Alan
2018-01-16 11:56             ` Dumitrescu, Cristian
2018-01-12 10:44     ` Dewar, Alan
2018-01-12 11:43       ` Dumitrescu, Cristian
2018-01-15 16:16   ` [dpdk-dev] [PATCH v6] " alangordondewar
2018-01-15 16:52     ` Stephen Hemminger
2018-01-16 15:50       ` Alan Dewar
2018-01-16 15:57         ` Alan Dewar
2018-01-16 16:44           ` Dumitrescu, Cristian [this message]
2018-01-16 16:07     ` [dpdk-dev] [PATCH v7] " alangordondewar
2019-04-05 15:36       ` Ferruh Yigit
2019-04-05 15:36         ` Ferruh Yigit
2019-04-08  8:24         ` Alan Dewar
2019-04-08  8:24           ` Alan Dewar
2019-04-08  8:53           ` Thomas Monjalon
2019-04-08  8:53             ` Thomas Monjalon
2019-04-08 13:29             ` Dumitrescu, Cristian
2019-04-08 13:29               ` Dumitrescu, Cristian
2020-07-06 23:09               ` Thomas Monjalon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3EB4FA525960D640B5BDFFD6A3D891267BAFED5C@IRSMSX108.ger.corp.intel.com \
    --to=cristian.dumitrescu@intel.com \
    --cc=alan.dewar@att.com \
    --cc=alangordondewar@gmail.com \
    --cc=dev@dpdk.org \
    --cc=jasvinder.singh@intel.com \
    --cc=stephen@networkplumber.org \
    --cc=tomasz.kantecki@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).