DPDK patches and discussions
 help / color / mirror / Atom feed
From: Nick Connolly <nick.connolly@mayadata.io>
To: Khoa To <khot@microsoft.com>, "dev@dpdk.org" <dev@dpdk.org>
Subject: Re: [dpdk-dev] [EXTERNAL]  [RFC] pthread on Windows
Date: Mon, 2 Nov 2020 11:17:11 +0000	[thread overview]
Message-ID: <c4396b14-f904-f0dc-ce01-85b5f6008960@mayadata.io> (raw)
In-Reply-To: <BY5PR21MB13803DC0634553E5DCB5BC09D9140@BY5PR21MB1380.namprd21.prod.outlook.com>

Hi Khoa,

On 29/10/2020 21:19, Khoa To wrote:
>> -----Original Message-----
>> From: dev <dev-bounces@dpdk.org> On Behalf Of Nick Connolly
>> Sent: Monday, October 19, 2020 2:59 AM
>> To: dev@dpdk.org
>> Subject: [EXTERNAL] [dpdk-dev] [RFC] pthread on Windows
>>
>>
>> The proposed changes are:
>>
>>   1. An EAL implementation of pthread with a new rte_pthread API.
>>   2. The DPDK code (libs, examples, drivers, apps, tests, etc) needs to
>>      be modified to use the new rte_pthread API.
>>   3. There needs to be an option for apps to use an external pthread
>>      library as an alternative to the EAL implementation.
>>   4. Eventually, apps can opt in to using the rte_pthread API if desired.
>>
>> Item #3 isn't dependent on #1 and #2 - it can be implemented now,
>> allowing forward progress to be made without blocking on #1 and #2 which
>> may take longer to resolve.
>>
>>
> One concern I have with starting on #3 first is that with this patch, we make pthread semantics mandatory for DPDK core. When new code which references pthread API is later added to DPDK core, and that functionality doesn’t yet have a Windows emulation in EAL, DPDK core may take the dependency on a certain pthread semantics that (a) not implemented before, and (b) is hard to emulate.
>
> That could represent a problem later, when we introduce the “EAL threads” API layer with a more loose semantics (which can be backed by either external pthread library, or by emulation on Windows).
>
> Given that a compile flag is not part of any patch submission that introduces such new pthread dependency, how do we detect this problem during said submission?
>
> Do we know if there is a test or submit requirements which ensures that DPDK compiles on all platforms/environments (including this flag to use external pthread library) to catch new pthread dependencies, prior to accepting any new patch?
>
> Khoa.

I think we are ok here ... the patch doesn't change any dependencies, or 
make pthreads semantics mandatory for DPDK core. Any changes to DPDK 
core will be built and tested against the Windows EAL in exactly the 
same way as currently and the same standards of correctness apply.  Any 
enhancements needed by the DPDK core will need to go into the Windows 
EAL as currently.  All that the patch does is provide the flexibility to 
use an external library to provide part of the functionality of the EAL 
if the environment requires it (for example to fit with the 
application's threading model).

So, why bother with the #3 patch now instead of waiting for #1 and #2?  
Well, based on my experience getting the SPDK running on Windows, I 
suspect it will be some time before #1 and #2 are done. There's nothing 
inherently difficult, but there are a number of details to work through 
and reach agreement about.

The patch provides a way of maintaining progress on Windows whilst #1 
and #2 are figured out, for example by making it easy for Datapath to 
use the pthreads4w library in their environment.

Regards,
Nick

  reply	other threads:[~2020-11-02 11:17 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-19  9:59 [dpdk-dev] " Nick Connolly
2020-10-29 21:19 ` [dpdk-dev] [EXTERNAL] " Khoa To
2020-11-02 11:17   ` Nick Connolly [this message]
2020-11-03 22:34     ` Khoa To
2020-11-11 15:24       ` Nick Connolly

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=c4396b14-f904-f0dc-ce01-85b5f6008960@mayadata.io \
    --to=nick.connolly@mayadata.io \
    --cc=dev@dpdk.org \
    --cc=khot@microsoft.com \
    /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).