From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ferruh Yigit Subject: Re: [PATCH] nfp: avoid modulo operations for handling ring wrapping Date: Fri, 23 Dec 2016 16:25:56 +0000 Message-ID: References: <1482163983-19775-1-git-send-email-alejandro.lucero@netronome.com> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit To: Alejandro Lucero , dev@dpdk.org 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) In-Reply-To: <1482163983-19775-1-git-send-email-alejandro.lucero@netronome.com> List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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.