Hi Stephen,

Please see inline.

Thanks,
Anoob

> -----Original Message-----
> From: Stephen Hemminger <step...@networkplumber.org>
> Sent: Saturday, May 27, 2023 3:42 AM
> To: Anoob Joseph <ano...@marvell.com>
> Cc: Thomas Monjalon <tho...@monjalon.net>; Akhil Goyal
> <gak...@marvell.com>; Jerin Jacob Kollanukkaran <jer...@marvell.com>;
> Konstantin Ananyev <konstantin.v.anan...@yandex.ru>; Volodymyr Fialko
> <vfia...@marvell.com>; Hemant Agrawal <hemant.agra...@nxp.com>;
> Mattias Rönnblom <mattias.ronnb...@ericsson.com>; Kiran Kumar
> Kokkilagadda <kirankum...@marvell.com>; dev@dpdk.org; Olivier Matz
> <olivier.m...@6wind.com>
> Subject: [EXT] Re: [PATCH v4 21/22] pdcp: add thread safe processing
> 
> External Email
> 
> ----------------------------------------------------------------------
> On Sat, 27 May 2023 02:32:13 +0530
> Anoob Joseph <ano...@marvell.com> 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.

[Anoob] Most protocol implementation would have a similar issue. I've tried to 
follow the approach taken in lib IPsec (please check lib/ipsec/ipsec_sqn.h). 
From the discussion we had on v3, I've tried to make it compile time constant 
to remove any conditional checks in datapath.

If you still think, this is an issue, I could drop this patch for now and 
re-introduce it later once we have test applications that can work with 
traffic. Please share your thoughts.

Reply via email to