From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f47.google.com (mail-wm0-f47.google.com [74.125.82.47]) by dpdk.org (Postfix) with ESMTP id 5754F4CE4 for ; Fri, 25 Mar 2016 11:55:49 +0100 (CET) Received: by mail-wm0-f47.google.com with SMTP id l68so19050769wml.1 for ; Fri, 25 Mar 2016 03:55:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind-com.20150623.gappssmtp.com; s=20150623; h=subject:to:references:cc:from:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding; bh=mTRhQcb0w7Jbiert2lfKlC6lzUdJntfDNf70QQORfrc=; b=ORI945AwGPxGewU74caBdk8ykh82e5FWAx14BiNJq91ESw5hpmHyf20WobJQK429Pb T6oIRWSbRi91jpunwm9ASgjvF9clG3nLIKLt9p5RGooURaUHYKZQ3cAU80hdWw5SKgqh O12s4+V89HJAwHOjCqy+HhZKU8bs6L1Q89VPm8JX0fhUBW4tN5Tjg7axgRKMMbWp34XQ wBbFzQo7P9XmYDvPvU5xd3dAerBZPXJDhGjkQ3XJWyro+ZUKETPCv0HG/WKj3PDQzxBO V/wvi7JWudeyd6Cn8GsZaY+FQ95QHZIraPZtTsLFWDv73l/jsCxD7gPagi7KpAZoQUzh NtHw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:cc:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=mTRhQcb0w7Jbiert2lfKlC6lzUdJntfDNf70QQORfrc=; b=M4SUm+L47r1PrttEDtookM7PlcKtPr8zcyozZjNXUc0cNMIlrL/WsEMIVzF93f+FVG GeUT8pbMRzLOTy9nZAVdnqF4mWqdB/CyXJOT8ewTJgafsBs+9/WbRbwD/HYTyXpdUT4F pccwQBIu2dJf3CnlBT+LwWtYHDZrku7Cs0rCyzZljxhHutqgRw+0M7Pvpq2XFokLjXFC fQE+NwIVNVTk2X8kw1i8UeI6E3Xwcs2+gxMmyEeaqrzg5vW+SnZ9AiWG/sPhXM642BpI lIaXgEEkoXl5c0zO5mOqrM1E+9NZ7y8Ye1hrIMwuJv0a8+dJS/XiGpU0rMrJc3qQaiJZ CXHg== X-Gm-Message-State: AD7BkJKiH0pf2aiSYRx2kQThGAZ70mMY859R2mf+4JRY7UGwAdsmshASg3SsvkywXPCxDSMl X-Received: by 10.28.127.144 with SMTP id a138mr14437109wmd.25.1458903349220; Fri, 25 Mar 2016 03:55:49 -0700 (PDT) Received: from [192.168.0.10] (was59-1-82-226-113-214.fbx.proxad.net. [82.226.113.214]) by smtp.gmail.com with ESMTPSA id t82sm2606006wmt.17.2016.03.25.03.55.48 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 25 Mar 2016 03:55:48 -0700 (PDT) To: "Venkatesan, Venky" , Lazaros Koromilas , "Wiles, Keith" References: <1457621082-22151-1-git-send-email-l@nofutznetworks.com> <56EFE781.4090809@6wind.com> <1FFBBED4-00F5-4703-BDEC-961EB800C21B@intel.com> <1FD9B82B8BF2CF418D9A1000154491D97EC94508@ORSMSX102.amr.corp.intel.com> Cc: "dev@dpdk.org" From: Olivier Matz X-Enigmail-Draft-Status: N1110 Message-ID: <56F51932.3060500@6wind.com> Date: Fri, 25 Mar 2016 11:55:46 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Icedove/38.6.0 MIME-Version: 1.0 In-Reply-To: <1FD9B82B8BF2CF418D9A1000154491D97EC94508@ORSMSX102.amr.corp.intel.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [PATCH] mempool: allow for user-owned mempool caches 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, 25 Mar 2016 10:55:49 -0000 Hi Venky, >> The main benefit of having an external cache is to allow mempool users >> (threads) to maintain a local cache even though they don't have a valid >> lcore_id (non-EAL threads). The fact that cache access is done by indexing >> with the lcore_id is what makes it difficult... > > Hi Lazaros, > > Alternative suggestion: This could actually be very simply done via creating an EAL API to register and return an lcore_id for a thread wanting to use DPDK services. That way, you could simply create your pthread, call the eal_register_thread() function that assigns an lcore_id to the caller (and internally sets up the per_lcore variable. > > The advantage of doing it this way is that you could extend it to other things other than the mempool that may need an lcore_id setup. >>From my opinion, externalize the cache structure as Lazaros suggests would make things simpler, especially in case of dynamic threads allocation/destruction. If a lcore_id regristration API is added in EAL, we still need a max lcore value when the mempool is created so the cache can be allocated. Moreover, the API would not be as simple, especially if it needs to support secondary processes. Regards, Olivier