From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-la0-f46.google.com (mail-la0-f46.google.com [209.85.215.46]) by dpdk.org (Postfix) with ESMTP id 3DE2D594F for ; Tue, 10 Jun 2014 14:25:26 +0200 (CEST) Received: by mail-la0-f46.google.com with SMTP id hz20so3700371lab.5 for ; Tue, 10 Jun 2014 05:25:40 -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=wr53EeBE/hXRA/7vGew9Xt9xY2okojII5EwvO7ORZn4=; b=bU2VgHmDDmxzHFX9zv2cB5aALvb08zQA76ajQCCYbTZu5ZnCecWKCAbpAz+UAJQ/yk Vk6bMNzWBu0VWUuawJBPkEwrXBni59JUz/f6JqwpsRFiBRJdRvkS+l3Wp5aCvdozG7in lXtsEymGGF1njqw35h5Uu96R3imEcMnblugeN8VdLxaH2dSxN7jPapVscgL3HORdMEQw saTYz81ZDWG8eWLXkkMZEhwTEX81mi7ZJAF4zmYhJPyQQejYQNAqiQerA9OKhjtwIdLd czn3RkdIdBWUiwp9zWGftMSRUOQhIIKdAmpgQ7W5jFRWcuIr4Ny9R1Neko4g4TXi7m+C VFjg== MIME-Version: 1.0 X-Received: by 10.112.14.5 with SMTP id l5mr21262245lbc.12.1402403140202; Tue, 10 Jun 2014 05:25:40 -0700 (PDT) Received: by 10.152.23.170 with HTTP; Tue, 10 Jun 2014 05:25:40 -0700 (PDT) In-Reply-To: <20140610113521.GD6275@hmsreliant.think-freely.org> References: <20140610113521.GD6275@hmsreliant.think-freely.org> Date: Tue, 10 Jun 2014 17:55:40 +0530 Message-ID: From: Venkat Thummala To: Neil Horman 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: Tue, 10 Jun 2014 12:25:26 -0000 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 > >