DPDK patches and discussions
 help / color / mirror / Atom feed
From: Thomas Monjalon <thomas.monjalon@6wind.com>
To: "Xie, Huawei" <huawei.xie@intel.com>
Cc: dev@dpdk.org, Hayato Momma <h-momma@ce.jp.nec.com>
Subject: Re: [dpdk-dev] [memnic PATCH v2 6/7] pmd: add branch hint in recv/xmit
Date: Tue, 30 Sep 2014 16:51:10 +0200	[thread overview]
Message-ID: <5360316.uoHmy6EYU1@xps13> (raw)
In-Reply-To: <C37D651A908B024F974696C65296B57B0F2B03A9@SHSMSX101.ccr.corp.intel.com>

2014-09-30 14:38, Xie, Huawei:
> > -		if (++next >= MEMNIC_NR_PACKET)
> > +		if (unlikely(++next >= MEMNIC_NR_PACKET))
> 
> On IA,  compiler can use add, cmp and cmov to avoid branch.
> But If MEMNIC_NR_PACKET is always power of 2, 
> 	it is better just next = (next + 1) & (MEMNIC_NR_PACKET - 1)

Power of 2 is not enforced for MEMNIC_NR_PACKET.

-- 
Thomas

      reply	other threads:[~2014-09-30 14:44 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-30 11:14 Hiroshi Shimamoto
2014-09-30 13:39 ` Xie, Huawei
2014-10-01  0:01   ` Hiroshi Shimamoto
2014-10-01  6:12     ` Thomas Monjalon
2014-09-30 14:32 ` Neil Horman
2014-09-30 23:52   ` Hiroshi Shimamoto
2014-10-01  8:44     ` Bruce Richardson
2014-10-01  9:12       ` Hiroshi Shimamoto
2014-10-01 11:13         ` Neil Horman
2014-10-01 23:33           ` Hiroshi Shimamoto
2014-10-02  2:01             ` Neil Horman
2014-10-02  2:07               ` Hiroshi Shimamoto
2014-10-02  2:42                 ` Neil Horman
2014-10-01 11:09       ` Neil Horman
2014-09-30 14:38 ` Xie, Huawei
2014-09-30 14:51   ` Thomas Monjalon [this message]

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=5360316.uoHmy6EYU1@xps13 \
    --to=thomas.monjalon@6wind.com \
    --cc=dev@dpdk.org \
    --cc=h-momma@ce.jp.nec.com \
    --cc=huawei.xie@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).