From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wi0-f178.google.com (mail-wi0-f178.google.com [209.85.212.178]) by dpdk.org (Postfix) with ESMTP id 56821B0AE for ; Wed, 11 Jun 2014 07:23:20 +0200 (CEST) Received: by mail-wi0-f178.google.com with SMTP id n15so365269wiw.17 for ; Tue, 10 Jun 2014 22:23:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=h0GHq1PrXNGymy70JiKD0ZNXHBsc4/xazG6+n+S6DOo=; b=j1nJYiOWSWwHdY1EWLXvDC7bx5VN8LbNTT+n+KHBYEbxXMjVb4VRSLSLEWTab1ALQA oKS8ebVVnsCp7bjCH+e9jnZ13rprc6sUPJv4h3R1wqzVD4o4pvEmg1P497Ozk9+TYUQl 3OztAt5wVePO5+XyMTpsDx6p66VmfUo69noMnvzKShSrkijDFQeYGoOPhOU1NsZLHVP/ VV5GSKpnJipafD+AJgZI8mDMnTU0JQYvF5/ntwuinI9o/Ec/J/dpEOk9Vy0Zx72ad7J7 BrL0V/QGNor5qp7Kh73IgbkG/HA7kuwXk6tYX03rM2tLojSKkPas1h/M4Yrh20jXjwfB blIA== MIME-Version: 1.0 X-Received: by 10.180.182.115 with SMTP id ed19mr35038904wic.29.1402464214746; Tue, 10 Jun 2014 22:23:34 -0700 (PDT) Received: by 10.194.240.42 with HTTP; Tue, 10 Jun 2014 22:23:34 -0700 (PDT) In-Reply-To: References: <20140610113521.GD6275@hmsreliant.think-freely.org> Date: Wed, 11 Jun 2014 08:23:34 +0300 Message-ID: From: Helmut Sim To: Venkat Thummala Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.15 Cc: dev@dpdk.org Subject: Re: [dpdk-dev] using hash table in a MP environment 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: Wed, 11 Jun 2014 05:23:20 -0000 one more simple way would be to assign the desired hash function to the hash_func in the rte_hash structure returned by rte_hash_find_existing call at the secondary initialization phase. that way there is no difference between a primary or a secondary process. Regards, On Tue, Jun 10, 2014 at 3:25 PM, Venkat Thummala < venkat.thummala.1978@gmail.com> wrote: > Hi Shirley, > > Please refer the section 20.3 [Multi-Process Limitations] in DPDK > Programmers Guide. > > The use of function pointers between multiple processes running based of > different > compiled binaries is not supported, since the location of a given function > in one > process may be different to its location in a second. This prevents the > librte_hash library from behaving properly as in a multi-threaded instance, > since it uses a pointer to the hash function internally. > To work around this issue, it is recommended that multi-process > applications > perform the hash calculations by directly calling the hashing function from > the code > and then using the rte_hash_add_with_hash()/ > rte_hash_lookup_with_hash() functions instead of the functions which do the > hashing internally, such as rte_hash_add()/rte_hash_lookup() > > Thanks > Venkat > > > On 10 June 2014 17:05, Neil Horman wrote: > > > On Tue, Jun 10, 2014 at 11:02:03AM +0300, Uri Sidler wrote: > > > Hi, > > > I am currently using a hash table in a multi-process environment. > > > the master process creates the hash table which is later used by other > > > secondary processes. > > > but the secondary processes fail to use the hash table since the hash > > > function address actually points to a different fucntion. (this makes > > sense > > > since the address of the hash function is in fact different per > process). > > > How can I solve this issue? > > > > > > Thanks, > > > Shirley. > > > > > > > Use shared memory. see shmget > > > > Neil > > > > >