From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 3D4EBA0C45; Mon, 19 Jul 2021 05:45:44 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id AF42A4069D; Mon, 19 Jul 2021 05:45:43 +0200 (CEST) Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by mails.dpdk.org (Postfix) with ESMTP id 23E654067A for ; Mon, 19 Jul 2021 05:45:42 +0200 (CEST) Received: by linux.microsoft.com (Postfix, from userid 1086) id 6D9E320B7178; Sun, 18 Jul 2021 20:45:41 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 6D9E320B7178 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1626666341; bh=KNRBv1OGtBdn3j1qbwHFHKr5AJ9Dp8uWJtq4KNefsi8=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=WuEq72VFmshRPlBS/I6xULKQeSzmuXopubkwfzLDfIBaP/I0M1fJa4zHIiE59BQjA rWbf+t4hdJ9xO0boYW4oMPfhCwuq1UeDbtSb7v2Unii4dQApUPvkk2Dlw9JTQ5rfNJ Y+ypfhkvbSusuV3Rzi+gHkEpoCEdnmo/Ld6wX2hQ= Date: Sun, 18 Jul 2021 20:45:41 -0700 From: Tyler Retzlaff To: Dmitry Kozlyuk Cc: dev@dpdk.org, thomas@monjalon.net Message-ID: <20210719034541.GA1949@linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net> References: <20210708192109.GA13966@linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net> <20210708234953.67906871@sovereign> <20210709010319.GB23346@linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net> <20210716124035.51741861@sovereign> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210716124035.51741861@sovereign> User-Agent: Mutt/1.5.21 (2010-09-15) Subject: Re: [dpdk-dev] RFC enabling dll/dso for dpdk on windows X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On Fri, Jul 16, 2021 at 12:40:35PM +0300, Dmitry Kozlyuk wrote: > 2021-07-08 18:03 (UTC-0700), Tyler Retzlaff: > > On Thu, Jul 08, 2021 at 11:49:53PM +0300, Dmitry Kozlyuk wrote: > > > Hi Tyler, > > > > > > 2021-07-08 12:21 (UTC-0700), Tyler Retzlaff: > > > > hi folks, > > > > > > > > we would like to submit a a patch series that makes dll/dso for dpdk > > > > work on windows. there are two differences in the windows platform that > > > > would need to be address through enhancements to dpdk. > > > > > > > > (1) windows dynamic objects don't export sufficient information for > > > > tls variables and the windows loader and runtime would need to be > > > > enhanced in order to perform runtime linking. [1][2] > > > > > > When will the new loader be available? > > > > the solution i have prototyped does not directly export the tls variables > > and instead relies on exports of tls offsets within a module. no loader > > change or new os is required. > > > > > Will it be ported to Server 2019? > > > > not necessary (as per above) > > > > > Will this functionality require compiler support > > > > the prototype was developed using windows clang, mingw code compiles but > > i did not try to run it. i suspect it is okay though haven't examine any > > side-effects when using emul tls like mingw does. anyway mingw dll's > > don't work now and it probably shouldn't block them being available with > > clang. > > AFAIK it's the opposite. MinGW can handle TLS varibale export from DLL, > although with "__emutls." prefix and some performance penalty. > Clang can't at all, despite compiling and linking without an issue. mingw emutls just makes it compile allowing the variables to be exported, the binaries still won't work without loader support. or are you saying they do? > > No, it is not acceptable to add a generic feature supported by only one > compiler. (FWIW, I'm displeased even by mlx5 being tied to clang.) > Particularly, I don't understand how could MinGW and clang coexist > if they export different sets of symbols. Apps will need to know > if it's MingW- or clang-compiled DPDK? Sounds messy. it doesn't seem reasonable to reject the feature because mingw may or may not work. mingw binaries are not worse off if the feature can be enabled with clang. either way it is untested i am uncertain if it will work with mingw and have no time budget to test it. if it made mingw built binaries "worse" i would agree with you but the worst case scenario is that it works exactly as well as it does now. > > > > (you mention that accessing such variables will be "non-trivial")? > > > > the solution involves exporting offsets that then allow explicit tls > > accesses relative to the gs segment. it's non-trivial in the sense that > > none of the normal explicit tls functions in windows are used and the > > compiler doesn't generate the code for implicit tls access. the overhead > > is relatively tolerable (one or two additional dereferences). > > A thorough benchmark will be required. I'm afraid that inline assembly > (which %gs mention suggests) can impact optimization of the code nearby. > Ideally it should be a DPDK performance autotest. no inline assembly is used, only compiler intrinsics which is superior because it allows the compiler an opportunity to perform optimization which inline assembly does not. whether or not clang or mingw will optimize i have no idea. this is aside from the expected additional code generated for cross dll boundary accesses. let's catch up at the sync and discuss your concerns.