From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by dpdk.org (Postfix) with ESMTP id CE7F729D6 for ; Thu, 25 Jan 2018 13:22:35 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 25 Jan 2018 04:22:34 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.46,412,1511856000"; d="scan'208";a="198567363" Received: from irsmsx152.ger.corp.intel.com ([163.33.192.66]) by fmsmga005.fm.intel.com with ESMTP; 25 Jan 2018 04:22:33 -0800 Received: from irsmsx105.ger.corp.intel.com ([169.254.7.236]) by IRSMSX152.ger.corp.intel.com ([169.254.6.87]) with mapi id 14.03.0319.002; Thu, 25 Jan 2018 12:22:33 +0000 From: "Ananyev, Konstantin" To: "Tan, Jianfeng" , "dev@dpdk.org" CC: "Burakov, Anatoly" , "Richardson, Bruce" , "thomas@monjalon.net" Thread-Topic: [PATCH v3 2/3] eal: add synchronous multi-process communication Thread-Index: AQHTlZMKKt1DyGncUkKAJV30FjW936OEgwaQ Date: Thu, 25 Jan 2018 12:22:32 +0000 Message-ID: <2601191342CEEE43887BDE71AB977258862836C5@irsmsx105.ger.corp.intel.com> References: <1512067450-59203-1-git-send-email-jianfeng.tan@intel.com> <1516853783-108023-1-git-send-email-jianfeng.tan@intel.com> <1516853783-108023-3-git-send-email-jianfeng.tan@intel.com> In-Reply-To: <1516853783-108023-3-git-send-email-jianfeng.tan@intel.com> Accept-Language: en-IE, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiNTgwYTIwYmYtMGM0OS00ZTQwLTkxODctYWUzM2RkYjNhOTRkIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE2LjUuOS4zIiwiVHJ1c3RlZExhYmVsSGFzaCI6InNCZENcLzR0SzZwaFZjNFlKbGNrdzFyYWVsYUUyRHZ6M3RJUm5ISkVxN1dFPSJ9 x-ctpclassification: CTP_NT dlp-product: dlpe-windows dlp-version: 11.0.0.116 dlp-reaction: no-action x-originating-ip: [163.33.239.181] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH v3 2/3] 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: Thu, 25 Jan 2018 12:22:36 -0000 > 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. >=20 > 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. >=20 > 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. >=20 > sender-process receiver-process > ---------------------- ---------------- >=20 > 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 >=20 > * A secondary process is only allowed to talk to the primary process. > * If there are multiple secondary processes for the primary proces, > it will send request to peer1, collect response from peer1; then > send request to peer2, collect reponse 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. >=20 > Suggested-by: Anatoly Burakov > Suggested-by: Konstantin Ananyev > Signed-off-by: Jianfeng Tan > --- Acked-by: Konstantin Ananyev