From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id EB49CA0350; Tue, 23 Jun 2020 14:49:22 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 6C5711D647; Tue, 23 Jun 2020 14:49:22 +0200 (CEST) Received: from us-smtp-delivery-1.mimecast.com (us-smtp-2.mimecast.com [205.139.110.61]) by dpdk.org (Postfix) with ESMTP id 043AD1D63E for ; Tue, 23 Jun 2020 14:49:20 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1592916560; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=JkI5ya1bwFD1DARK7H9UAVcQpC3Issp2U8tKZ/sUwps=; b=ItvyVRBDJgJFKdGX0+eOIzI9IB2sR/QekbLovPmTGnWFEgx2W7q6QjQrZBscm02TvuOpoA uRvw9RhLwykISfc+jdZSN5t1Y+9axwA5qbTHJN54qFL6mCT9eAHCeH4+uCN2jymPk5/+TI IcfN2OeWr65lCpWMrnAbWEXNOeOq/tw= Received: from mail-vk1-f198.google.com (mail-vk1-f198.google.com [209.85.221.198]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-170-sc7RQHxvNai_Ys9KaP9W-A-1; Tue, 23 Jun 2020 08:49:16 -0400 X-MC-Unique: sc7RQHxvNai_Ys9KaP9W-A-1 Received: by mail-vk1-f198.google.com with SMTP id g68so2654698vkg.2 for ; Tue, 23 Jun 2020 05:49:16 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=JkI5ya1bwFD1DARK7H9UAVcQpC3Issp2U8tKZ/sUwps=; b=Ebv8DX7LGPRRvwkFzpUVPGpFtogUyCP6ZK7PZM+j/vmmef1GizwC0k+g+O6cTrL59O vx2n/pGx+oFOTWcJRsJj9X7e3oWfe4ZgAOQsWDdJiCciae1xngzCCPH+7vrgGqedH2ZX PgPamKJBWAKtsD4nGjFcSLS/22wo7UPa1WtCE1AdoBvgAhy/hsjPZis7VI8bHqYvjjqL gzm7cWxACYQyjqRMTlVQclY7fa1aUbr6aC/KIt3jYxrQHkeJvJ45R6JYeYB1WgHpcI2R N4ivd/LdpAnSY9K3gEQShrOzCoZzBZZtUf+Ik8hp4sy6i8tX+tHHV3PmWpZ15lQXNIH4 MHsA== X-Gm-Message-State: AOAM530g2aYX/4W/pWCTPBboN92uNMmnZWFAwJuGj+Jn8xJCRI7in50y XGjjOGmuRU1nkyiQHNgx2s1vLwkuuTunsrR7nP+oPMV7F8jF3EcCUF9cUbQklmN6bOXI8kNPmeF zHHC8+6nnJW7KoVbY/BE= X-Received: by 2002:a1f:284a:: with SMTP id o71mr18493761vko.18.1592916556377; Tue, 23 Jun 2020 05:49:16 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzAHKaVOyrDP5u1I6P5t+IFPicpxrYsniDSSYbaVqKkBJ3trTopN6MCZnIbXgw2Y0ayoH4PRv/z9KXlQqzX0NQ= X-Received: by 2002:a1f:284a:: with SMTP id o71mr18493740vko.18.1592916555992; Tue, 23 Jun 2020 05:49:15 -0700 (PDT) MIME-Version: 1.0 References: <20200610144506.30505-1-david.marchand@redhat.com> <20200622132531.21857-1-david.marchand@redhat.com> <20200622132531.21857-7-david.marchand@redhat.com> <20200623091424.GA599@bricha3-MOBL.ger.corp.intel.com> In-Reply-To: <20200623091424.GA599@bricha3-MOBL.ger.corp.intel.com> From: David Marchand Date: Tue, 23 Jun 2020 14:49:05 +0200 Message-ID: To: Bruce Richardson Cc: "Ananyev, Konstantin" , "dev@dpdk.org" , "jerinjacobk@gmail.com" , "mdr@ashroe.eu" , "ktraynor@redhat.com" , "Stokes, Ian" , "i.maximets@ovn.org" , Thomas Monjalon , "Mcnamara, John" , "Kovacevic, Marko" , "Burakov, Anatoly" , Olivier Matz , Andrew Rybchenko , Neil Horman X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" Subject: Re: [dpdk-dev] [PATCH v3 6/9] eal: register non-EAL threads as lcores 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On Tue, Jun 23, 2020 at 11:14 AM Bruce Richardson wrote: > > On Tue, Jun 23, 2020 at 09:49:18AM +0200, David Marchand wrote: > > Hello Konstantin, > > > > On Mon, Jun 22, 2020 at 5:49 PM Ananyev, Konstantin > > wrote: > > > > diff --git a/lib/librte_eal/common/eal_common_lcore.c b/lib/librte_eal/common/eal_common_lcore.c > > > > index 86d32a3dd7..7db05428e7 100644 > > > > --- a/lib/librte_eal/common/eal_common_lcore.c > > > > +++ b/lib/librte_eal/common/eal_common_lcore.c > > > > @@ -220,3 +221,38 @@ rte_socket_id_by_idx(unsigned int idx) > > > > } > > > > return config->numa_nodes[idx]; > > > > } > > > > + > > > > +static rte_spinlock_t lcore_lock = RTE_SPINLOCK_INITIALIZER; > > > > + > > > > +unsigned int > > > > +eal_lcore_non_eal_allocate(void) > > > > +{ > > > > + struct rte_config *cfg = rte_eal_get_configuration(); > > > > + unsigned int lcore_id; > > > > + > > > > + rte_spinlock_lock(&lcore_lock); > > > > > > I think it will break current DPDK MP modes. > > > The problem here - rte_config (and lcore_role[]) is in shared memory, > > > while the lock is local. > > > Simplest way probably to move lcore_lock to rte_config. > > > > Even before this series, MP has no protection on lcore placing between > > primary and secondary processes. > > Personally, I have no use for DPDK MP and marking MP as not supporting > > this new feature is tempting for a first phase. > > If this is a strong requirement, I can look at it in a second phase. > > What do you think? > > > I think that is reasonable for a new feature. I suspect those wanting to > dynamically manage their own threads probably do not care about > multi-process mode. > > However, this limitation probably needs to be clearly called out in the > docs. Again, *disclaimer* I am not a user of the MP feature. But I suppose users of such a feature are relying on DPDK init and threads management, and I would not expect them to use this new API. I will add a note in rte_thread_register() doxygen. But I wonder if adding some check when a secondary attaches would make sense... Like how we have a version check, I could "taint" the dpdk primary process: a variable in shared memory could do the trick. -- David Marchand