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 B55CEA054F; Wed, 1 Jun 2022 00:46:02 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 5DC6840A84; Wed, 1 Jun 2022 00:46:02 +0200 (CEST) Received: from mail-pf1-f174.google.com (mail-pf1-f174.google.com [209.85.210.174]) by mails.dpdk.org (Postfix) with ESMTP id 5DD6340150 for ; Wed, 1 Jun 2022 00:46:00 +0200 (CEST) Received: by mail-pf1-f174.google.com with SMTP id e11so254550pfj.5 for ; Tue, 31 May 2022 15:46:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20210112.gappssmtp.com; s=20210112; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=WTqs2LUOdPc/DiQ0J0/WiX5fiawMv9xbq5d+Gi/6We0=; b=U9bZtP/H8swMc6yy44ULcM+VZ0glCzKyBqnkiIqpv2mbe/9LgGt+QEg59hlTTExL/J xTUsjaz5/xKn4xwmVXgedqWu03YeD9wgYGL/Q+vGCyHpVsmqUuhg14r/EDg7q6xMv4+7 pbss/hrVD0iXc/RW5xxBSTHWDsrOhhusYbJUkGRdDaSpkGnpuDk0yjKYXq8BxzT3yhU7 f1uhVSF1kChJNOtWUhrBG05kvcc0dZiPVKsQFPgBFWUgTGpo3R18H0n3QMuWeL4RNohh 37L54I9S3eGbpWbMfnA5qOXtQ2DaAedA5I/GZDm2z1CGgpcXi0xb0yQk2XtklGJ4LKxE +TGA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=WTqs2LUOdPc/DiQ0J0/WiX5fiawMv9xbq5d+Gi/6We0=; b=8KedcmBfoUIdgWkGOgP0eAoUyVBWTJdYNg8wGicuhOcG2wTlUgpEVtNUcqzJ7KRn+g MmGttAknBYbbEBwzftAqT8rbxMrV2HJ7DujiChSTQjNwp52kclRBF+dDpoz96hwbEbfm Hcen+8j1n2P1t4rqkbKl/ptYiwmea/JCebtiP5AHZG1WkF6NyLgNNjnJ553+vGlFh8t2 V7pgKamRNpeo5sLYu/1oDdNZZdGI2hqoIeuCnKWyUYrXGfAtLH7pBW1MV6YpNfXAST5N 4KqQbR2j2j5hVBqSnNu3JZR8Fitet/F3YTfpfFT0C7rA1Fm54aF2GBapyO9vUbgMYj98 lc9g== X-Gm-Message-State: AOAM532WrjtXvWjdimMba+jjSaK/95syE1e9duTPiCtidOmmT+DsBmRT 4xB4jhX3VGawaBDD5zM7moLHxA== X-Google-Smtp-Source: ABdhPJyIC7UfHCpKJkByN182FkDVgk6vX5Il5/WdG5sO7OC++Iq+4BSl5wADMv7wt7J5b9GknCLKNg== X-Received: by 2002:a05:6a00:1a94:b0:518:b331:fbcf with SMTP id e20-20020a056a001a9400b00518b331fbcfmr42318988pfv.85.1654037158457; Tue, 31 May 2022 15:45:58 -0700 (PDT) Received: from hermes.local (204-195-112-199.wavecable.com. [204.195.112.199]) by smtp.gmail.com with ESMTPSA id u19-20020a170903305300b001622c377c3esm62745pla.117.2022.05.31.15.45.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 31 May 2022 15:45:58 -0700 (PDT) Date: Tue, 31 May 2022 15:45:36 -0700 From: Stephen Hemminger To: Mattias =?UTF-8?B?UsO2bm5ibG9t?= Cc: Thomas Monjalon , David Marchand , , , , , , , , Chengwen Feng , Ola Liljedahl Subject: Re: [PATCH v9] eal: add seqlock Message-ID: <20220531154536.52f57bf6@hermes.local> In-Reply-To: <20220523142346.366902-1-mattias.ronnblom@ericsson.com> References: <20220523113111.366599-1-mattias.ronnblom@ericsson.com> <20220523142346.366902-1-mattias.ronnblom@ericsson.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable 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, 23 May 2022 16:23:46 +0200 Mattias R=C3=B6nnblom wrote: > +/** > + * The RTE seqcount type. > + */ > +typedef struct { > + uint32_t sn; /**< A sequence number for the protected data. */ > +} rte_seqcount_t; Don't need structure for only one element. typedef uint32_t rte_seqcount_t; + if (unlikely(begin_sn !=3D end_sn)) + return true; + + return false; Prefer to avoid conditional if possible (compiler will optimize it as): return begin_sn =3D=3D end_sn;