From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by dpdk.org (Postfix) with ESMTP id 2F1CE2B88 for ; Fri, 23 Dec 2016 17:26:01 +0100 (CET) Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga104.jf.intel.com with ESMTP; 23 Dec 2016 08:25:58 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.33,393,1477983600"; d="scan'208";a="915582181" Received: from fyigit-mobl1.ger.corp.intel.com (HELO [10.237.220.29]) ([10.237.220.29]) by orsmga003.jf.intel.com with ESMTP; 23 Dec 2016 08:25:57 -0800 To: Alejandro Lucero , dev@dpdk.org References: <1482163983-19775-1-git-send-email-alejandro.lucero@netronome.com> From: Ferruh Yigit Message-ID: Date: Fri, 23 Dec 2016 16:25:56 +0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.5.1 MIME-Version: 1.0 In-Reply-To: <1482163983-19775-1-git-send-email-alejandro.lucero@netronome.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [PATCH] nfp: avoid modulo operations for handling ring wrapping 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: Fri, 23 Dec 2016 16:26:02 -0000 On 12/19/2016 4:13 PM, Alejandro Lucero wrote: > Having those modulo operations implies costly instructions execution, > what can be avoided with conditionals and unlikely clauses. > > This change makes the software ring read and write indexes to be now > always within the ring size which has to be handled properly. The main > problem is when write pointer wraps and being less than the read pointer. > This happened before, but just with indexes type size (uint32_t) wrapping, > and in that case the processor does the right thing no requiring special > hanling by software. > > This work has also led to discovering redundant pointers in the driver, > which have been removed. > > Signed-off-by: Alejandro Lucero Applied to dpdk-next-net/master, thanks.