From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by dpdk.org (Postfix) with ESMTP id 2C2661B666 for ; Fri, 26 Jan 2018 11:31:44 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 26 Jan 2018 02:31:43 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.46,415,1511856000"; d="scan'208";a="25634919" Received: from aburakov-mobl.ger.corp.intel.com (HELO [10.237.220.145]) ([10.237.220.145]) by fmsmga001.fm.intel.com with ESMTP; 26 Jan 2018 02:31:41 -0800 To: Jianfeng Tan , dev@dpdk.org Cc: bruce.richardson@intel.com, konstantin.ananyev@intel.com, thomas@monjalon.net References: <1512067450-59203-1-git-send-email-jianfeng.tan@intel.com> <1516938082-27852-1-git-send-email-jianfeng.tan@intel.com> <1516938082-27852-3-git-send-email-jianfeng.tan@intel.com> From: "Burakov, Anatoly" Message-ID: Date: Fri, 26 Jan 2018 10:31:40 +0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.5.2 MIME-Version: 1.0 In-Reply-To: <1516938082-27852-3-git-send-email-jianfeng.tan@intel.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [PATCH v6 2/2] eal: add synchronous multi-process communication X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Jan 2018 10:31:44 -0000 On 26-Jan-18 3:41 AM, Jianfeng Tan wrote: > We need the synchronous way for multi-process communication, > i.e., blockingly waiting for reply message when we send a request > to the peer process. > > We add two APIs rte_eal_mp_request() and rte_eal_mp_reply() for > such use case. By invoking rte_eal_mp_request(), a request message > is sent out, and then it waits there for a reply message. The caller > can specify the timeout. And the response messages will be collected > and returned so that the caller can decide how to translate them. > > The API rte_eal_mp_reply() is always called by an mp action handler. > Here we add another parameter for rte_eal_mp_t so that the action > handler knows which peer address to reply. > > sender-process receiver-process > ---------------------- ---------------- > > thread-n > |_rte_eal_mp_request() ----------> mp-thread > |_timedwait() |_process_msg() > |_action() > |_rte_eal_mp_reply() > mp_thread <---------------------| > |_process_msg() > |_signal(send_thread) > thread-m <----------| > |_collect-reply > > * A secondary process is only allowed to talk to the primary process. > * If there are multiple secondary processes for the primary process, > it will send request to peer1, collect response from peer1; then > send request to peer2, collect response from peer2, and so on. > * When thread-n is sending request, thread-m of that process can send > request at the same time. > * For pair , we guarantee that only one such request > is on the fly. > > Suggested-by: Anatoly Burakov > Suggested-by: Konstantin Ananyev > Signed-off-by: Jianfeng Tan > Reviewed-by: Anatoly Burakov > Acked-by: Konstantin Ananyev > --- No further comments from me :) -- Thanks, Anatoly