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 1549143074; Tue, 15 Aug 2023 19:46:40 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 02C3F4114B; Tue, 15 Aug 2023 19:46:40 +0200 (CEST) Received: from mail-pf1-f182.google.com (mail-pf1-f182.google.com [209.85.210.182]) by mails.dpdk.org (Postfix) with ESMTP id 3DF9A410ED for ; Tue, 15 Aug 2023 19:46:38 +0200 (CEST) Received: by mail-pf1-f182.google.com with SMTP id d2e1a72fcca58-688731c6331so423859b3a.3 for ; Tue, 15 Aug 2023 10:46:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20221208.gappssmtp.com; s=20221208; t=1692121597; x=1692726397; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:from:to:cc:subject:date :message-id:reply-to; bh=yNPz+gnYcLCqsdBf9rE9psUa5AR42+UxBRppHSHn5P8=; b=y6Pppm+BNpxWnlpp3tAzJ5XDHy9XiTWi4duyTzu2NCPEaJw4DL8uDECUb8wxuZgQvU 4hvHvcxr3501puxe+RPl2ZpOIInCNeiYLZHzovXrxAiH9f2syyoOI8o8xlfQUCgrXLSF pF+0DMYoLK9ijDnJIIFAA3j53Id1qv9S6PqYH5cE6Kswuk5VyYBOrFykjBG4d3sLfZE/ j2kPkUgqJtD+8f04Wu2FJQ7dwfmfUa3lAscaVgv0vZTyrojW6Y0jQUM4sk4x8A6IlE15 GiW9as8hGwZHuWQhjhYf5ybawoVaYj1gVstCqmFj2Nd4237Ld53ePo2nSloRclMemAsS nEbA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692121597; x=1692726397; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=yNPz+gnYcLCqsdBf9rE9psUa5AR42+UxBRppHSHn5P8=; b=NaTtUKuhLl0nCiUXlPqEOctc+ag098zD8T0Uqyfim7Uu/8GZZ6Ifdh3w+347kHpx84 bQXJOZ9AjF/6TIweqmz0s5xzib82BMsvikTi5oaHZaVDr7xiRW7P38SJtL2pf06NYNUb kleK/eZhHgdbDCSNrQD/C1Yu/4aVhzGuTpXiEo3eVTsGIBus9obo5JTm6SgIrYwLhBPM xsicFj6j71AClHWZ7UTgVx56W/Itof8Vw4rQ8W1ay8PHfv0tL9fPLtQYR3fkZlzLH6eJ cO/gdKjFJBsqW2rlkqNx/WOSgFJiDmQBRquh3fJZ4qFovHY1K6rW10Mut9C61Du7xixJ O4EA== X-Gm-Message-State: AOJu0Yw1L2Ua37gCKhbZ7wTcucQ2cc/BeLRTP5d3QwjG6lqGGgzpcDrq s3aWQUd6DqarMyksqIQcWmtp5Q== X-Google-Smtp-Source: AGHT+IEsvLTmnLctKiViHYt4YOXD9i6XKO78LuGJBIecHSXye1yXsUW/EO+bn7zmBaap66rhf6i/uQ== X-Received: by 2002:a05:6300:8084:b0:138:1980:1375 with SMTP id ap4-20020a056300808400b0013819801375mr11279125pzc.25.1692121597320; Tue, 15 Aug 2023 10:46:37 -0700 (PDT) Received: from hermes.local (204-195-127-207.wavecable.com. [204.195.127.207]) by smtp.gmail.com with ESMTPSA id 24-20020aa79218000000b006827c26f148sm9546052pfo.195.2023.08.15.10.46.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 15 Aug 2023 10:46:37 -0700 (PDT) Date: Tue, 15 Aug 2023 10:46:35 -0700 From: Stephen Hemminger To: okaya@kernel.org Cc: dev@dpdk.org Subject: Re: [PATCH v4 8/8] eal: initialize worker threads once Message-ID: <20230815104635.143aaf61@hermes.local> In-Reply-To: <20230815145023.1386003-9-okaya@kernel.org> References: <20230815145023.1386003-1-okaya@kernel.org> <20230815145023.1386003-9-okaya@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org On Tue, 15 Aug 2023 10:50:23 -0400 okaya@kernel.org wrote: > From: Sinan Kaya > > Initialize worker threads once and keep a flag > for other init calls. > > Signed-off-by: Sinan Kaya > --- > lib/eal/linux/eal.c | 60 ++++++++++++++++++++++++--------------------- > 1 file changed, 32 insertions(+), 28 deletions(-) > > diff --git a/lib/eal/linux/eal.c b/lib/eal/linux/eal.c > index 584c78e640..1305e1df54 100644 > --- a/lib/eal/linux/eal.c > +++ b/lib/eal/linux/eal.c > @@ -80,6 +80,7 @@ int rte_cycles_vmware_tsc_map; > > > static uint32_t run_once; > +static bool worker_initialized; > I see a pattern here. Many places are using static to only initialize once. Could you name these variables the same; suggest using run_once everywhere.