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 1201CA0032 for ; Fri, 21 Oct 2022 15:10:26 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 0BCCC42B9C; Fri, 21 Oct 2022 15:10:26 +0200 (CEST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mails.dpdk.org (Postfix) with ESMTP id 009B241147 for ; Fri, 21 Oct 2022 15:10:24 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1666357824; 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=e0AHF323nVTeir/nUDT4vCCH0g2uR46lzbAm2cKosIc=; b=G8LLAVCbgWN1nvXUfxAuIziFB5naSG0yxBcyuh1oWHEA7szrt661Jn/wV3exyLVUKgcZaj cevUQlKnRdLaN+GIldh4stYL01sQ5W0QK+uFVLjVgAhrPS/uTEfismbJKGEcKmzg/dqKzj k0n7u1+Tyx+Vi7LCat48UFEIVqR9Ot0= Received: from mail-pl1-f200.google.com (mail-pl1-f200.google.com [209.85.214.200]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-179-ni0ngqUeOYa0GAOdrhtogA-1; Fri, 21 Oct 2022 09:10:23 -0400 X-MC-Unique: ni0ngqUeOYa0GAOdrhtogA-1 Received: by mail-pl1-f200.google.com with SMTP id m3-20020a170902bb8300b0017f7e7e4385so1670240pls.20 for ; Fri, 21 Oct 2022 06:10:22 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=e0AHF323nVTeir/nUDT4vCCH0g2uR46lzbAm2cKosIc=; b=dcQ92djrnIYDVRgtp7Kx48lWOjKatnB6T8JgAez5LJFq6Hcjlga2lBkyI8hACXOUGb cFDNrZbj+EA+J3inr56PwKPlwxJjhijbjwBsx0OTZrCf0V2eF4RMeq3E+zQQvGb33Ges isx2oXhDMKrVpkjvJ1+OYZScLoLLJyYebyTJi3WtvP/QqPXG1p9CRALlQ+/7yGDgwjbR 8faLddoZ/oxfdoKSwhjplusC1aPsdQ5Ly+E9ebQTJEWaE+P1vPFzLWWDzQ1cdpxmNpVK ZPbKgGSOIiYxW2ZzV+BSqrGQSyhAuLc25TdLxhlNY7jYTFxEI7VGz/kvTNZrxcjO+Cpe RliA== X-Gm-Message-State: ACrzQf30uli7b+SOQHVv+Wn1XzZd6AM2cIDFV8Q+ZArk9/45M0uIScN4 bZr1eaejBpyuYmH0fMZ5aSbSBofmW0LbINebnzCKj9e+RpqHwK975X9W0bj2Oysel2pR51KWAYo 8FRdxjNY+m3+KVSfuRRWmV8w= X-Received: by 2002:a17:903:2307:b0:181:e618:b4c5 with SMTP id d7-20020a170903230700b00181e618b4c5mr18579935plh.172.1666357821936; Fri, 21 Oct 2022 06:10:21 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6IYFx27sVRU9Bu+cBKnpf2IXwFy926AMSqA4hmEmDOA0DzvqqGh8bo6I4OT37wafXljrajobnFZlcWXDhkJoY= X-Received: by 2002:a17:903:2307:b0:181:e618:b4c5 with SMTP id d7-20020a170903230700b00181e618b4c5mr18579912plh.172.1666357821687; Fri, 21 Oct 2022 06:10:21 -0700 (PDT) MIME-Version: 1.0 References: <20221020190041.2350842-1-erik.g.carrillo@intel.com> In-Reply-To: From: David Marchand Date: Fri, 21 Oct 2022 15:10:10 +0200 Message-ID: Subject: Re: [PATCH] service: fix early move to inactive status To: "Carrillo, Erik G" Cc: "Van Haaren, Harry" , "Naga Harish K, S V" , "dev@dpdk.org" , "stable@dpdk.org" , "thomas@monjalon.net" X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org On Fri, Oct 21, 2022 at 1:36 PM Van Haaren, Harry wrote: > > > > Assume thread T2 is a service lcore that is in the middle of executing > > a service function. Also, assume thread T1 concurrently calls > > rte_service_lcore_stop(), which will set the "service_active_on_lcore" > > state to false. If thread T1 then calls rte_service_may_be_active(), > > it can return zero even though T2 is still running the service function. > > If T1 then proceeds to free data being used by T2, a crash can ensue. > > > > Move the logic that clears the "service_active_on_lcore" state from the > > rte_service_lcore_stop() function to the service_runner_func() to > > ensure that we: > > - don't let the "service_active_on_lcore" state linger as 1 > > - don't clear the state early > > > > Fixes: 6550113be62d ("service: fix lingering active status") > > Cc: stable@dpdk.org > > > > Signed-off-by: Erik Gabriel Carrillo > Acked-by: Harry van Haaren Applied, thanks. -- David Marchand