From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <dev-bounces@dpdk.org>
Received: from dpdk.org (dpdk.org [92.243.14.124])
	by inbox.dpdk.org (Postfix) with ESMTP id E186CA0529;
	Wed,  8 Jul 2020 19:10:31 +0200 (CEST)
Received: from [92.243.14.124] (localhost [127.0.0.1])
	by dpdk.org (Postfix) with ESMTP id C21DC1DA6A;
	Wed,  8 Jul 2020 19:10:30 +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 31CA71DA2B
 for <dev@dpdk.org>; Wed,  8 Jul 2020 19:10:29 +0200 (CEST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;
 s=mimecast20190719; t=1594228228;
 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=BWXJOIvfsrJ0LVmiL+5St+bLCSMjX9dLuMBqXMVGcic=;
 b=DhkMZDbXI27txNf952NDt9k4POSOJyJV8HwGq9PmjzmATHWTNxSckZ2cnk8qgM1zOitLeu
 swTwrUqIZu5nTQ2Pzv4dec8EdG8yRLlEA2qMlXi2eMzckUfwETrNsyEE4EVtmdvHgRYrWe
 K0RVS1vezHsVhXFROpWsuJ1dYgXy9zc=
Received: from mail-ua1-f70.google.com (mail-ua1-f70.google.com
 [209.85.222.70]) (Using TLS) by relay.mimecast.com with ESMTP id
 us-mta-436-vPyJ3zSSM0C9-TyNdkm72Q-1; Wed, 08 Jul 2020 13:10:27 -0400
X-MC-Unique: vPyJ3zSSM0C9-TyNdkm72Q-1
Received: by mail-ua1-f70.google.com with SMTP id n4so3218206uaq.17
 for <dev@dpdk.org>; Wed, 08 Jul 2020 10:10:27 -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=BWXJOIvfsrJ0LVmiL+5St+bLCSMjX9dLuMBqXMVGcic=;
 b=r0MgZ7DDCOxwUZWU1uiq8Lt1HMLTfmKnCzpM5mXRZYOHczZLzc6nTR2WtR4AJpJ3/z
 jQ9yb37HF+vrYotViZ5flvCkeciYVEy4mJlt9uDNKL8kg8gveOlyek8q0/yzS3oAHw+2
 W5g/WvfW/ot7EdCIkFbtXow2OdhzcVoYyTxVtSj2sCmTPGoqa9kUWvO0ADT7OLhYSLmU
 Ag8sjq7RjTUQwHH4LjwGkyT8Fsfp3lLsobNcwjx4iJypDzqssuv2fkV+X+AAJ+49klJn
 Oc0VJTueWVt1FXNxirooZPr3HTHfkMltfB0Chim7sB3aQlYnQF92rximheIZL9u/kyA0
 Ch2w==
X-Gm-Message-State: AOAM530lBa4QTafGRIUY35ULHnLv0+gzWnXivMwKI7QSwXaaNoMuDxdA
 Be+u5MhfSM2L9AVF8dfYyzJ8z+1HGVLf6euiCD0kF0p5JPvsgJHKcA57OQsfxSapCuTl5USKzoY
 jQ8WHCR04ngeWEk+TUoQ=
X-Received: by 2002:a67:c58c:: with SMTP id h12mr37563929vsk.141.1594228226537; 
 Wed, 08 Jul 2020 10:10:26 -0700 (PDT)
X-Google-Smtp-Source: ABdhPJx+UYzYzefsHvJQhZdOHBcUPKQ939ao60tpYPF7Sr2Rk60e2FGcfe3VO4zrqaMaaPWVla7hY8oEwoRdPCFX+68=
X-Received: by 2002:a67:c58c:: with SMTP id h12mr37563912vsk.141.1594228226256; 
 Wed, 08 Jul 2020 10:10:26 -0700 (PDT)
MIME-Version: 1.0
References: <20200428012139.32196-1-l.wojciechow@partner.samsung.com>
 <CGME20200708133748eucas1p2dbe34d8605d8f618559daee9cbeaa73d@eucas1p2.samsung.com>
 <20200708133733.29468-1-l.wojciechow@partner.samsung.com>
 <BYAPR11MB3143C1108734B55D30E26B37D7670@BYAPR11MB3143.namprd11.prod.outlook.com>
In-Reply-To: <BYAPR11MB3143C1108734B55D30E26B37D7670@BYAPR11MB3143.namprd11.prod.outlook.com>
From: David Marchand <david.marchand@redhat.com>
Date: Wed, 8 Jul 2020 19:10:14 +0200
Message-ID: <CAJFAV8xWa6WZy_GAZ2yrY6qrCWbyjGaMWYjLhXUjpDd2QnM+bQ@mail.gmail.com>
To: Lukasz Wojciechowski <l.wojciechow@partner.samsung.com>
Cc: Jerin Jacob Kollanukkaran <jerinj@marvell.com>,
 "dev@dpdk.org" <dev@dpdk.org>, 
 "stable@dpdk.org" <stable@dpdk.org>, "Van Haaren,
 Harry" <harry.van.haaren@intel.com>
Authentication-Results: relay.mimecast.com;
 auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=dmarchan@redhat.com
X-Mimecast-Spam-Score: 0
X-Mimecast-Originator: redhat.com
Content-Type: text/plain; charset="UTF-8"
Subject: Re: [dpdk-dev] [PATCH v2] eal: fix lcore state bug
X-BeenThere: dev@dpdk.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: DPDK patches and discussions <dev.dpdk.org>
List-Unsubscribe: <https://mails.dpdk.org/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://mails.dpdk.org/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <https://mails.dpdk.org/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
Errors-To: dev-bounces@dpdk.org
Sender: "dev" <dev-bounces@dpdk.org>

On Wed, Jul 8, 2020 at 4:52 PM Van Haaren, Harry
<harry.van.haaren@intel.com> wrote:
> > The rte_service_lcore_reset_all function stops execution of services
> > on all lcores and switches them back from ROLE_SERVICE to ROLE_RTE.
> > However the thread loop for slave lcores (eal_thread_loop) distincts these
> > roles to set lcore state after processing delegated function.
> > It sets WAIT state for ROLE_SERVICE, but FINISHED for ROLE_RTE.
> > So changing the role to RTE before stopping work in slave lcores
> > causes lcores to end in FINISHED state. That is why the rte_eal_lcore_wait
> > must be run after rte_service_lcore_reset_all to bring back lcores to
> > launchable (WAIT) state.
> > This has been fixed in test app and clarified in API documentation.
> >
> > Setting the state to WAIT in rte_service_runner_func is premature
> > as the rte_service_runner_func function is still a part of the lcore
> > function delegated to slave lcore. The state is overwritten anyway in
> > slave lcore thread loop. This premature setting state to WAIT might
> > however cause rte_eal_lcore_wait, that was called by the application,
> > to return before slave lcore thread set the FINISHED state. That's
> > why it is removed from librte_eal rte_service_runner_func function.

Thanks for the explanation and fix.

> >
> > Bugzilla ID: 464
> > Fixes: 21698354c832 ("service: introduce service cores concept")
> > Fixes: f038a81e1c56 ("service: add unit tests")
> > Cc: stable@dpdk.org
> >

Reported-by: Sarosh Arif <sarosh.arif@emumba.com>
> > Signed-off-by: Lukasz Wojciechowski <l.wojciechow@partner.samsung.com>
> Acked-by: Harry van Haaren <harry.van.haaren@intel.com>

Applied, thanks Lukasz.


-- 
David Marchand