From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.mhcomputing.net (master.mhcomputing.net [74.208.228.170]) by dpdk.org (Postfix) with ESMTP id 7C5ED591F for ; Tue, 3 Nov 2015 01:21:18 +0100 (CET) Received: by mail.mhcomputing.net (Postfix, from userid 1000) id E90AB3E2; Mon, 2 Nov 2015 19:21:17 -0500 (EST) Date: Mon, 2 Nov 2015 19:21:17 -0500 From: Matthew Hall To: Thomas Monjalon Message-ID: <20151103002117.GA3665@mhcomputing.net> References: <2014794.RrzFoKiHXW@xps13> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <2014794.RrzFoKiHXW@xps13> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: dev@dpdk.org Subject: Re: [dpdk-dev] Reshuffling of rte_mbuf structure. 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: Tue, 03 Nov 2015 00:21:18 -0000 On Mon, Nov 02, 2015 at 11:51:23PM +0100, Thomas Monjalon wrote: > But it is simpler to say that having an API depending of some options > is a "no-design" which could seriously slow down the DPDK adoption. What about something similar to how Java JNI works? It needed to support multiple Java JRE / JDK brands, implementations etc. Upon initialization, a function pointer array is created, and specific slots are filled with pointers to the real implementation of some native API functions you can call from inside your library to perform operations. In the DPDK case, we need flexible data instead of flexible function implementations. To do this there would be some pointer slots in the mbuf that are are filled with pointers to metadata for required DPDK features. The data could be placed in the following cachelines, using some reserved tailroom between the mbuf control block and the packet data block. Then the prefetch could be set up to prefetch only the used parts of the tailroom at any given point, to prevent unwanted slowdowns. Matthew.