From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id 21A082C2B; Fri, 5 Oct 2018 14:41:07 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga007.jf.intel.com ([10.7.209.58]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 05 Oct 2018 05:41:07 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.54,344,1534834800"; d="scan'208";a="78729310" Received: from fyigit-mobl.ger.corp.intel.com (HELO [10.237.221.49]) ([10.237.221.49]) by orsmga007.jf.intel.com with ESMTP; 05 Oct 2018 05:40:55 -0700 To: "Burakov, Anatoly" , Darek Stojaczyk , dev@dpdk.org Cc: wuzhouhui250@gmail.com, pawelx.wodkowski@intel.com, gowrishankar.m@linux.vnet.ibm.com, stable@dpdk.org References: <20181003123925.6343-1-dariusz.stojaczyk@intel.com> <45f61fc2-ee13-e342-6f4d-0178df40c94d@intel.com> From: Ferruh Yigit Openpgp: preference=signencrypt Message-ID: Date: Fri, 5 Oct 2018 13:40:55 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <45f61fc2-ee13-e342-6f4d-0178df40c94d@intel.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-stable] [dpdk-dev] [PATCH] eal/vfio: share the default container in multi process X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Oct 2018 12:41:08 -0000 On 10/5/2018 9:57 AM, Burakov, Anatoly wrote: > On 03-Oct-18 1:39 PM, Darek Stojaczyk wrote: >> So far each process in MP used to have a separate container >> and relied on the primary process to register all memsegs. >> >> Mapping external memory via rte_vfio_container_dma_map() >> in secondary processes was broken, because the default >> (process-local) container had no groups bound. There was >> even no way to bind any groups to it, because the container >> fd was deeply encapsulated within EAL. >> >> This patch introduces a new SOCKET_REQ_DEFAULT_CONTAINER >> message type for MP synchronization, makes all processes >> within a MP party use a single default container, and hence >> fixes rte_vfio_container_dma_map() for secondary processes. >> >> >From what I checked this behavior was always the same, but >> started to be invalid/insufficient once mapping external >> memory was allowed. >> >> Fixes: 73a639085938 ("vfio: allow to map other memory regions") >> Cc: anatoly.burakov@intel.com >> Cc: pawelx.wodkowski@intel.com >> Cc: gowrishankar.m@linux.vnet.ibm.com >> Cc: stable@dpdk.org >> >> While here, fix up the comment on rte_vfio_get_container_fd(). >> This function always opens a new container, never reuses >> an old one. >> >> Signed-off-by: Darek Stojaczyk >> --- > > > >> + if (internal_config.process_type == RTE_PROC_PRIMARY) { >> + /* if we were secondary process we would try requesting >> + * container fd from the primary, but we're the primary >> + * process so just exit here >> + */ >> + return -1; >> + } >> + >> + p->req = SOCKET_REQ_DEFAULT_CONTAINER; >> + strcpy(mp_req.name, EAL_VFIO_MP); > > strlcpy? even better, rte_strscpy? > > Otherwise, > Reviewed-by: Anatoly Burakov >