From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wi0-f177.google.com (mail-wi0-f177.google.com [209.85.212.177]) by dpdk.org (Postfix) with ESMTP id A0B245A59 for ; Fri, 3 Jul 2015 12:03:47 +0200 (CEST) Received: by wibdq8 with SMTP id dq8so95909669wib.1 for ; Fri, 03 Jul 2015 03:03:47 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:organization :user-agent:in-reply-to:references:mime-version :content-transfer-encoding:content-type; bh=18jqpKqY4MECH+68vv1nMploOFJ9DvUcKZ1EW/8+hD4=; b=VmMDv21QFO9g8Iwn430abwlJZXZ4BwZiBpD65Ot0r1vjwF9/zE/FOHFxOHGwrhwIDR 8zryXQUVpBLt5hOfEM42SWPNAOdakIyVyYyV2dxHC3CCiF40HmiNVz7nmmLrEsxlKbXw 2qww6jRKN1rN4rH+KHUW+WMDI+vXUFK1KCh6GLjhKZkMt2OqR8A2F9FDlUfedKjGxTzD iIf+YzVg07ofrlk3TkHGkpX4Itj2DXjsFpFIYWlT4n3drZ0SUrrh0mjlL1JFQ85aA5dO cipV4vGku1L3HbYRlsUbjJ/Sr8eUjmgZl4aWC6F67ohddWJZO/Ddo+MXl1xmY37xIwBL Y8TA== X-Gm-Message-State: ALoCoQmnpeamtNT1j6y98w0+5KnhqtCwCvhtiAnYJESzB10HS+Q2zScbjfDTrBQVfJYxk1dXOU7s X-Received: by 10.194.89.225 with SMTP id br1mr68496041wjb.97.1435917827499; Fri, 03 Jul 2015 03:03:47 -0700 (PDT) Received: from xps13.localnet (136-92-190-109.dsl.ovh.fr. [109.190.92.136]) by smtp.gmail.com with ESMTPSA id k5sm4570033wij.1.2015.07.03.03.03.45 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 03 Jul 2015 03:03:46 -0700 (PDT) From: Thomas Monjalon To: Bruce Richardson , "Sanford, Robert" Date: Fri, 03 Jul 2015 12:02:38 +0200 Message-ID: <3335065.GmhAzHV8Zp@xps13> Organization: 6WIND User-Agent: KMail/4.14.8 (Linux/4.0.4-2-ARCH; KDE/4.14.8; x86_64; ; ) In-Reply-To: <20150703095741.GC7548@bricha3-MOBL3> References: <20150703095741.GC7548@bricha3-MOBL3> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Cc: dev@dpdk.org Subject: Re: [dpdk-dev] Ethernet API - multiple post-RX-burst callbacks' run-order is opposite to their add-order 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: Fri, 03 Jul 2015 10:03:47 -0000 2015-07-03 10:57, Bruce Richardson: > On Thu, Jul 02, 2015 at 09:04:48PM +0000, Sanford, Robert wrote: > > When one adds multiple post-RX-burst callbacks to a queue, their execution order is the opposite of the order in which they are added. For example, we add callback A( ), and then we add callback B( ). When we call rte_eth_rx_burst, after invoking the device's rx_pkt_burst function, it will invoke B( ), and then A( ). The same goes for pre-TX-burst callbacks, too. > > > > This is counter-intuitive. Shouldn't we either execute the callbacks in the same order that we add them (by changing the internals of the add-APIs), or change the add-APIs to allow one to specify whether a callback is added to the head or tail of the callback list? At the least, we could document the expected behavior. > > Any thoughts on this? > > > Makes sense. I would agree that having the callbacks called in order of addition > makes more sense. > Having the order configurable might be useful, but would require an API change, > so I'd only look to change that if it really proves necessary. If the callback > order is consistent and behaves logically (i.e. order of call == order of add), > can the app not ensure the callbacks are added in the correct order? +1 to improve behaviour without changing the API. If the applications can manage with a simple DPDK API, it's better for everyone.