DPDK patches and discussions
 help / color / mirror / Atom feed
From: Dmitry Kozlyuk <dmitry.kozliuk@gmail.com>
To: Tyler Retzlaff <roretzla@linux.microsoft.com>
Cc: dev@dpdk.org, thomas@monjalon.net
Subject: Re: [dpdk-dev] RFC enabling dll/dso for dpdk on windows
Date: Mon, 19 Jul 2021 12:12:12 +0300	[thread overview]
Message-ID: <20210719121212.6d78b06c@sovereign> (raw)
In-Reply-To: <20210719034541.GA1949@linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net>

2021-07-18 20:45 (UTC-0700), Tyler Retzlaff:
> 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.

My mistake, I thought we exported __emutls.VARNAME symbols (in which case
MinGW DLLs would work without loader change). Since we don't, then you're
right, we have the same set of exported symbols and can enable this feature.
I'm willing to share the effort and help with MinGW.

> 
> >   
> > > > (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.

I think there are none left, unless you have some.
Waiting for you to post the actual code.


  reply	other threads:[~2021-07-19  9:12 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-08 19:21 Tyler Retzlaff
2021-07-08 20:39 ` Thomas Monjalon
2021-07-09  0:16   ` Tyler Retzlaff
2021-07-09 11:34     ` Thomas Monjalon
2021-07-09 16:09       ` Tyler Retzlaff
2021-07-08 20:49 ` Dmitry Kozlyuk
2021-07-09  1:03   ` Tyler Retzlaff
2021-07-16  9:40     ` Dmitry Kozlyuk
2021-07-19  3:45       ` Tyler Retzlaff
2021-07-19  9:12         ` Dmitry Kozlyuk [this message]
2021-07-19 16:51           ` Tyler Retzlaff

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210719121212.6d78b06c@sovereign \
    --to=dmitry.kozliuk@gmail.com \
    --cc=dev@dpdk.org \
    --cc=roretzla@linux.microsoft.com \
    --cc=thomas@monjalon.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).