From mboxrd@z Thu Jan 1 00:00:00 1970 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) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=Lht6MxetsJB3rek4msJkuaWqyrp1mmbl8J08ab6erWA=; b=dTGExFwu+neRd5lP5OW64NC6+PghgYQsNQzLKt3U2D1H6HAyNEhK28lPB3Qx3n2hu9 +UEdg86IU0KGbL938Tu2ZiqX5wKi3Ko+vClB0q2XSASh7LYjVRzTJSPs8RiWHYChcXVk iHaQ0jZkPuqnijf7boP1B/MxnBV19Khf5faDuA4SkaFX5IQp3LgsJCmFzn5LlErT8BR3 AEGzj1VFSMa/T9nrG4dCZcPhDye9GgoqL9ZIqoiKVqm6zElmGzOTqL7c6aw0W4yGl+pw AwFYyMHYSPjvJCG4CrzddHOlzdHAg54mor4/9NwYt+w2HLY924Au6Y9GTPZ70XyeE7eJ FK7Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=Lht6MxetsJB3rek4msJkuaWqyrp1mmbl8J08ab6erWA=; b=ZGUNOU5i8oGgQl4PpRjc8ZbVwSlohYGWIWf18ffMwwt/NdnyO69JbbghBDFCXhRAl1 LXZ24ksG5BcUou+KtFWtLEthHhvP5lMwgiGkW3nUNnci1s42d0nr3YZbC96zqnwmkn7K KPnoQBWFztglaFj3JzUoQ4+/3VovIsvw1M+kLivaf6ZbAraCPDXm3ObxPlHlVr2+mU2H aSbxMH3lM6u+znwCi8GmA0o5eSeMLzyXwYf4WgwZtLCOJMolKyyvgupjfU0qOl++5lYw S03OeUkoTmrCnPYj5xJse/x0cSzSU+xPfTG0cBnEwGuJNUL8nDkd/lmNipq+egPGNBEm IdQg== X-Gm-Message-State: AMCzsaVhEw5//cWhyw1mgFtmC6DE4K1Ac1CfHVlefF+KTcA9MSiRnE0J uyQiYM2YL5eVFCHAJxQEF9hA/Q== X-Google-Smtp-Source: ABhQp+QXtjQB53tOUjMqv40wdalh+CUnfyD2sUBvuV5qzlUZcqKRRpYIuUjVCjCydCN2nzVyHb0Luw== X-Received: by 10.28.180.2 with SMTP id d2mr1269505wmf.118.1509445030457; Tue, 31 Oct 2017 03:17:10 -0700 (PDT) Received: from 6wind.com (host.78.145.23.62.rev.coltfrance.com. [62.23.145.78]) by smtp.gmail.com with ESMTPSA id k9sm1209419wrk.88.2017.10.31.03.17.09 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 31 Oct 2017 03:17:09 -0700 (PDT) Date: Tue, 31 Oct 2017 11:16:58 +0100 From: Adrien Mazarguil To: Matan Azrad Cc: "dev@dpdk.org" , Ophir Munk 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 Content-Disposition: inline In-Reply-To: Subject: Re: [dpdk-dev] [PATCH v3 1/7] net/mlx4: remove error flows from Tx fast path 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: Tue, 31 Oct 2017 10:17:11 -0000 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