From mboxrd@z Thu Jan 1 00:00:00 1970 From: Adrien Mazarguil Subject: Re: [PATCH v3 1/7] net/mlx4: remove error flows from Tx fast path Date: Tue, 31 Oct 2017 11:16:58 +0100 Message-ID: <20171031101658.GJ26782@6wind.com> References: <1508768520-4810-1-git-send-email-ophirmu@mellanox.com> <1509358049-18854-1-git-send-email-matan@mellanox.com> <1509358049-18854-2-git-send-email-matan@mellanox.com> <20171030142314.GX26782@6wind.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: "dev@dpdk.org" , Ophir Munk To: Matan Azrad Return-path: Received: from mail-wm0-f44.google.com (mail-wm0-f44.google.com [74.125.82.44]) by dpdk.org (Postfix) with ESMTP id DDA381B26C for ; Tue, 31 Oct 2017 11:17:10 +0100 (CET) Received: by mail-wm0-f44.google.com with SMTP id r196so21380515wmf.2 for ; Tue, 31 Oct 2017 03:17:10 -0700 (PDT) Content-Disposition: inline In-Reply-To: List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Hi Matan, On Mon, Oct 30, 2017 at 06:11:31PM +0000, Matan Azrad wrote: > Hi Adrien > > > -----Original Message----- > > From: Adrien Mazarguil [mailto:adrien.mazarguil@6wind.com] > > Sent: Monday, October 30, 2017 4:23 PM > > To: Matan Azrad > > Cc: dev@dpdk.org; Ophir Munk > > Subject: Re: [PATCH v3 1/7] net/mlx4: remove error flows from Tx fast path > > > > On Mon, Oct 30, 2017 at 10:07:23AM +0000, Matan Azrad wrote: > > > Move unnecessary error flows to DEBUG mode. > > > > > > Signed-off-by: Matan Azrad > > > Acked-by: Adrien Mazarguil > > > > I missed a couple of details while reviewing the original version, the first one > > being mlx4_post_send()'s return value is still documented as updating > > rte_errno in case of error, it's not the case anymore after this patch. > > > Good attention, Will be fixed in next version. > > > Please see below for the other one: > > > > > --- > > > drivers/net/mlx4/mlx4_rxtx.c | 16 ++++++---------- > > > 1 file changed, 6 insertions(+), 10 deletions(-) > > > > > > diff --git a/drivers/net/mlx4/mlx4_rxtx.c > > > b/drivers/net/mlx4/mlx4_rxtx.c > > > > > /** > > > @@ -510,8 +508,6 @@ struct pv { > > > assert(max <= elts_n); > > > /* Always leave one free entry in the ring. */ > > > --max; > > > - if (max == 0) > > > - return 0; > > > if (max > pkts_n) > > > max = pkts_n; > > > for (i = 0; (i != max); ++i) { > > > > While minor, this change has nothing to do with this patch, right? > > > Yes you right, maybe it can be merged in patch 4/7. > > > I think it can slightly degrade an application performance as it removes the > > guarantee that subsequent code only needs to be run if there is at least one > > packet to process in case the TX ring is constantly full (SW faster than HW). > > > > In case the TX ring is full, the loop condition should fail in the start and then return with 0 because the packet counter is 0.(more 2 checks) > Since this case are less common (in my opinion) than at least 1 free space in ring, we can prevent this unnecessary check for all these common cases. > > Are you sure the 2 extra check important for performance in this empty case? Doesn't the application will call us again? No, I don't think they're important to performance, like the changes from patch 4/7, I'm not certain they actually make any difference. My suggestion was mainly to leave it alone because of that. It's OK if you want to keep and move it to 4/7. -- Adrien Mazarguil 6WIND