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 A805942537; Thu, 7 Sep 2023 17:47:50 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 8A4304026C; Thu, 7 Sep 2023 17:47:50 +0200 (CEST) Received: from mail-pj1-f52.google.com (mail-pj1-f52.google.com [209.85.216.52]) by mails.dpdk.org (Postfix) with ESMTP id D853C400EF for ; Thu, 7 Sep 2023 17:47:48 +0200 (CEST) Received: by mail-pj1-f52.google.com with SMTP id 98e67ed59e1d1-26934bc3059so1645146a91.1 for ; Thu, 07 Sep 2023 08:47:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1694101668; x=1694706468; darn=dpdk.org; 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=r4QDvPNDUAltC9r4BUFzcb8evzP9Qkg0QclJFVlVlCA=; b=kuuUWD6za+KDTrgJFh3C1Z/TjPq8WqBryCV89CNSEfL7BvPfvSouS1ErJpvqzgOa95 L4JO58RBXu+ggDBISG7zw4ad7bYxchwLiZuK5NQUq/WqISg7uAxyBU1sHU95mtxRSG1n O9G6kSE7uJAK2mPVusWzLu7XkDuE1DfRBtdtpS5/HLmsybk05ItrMNhf2VY7Knd/RqZu CkZjm8jKuUugacV+mA1aP9i3LLUGFIoOcBOJDzX2maS6qziubfFMR7HKuC4AGJ9Lm6TT 7Io1zvs5/txEOQ2SJhXIpGoJUbipn5os8lk+uYxuTCREzAgNjEJ6rdc9WTA/6UiXAUsa y3ew== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1694101668; x=1694706468; 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=r4QDvPNDUAltC9r4BUFzcb8evzP9Qkg0QclJFVlVlCA=; b=HljzOUKx7Z0ddSgSBixhm22kn3WtyZZ557ne53puB70HuXk93NT6puaB2sK8vrmnSG epg3nZ9DQyeV7gak6TMZCwvZrThp8pXERFrOgZeXMmV6hDnu+3mu4tVNZxbT3POKJ3uc 7R4InTfVucTlrciHmHQ1LXlpNhM+WioiTlNrhQL7HnlIoRuUBBM3BU3L4WqqTi/kRuN/ VWKGolBxO0VvUUtCJVWgWAvYNACnei8pJL596jyOga6KrDiW2A1FYLKa9/+8RsLsCLEb OKxcPhC+cbzaMBPTVzJ5qslisWS8IYgVy3c7fgHsG9FRgS9MOoXMpKGhG/ldXtoyHV0i gMdg== X-Gm-Message-State: AOJu0YzXpKgf+FkcMmjCZA0VMmwPVD7jwzig5eS48bQqElcFi6tx5C5n dG1BPW5WflVOqXntUReaSKsEs1JaNSJKk4C4+34= X-Google-Smtp-Source: AGHT+IErERoazp514A8SBN6FPpEb8Yv7A3EZps3jlibSnlyS8caWkzPwXI0Ss2XajJ+WgsgRNI07sw== X-Received: by 2002:a17:90b:b09:b0:271:7ce5:2572 with SMTP id bf9-20020a17090b0b0900b002717ce52572mr4045752pjb.22.1694101667668; Thu, 07 Sep 2023 08:47:47 -0700 (PDT) Received: from hermes.local (204-195-112-131.wavecable.com. [204.195.112.131]) by smtp.gmail.com with ESMTPSA id 10-20020a17090a01ca00b00263dfe9b972sm1778159pjd.0.2023.09.07.08.47.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Sep 2023 08:47:47 -0700 (PDT) Date: Thu, 7 Sep 2023 08:47:43 -0700 From: Stephen Hemminger To: dev@dpdk.org Cc: Mattias =?UTF-8?B?UsO2bm5ibG9t?= , Bruce Richardson Subject: Re: [PATCH v2 2/2] random: make rte_rand() thread safe for non-EAL threads Message-ID: <20230907084743.6e43e885@hermes.local> In-Reply-To: <20230907152456.20570-3-stephen@networkplumber.org> References: <20230906155302.82749-1-stephen@networkplumber.org> <20230907152456.20570-1-stephen@networkplumber.org> <20230907152456.20570-3-stephen@networkplumber.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 Thu, 7 Sep 2023 08:24:56 -0700 Stephen Hemminger wrote: > > +static __rte_always_inline > +void __rte_rand_put_state(struct rte_rand_state *state) > +{ > + if (state == &rand_states[RTE_MAX_LCORE]) > + rte_spinlock_unlock(&rte_rand_lock); > +} Conditional locking like this make clang lock analyzer unhappy though.