From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp.tuxdriver.com (charlotte.tuxdriver.com [70.61.120.58]) by dpdk.org (Postfix) with ESMTP id 99E9A962F for ; Mon, 22 Dec 2014 18:47:20 +0100 (CET) Received: from hmsreliant.think-freely.org ([2001:470:8:a08:7aac:c0ff:fec2:933b] helo=localhost) by smtp.tuxdriver.com with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.63) (envelope-from ) id 1Y374Y-0007mj-Om; Mon, 22 Dec 2014 12:47:17 -0500 Date: Mon, 22 Dec 2014 12:47:09 -0500 From: Neil Horman To: Bruce Richardson Message-ID: <20141222174709.GE26669@hmsreliant.think-freely.org> References: <1419266844-4848-1-git-send-email-bruce.richardson@intel.com> <1698504.LDQKkGMxYZ@xps13> <20141222173306.GA11568@bricha3-MOBL3> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20141222173306.GA11568@bricha3-MOBL3> User-Agent: Mutt/1.5.23 (2014-03-12) X-Spam-Score: -2.9 (--) X-Spam-Status: No Cc: dev@dpdk.org Subject: Re: [dpdk-dev] [PATCH RFC 0/3] DPDK ethdev callback support 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: Mon, 22 Dec 2014 17:47:20 -0000 On Mon, Dec 22, 2014 at 05:33:07PM +0000, Bruce Richardson wrote: > On Mon, Dec 22, 2014 at 06:02:53PM +0100, Thomas Monjalon wrote: > > Hi Bruce, > > > > Callbacks, as hooks for applications, give more flexibility and are > > generally a good idea. > > In DPDK the main issue will be to avoid performance degradation. > > I see you use "unlikely" for callback branching. > > Could we reduce more the impact of this test by removing the queue array, > > i.e. having port-wide callbacks instead of per-queue callbacks? > > I can give that a try, but I don't see it making much difference if any. The > main thing to avoid with branching is branch mis-prediction, which should not > be a problem here, as the user is not going to be adding or removing callbacks > between each RX and TX call, making the branches highly predictable - i.e. always > go the same way. I was going to ask about exactly that. You say no one will be adding/removing callbacks between RX/TX calls, but you don't know that, people will try to do so at some point. You should add a check so that callbacks can only be registered/unregistered on stopped queues, otherwise this is extreemely racy. it won't impact performance to do so, and will save a good deal of debugging down the road at some point. Neil >