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 050D143069; Tue, 15 Aug 2023 04:22:58 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id E7F46427E9; Tue, 15 Aug 2023 04:22:57 +0200 (CEST) Received: from mail-pl1-f179.google.com (mail-pl1-f179.google.com [209.85.214.179]) by mails.dpdk.org (Postfix) with ESMTP id 9D01F41104 for ; Tue, 15 Aug 2023 04:22:56 +0200 (CEST) Received: by mail-pl1-f179.google.com with SMTP id d9443c01a7336-1bc7b25c699so30365115ad.1 for ; Mon, 14 Aug 2023 19:22:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20221208.gappssmtp.com; s=20221208; t=1692066176; x=1692670976; 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=0Z72pQf8EUMEJSqWyjYPZK+L0q+owkdg1V3ZRRYcUQI=; b=fjkjYL1ooskCFxeDjb3WIDCw4QK172YlCLEGN0CN9j/GWLWVWdyh5QTm+8zqisVQGW j6k9i1kSSl+xVjm+IjIz82xPOqj2/e1DcUJXXvfJlOspWEbNPrkDlVfuS7s07UJFYiR7 UtFvh9dBwB/rlUvqQq+l3AcqoYGZpJgKMpyU8rZPHjZQKqQgh6gNU/44zY7A2DCtlg+i xP7+EupZpPG2mvSq6eCgp2rkfTeWucrgY5kmOHllp8Gnnl3NdHZ2sG3NBkzhxnRvbje5 M9m58laMZ4zr1PYpordIMEZjWMfLAsXoFAntiQdAg+uCRivV3PNLC6tqUAgEElk1cki1 VT/g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692066176; x=1692670976; 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=0Z72pQf8EUMEJSqWyjYPZK+L0q+owkdg1V3ZRRYcUQI=; b=Qmhw32Pd7DQb5KmHzelzfG5cqy2g0U2xWHCcAf0tqTLhbyzJ5GA88l2IlPyXO4zhNp N799ZH1s3eP/mz9AUhZG3+/pJNXg131V+5eN2sYeL4VdbDkebB4+q85bofl2P5bopvcK fM0PC34a0Qdyys1v3AgjbUIVLwErbvCv1Q80ZEeWSt4SkmBGAj3KMI2LrpOZ5c3JhaMB gOkmVFeNkexQGzRNcEvwflTdRnnH9/9oJcTx/CC1RlFnEfEUtysu1Q1q3S6dnSdBE+UQ B3zL5bZG5RWeBnmn41DG0J8Iz9YXmEsvXcxZtDUR7QPux56Yju1/ViILhEGpMRGlzwfN rg5Q== X-Gm-Message-State: AOJu0Yzejq1yJg5+pJIEYnbiWOn9xsxB0Q43wJaXcEDc4iquAaH+OFIL C1K6RO/Ut1jWw5e8zM59U4tmdA== X-Google-Smtp-Source: AGHT+IH7zkatdqgw4MKag08VEA9i8eC1TvIyBiN7CJykoLal5XKZXNbEQ+9THA43H51QnXpkSegPpw== X-Received: by 2002:a17:902:b907:b0:1bc:239:a7e3 with SMTP id bf7-20020a170902b90700b001bc0239a7e3mr8888927plb.44.1692066175803; Mon, 14 Aug 2023 19:22:55 -0700 (PDT) Received: from hermes.local (204-195-127-207.wavecable.com. [204.195.127.207]) by smtp.gmail.com with ESMTPSA id e10-20020a170902b78a00b001bd41b70b60sm10131848pls.45.2023.08.14.19.22.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 14 Aug 2023 19:22:55 -0700 (PDT) Date: Mon, 14 Aug 2023 19:22:53 -0700 From: Stephen Hemminger To: okaya@kernel.org Cc: Anatoly Burakov , dev@dpdk.org Subject: Re: [PATCH v1 3/7] eal_memzone: bail out on initialized Message-ID: <20230814192253.1e74a6b5@hermes.local> In-Reply-To: <20230815013826.1288972-4-okaya@kernel.org> References: <20230815013826.1288972-1-okaya@kernel.org> <20230815013826.1288972-4-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 Mon, 14 Aug 2023 21:38:22 -0400 okaya@kernel.org wrote: > + static int initialized = 0; > int ret = 0; > > + if (initialized) > + return 0; > + > /* get pointer to global configuration */ > mcfg = rte_eal_get_configuration()->mem_config; > > @@ -415,6 +419,8 @@ rte_eal_memzone_init(void) > > rte_rwlock_write_unlock(&mcfg->mlock); > > + initialized = 1; > + > return ret; > } Use a bool for this.