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 7E04242BAD; Sat, 27 May 2023 00:11:35 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 5500840A7A; Sat, 27 May 2023 00:11:35 +0200 (CEST) Received: from mail-pf1-f181.google.com (mail-pf1-f181.google.com [209.85.210.181]) by mails.dpdk.org (Postfix) with ESMTP id 1E4D0406A2 for ; Sat, 27 May 2023 00:11:34 +0200 (CEST) Received: by mail-pf1-f181.google.com with SMTP id d2e1a72fcca58-64d57cd373fso1905088b3a.1 for ; Fri, 26 May 2023 15:11:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20221208.gappssmtp.com; s=20221208; t=1685139093; x=1687731093; 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=V2cbeewCCkScgGvvZSjzQROaQl9EvA9tQlLBmGvckjU=; b=roSxapnXzMfxXmAQSWOUfnH/pbrbiBh97gqjTue0xDQxLfX7KVIJ7JtZEe1nEeNCkM HXBAYywY/c9h4q9m8B20y6nNHabihNQnFfL9IYm1FOUboQgJUEhsew9z5UdQHlsoZSGw Uu6BRa9w7LWywCvBlYeFX0Lrx4UEPG3Ary+6a3nV2iHgVDyoVsmpPeZp4+YxoQlSV/o4 DM2SH0ITQyxoy/eaP8RsB/V+9qTujES4HVY7h1tOW2Lk6pgcvvN/rSZkgBHtjUCi6dqu 9jAA9CFe8phkmzCwfkgZJRdwqEuTYhceeEynxc2wN+VAGyDWbXFYHgBdsd2ttWZUzOQY UWyw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685139093; x=1687731093; 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=V2cbeewCCkScgGvvZSjzQROaQl9EvA9tQlLBmGvckjU=; b=Apqv6m6NhMBuaM8BBICp8Fmr3kidj2WTtR+IK3c7eJK4dCNtV3hvofHBqmXre27zv5 jWQhj39ybqRD0TYJKsw4PY28mXAeyfbZRQQ1Eb177jpj5J9CXxRHEWwv72Bizc1Z4ZQH j1AksJXaiORgl2x48D6YOYJUPoJO9BEXndxsEbPF+fcr1tr3qLsxJcd8VWhJc/znmKwU q/KgDRkZoQbHfxzkwnP7HLuli5ssAgzksxTri7YuUbVu/nmq9ZleDXyC4Bw7m5fu9e32 yCW+JNzLNkUOLI/hsSY8d153FKOb2vVPcIJ3N/lf4pVV0g9v0gfOlXmMZRkXyWI6/Mq1 LFBg== X-Gm-Message-State: AC+VfDy4avBEJEXTA9EBSYTLf7pBi3Ql0Xo59QOR35eD/9NDlKpe3vqJ 37MDOJp/vVqFbay1ubp6GJ4tDQ== X-Google-Smtp-Source: ACHHUZ4CRfwEPICAe5xnlo++ZIeWIv212DACPEXDC3pjsS3/n/PsB14uIUoxUQyrJB6SWNuaDy4XVw== X-Received: by 2002:a05:6a00:844:b0:635:7fb2:2ab4 with SMTP id q4-20020a056a00084400b006357fb22ab4mr501264pfk.6.1685139093026; Fri, 26 May 2023 15:11:33 -0700 (PDT) Received: from hermes.local (204-195-120-218.wavecable.com. [204.195.120.218]) by smtp.gmail.com with ESMTPSA id x23-20020a62fb17000000b006414289ab69sm3119992pfm.52.2023.05.26.15.11.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 26 May 2023 15:11:32 -0700 (PDT) Date: Fri, 26 May 2023 15:11:30 -0700 From: Stephen Hemminger To: Anoob Joseph Cc: Thomas Monjalon , Akhil Goyal , Jerin Jacob , Konstantin Ananyev , Volodymyr Fialko , Hemant Agrawal , Mattias =?UTF-8?B?UsO2bm5ibG9t?= , Kiran Kumar K , , Olivier Matz Subject: Re: [PATCH v4 21/22] pdcp: add thread safe processing Message-ID: <20230526151130.59d86649@hermes.local> In-Reply-To: <20230526210214.617-22-anoobj@marvell.com> References: <20230524160116.304-1-anoobj@marvell.com> <20230526210214.617-1-anoobj@marvell.com> <20230526210214.617-22-anoobj@marvell.com> 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 Sat, 27 May 2023 02:32:13 +0530 Anoob Joseph wrote: > +static inline uint32_t > +pdcp_atomic_inc(uint32_t *val, const bool mt_safe) > +{ > + if (mt_safe) > + return __atomic_fetch_add(val, 1, __ATOMIC_RELAXED); > + else > + return (*val)++; > +} This is a bad pattern. None of the rest of DPDK does this. Either be thread safe or not.