From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wi0-f170.google.com (mail-wi0-f170.google.com [209.85.212.170]) by dpdk.org (Postfix) with ESMTP id 0F500678B for ; Tue, 30 Sep 2014 16:44:41 +0200 (CEST) Received: by mail-wi0-f170.google.com with SMTP id hi2so25369wib.1 for ; Tue, 30 Sep 2014 07:51:22 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:organization :user-agent:in-reply-to:references:mime-version :content-transfer-encoding:content-type; bh=iyJI8olg27HLEzK1KyfhO8taLb60SOHgPDeAJqfJYiw=; b=f1/QAOi6MdhNJsO00s5x3MvhMpzAqH/OJeWAfzXdvov9hpM24WvTC3HbuIwy6f0gCh vNG5ZHpWygL4KoLEQgmUQL2gG3ykUpUi6PC2on4XcqfV8evB98Th0YR4IgEd+vukrj6S 5ydROh0OuWdqkk+5J6Q2CMU82pePFX3gIgTUyKrDZPDxc4MdNaA2vrWg6JSb+9C9G1Y3 0GtmttZ/lEjB1U5OA350jecx/N4dhWhc0oFQtBZsc1vRxxCyVv7eSAJSZ2m5LdNy+Jme tmH7XVszjnl2U+Tc3tVIJgrCRtgwU9oQFSKnBg+B/WchBEyz/w8bxG96Bg6wjLYl/hQS drkQ== X-Gm-Message-State: ALoCoQknX+2USqUls96GbDwEX8GWCb+nkGOwo9A0NTticvSmfUmMdkW0udFTxyxuKSfXZECfpbvf X-Received: by 10.180.97.199 with SMTP id ec7mr6474093wib.29.1412088681982; Tue, 30 Sep 2014 07:51:21 -0700 (PDT) Received: from xps13.localnet (guy78-3-82-239-227-177.fbx.proxad.net. [82.239.227.177]) by mx.google.com with ESMTPSA id cy1sm9656965wjc.20.2014.09.30.07.51.20 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 30 Sep 2014 07:51:21 -0700 (PDT) From: Thomas Monjalon To: "Xie, Huawei" Date: Tue, 30 Sep 2014 16:51:10 +0200 Message-ID: <5360316.uoHmy6EYU1@xps13> Organization: 6WIND User-Agent: KMail/4.13.3 (Linux/3.15.8-1-ARCH; KDE/4.13.3; x86_64; ; ) In-Reply-To: References: <7F861DC0615E0C47A872E6F3C5FCDDBD02AE26C5@BPXM14GP.gisp.nec.co.jp> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Cc: dev@dpdk.org, Hayato Momma Subject: Re: [dpdk-dev] [memnic PATCH v2 6/7] pmd: add branch hint in recv/xmit X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Sep 2014 14:44:41 -0000 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