DPDK patches and discussions
 help / color / mirror / Atom feed
* clarification on RTE_HASH_EXTRA_FLAGS_RW_CONCURRENCY_LF flag
@ 2022-07-06  3:45 venkatesh bs
  2022-07-06 13:37 ` venkatesh bs
  0 siblings, 1 reply; 5+ messages in thread
From: venkatesh bs @ 2022-07-06  3:45 UTC (permalink / raw)
  To: dev

[-- Attachment #1: Type: text/plain, Size: 595 bytes --]

Hi All,

In multithreaded/Multicore  environment can we use
RTE_HASH_EXTRA_FLAGS_RW_CONCURRENCY_LF
independently,
or this flag should always be used with
RTE_HASH_EXTRA_FLAGS_MULTI_WRITER_ADD.

We are trying to create and access the hash table with
RTE_HASH_EXTRA_FLAGS_RW_CONCURRENCY_LF
only.
We are getting crashes in multi core environments , we debugged nothing
wrong in the application , everything looks good.

We call rte_hash_del_key() first and from the returned position we are
calling rte_hash_free_key_with_position().

Please let me know if we missed something.

Thanks,
Venkatesh.

[-- Attachment #2: Type: text/html, Size: 2006 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: clarification on RTE_HASH_EXTRA_FLAGS_RW_CONCURRENCY_LF flag
  2022-07-06  3:45 clarification on RTE_HASH_EXTRA_FLAGS_RW_CONCURRENCY_LF flag venkatesh bs
@ 2022-07-06 13:37 ` venkatesh bs
  2022-07-06 14:21   ` venkatesh bs
  2022-07-06 15:22   ` Stephen Hemminger
  0 siblings, 2 replies; 5+ messages in thread
From: venkatesh bs @ 2022-07-06 13:37 UTC (permalink / raw)
  To: dev

[-- Attachment #1: Type: text/plain, Size: 1300 bytes --]

Hi All,

In multithreaded/Multicore  environment can we use
RTE_HASH_EXTRA_FLAGS_RW_CONCURRENCY_LF
independently,
or this flag should always be used with
RTE_HASH_EXTRA_FLAGS_MULTI_WRITER_ADD.

We are trying to create and access the hash table with
RTE_HASH_EXTRA_FLAGS_RW_CONCURRENCY_LF
only.
We are getting crashes in multi core environments , we debugged nothing
wrong in the application , everything looks good.

We call rte_hash_del_key() first and from the returned position we are
calling rte_hash_free_key_with_position().

Please let me know if we missed something.

Thanks,
Venkatesh.

On Wed, Jul 6, 2022 at 9:15 AM venkatesh bs <venki.bsv@gmail.com> wrote:

> Hi All,
>
> In multithreaded/Multicore  environment can we use RTE_HASH_EXTRA_FLAGS_RW_CONCURRENCY_LF
> independently,
> or this flag should always be used with
> RTE_HASH_EXTRA_FLAGS_MULTI_WRITER_ADD.
>
> We are trying to create and access the hash table with RTE_HASH_EXTRA_FLAGS_RW_CONCURRENCY_LF
> only.
> We are getting crashes in multi core environments , we debugged nothing
> wrong in the application , everything looks good.
>
> We call rte_hash_del_key() first and from the returned position we are
> calling rte_hash_free_key_with_position().
>
> Please let me know if we missed something.
>
> Thanks,
> Venkatesh.
>

[-- Attachment #2: Type: text/html, Size: 4344 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: clarification on RTE_HASH_EXTRA_FLAGS_RW_CONCURRENCY_LF flag
  2022-07-06 13:37 ` venkatesh bs
@ 2022-07-06 14:21   ` venkatesh bs
  2022-07-06 15:22   ` Stephen Hemminger
  1 sibling, 0 replies; 5+ messages in thread
From: venkatesh bs @ 2022-07-06 14:21 UTC (permalink / raw)
  To: dev, users

[-- Attachment #1: Type: text/plain, Size: 2029 bytes --]

Hi All,

In multithreaded/Multicore  environment can we use
RTE_HASH_EXTRA_FLAGS_RW_CONCURRENCY_LF
independently,
or this flag should always be used with
RTE_HASH_EXTRA_FLAGS_MULTI_WRITER_ADD.

We are trying to create and access the hash table with
RTE_HASH_EXTRA_FLAGS_RW_CONCURRENCY_LF
only.
We are getting crashes in multi core environments , we debugged nothing
wrong in the application , everything looks good.

We call rte_hash_del_key() first and from the returned position we are
calling rte_hash_free_key_with_position().

Please let me know if we missed something.

Thanks,
Venkatesh.

On Wed, Jul 6, 2022 at 7:07 PM venkatesh bs <venki.bsv@gmail.com> wrote:

> Hi All,
>
> In multithreaded/Multicore  environment can we use RTE_HASH_EXTRA_FLAGS_RW_CONCURRENCY_LF
> independently,
> or this flag should always be used with
> RTE_HASH_EXTRA_FLAGS_MULTI_WRITER_ADD.
>
> We are trying to create and access the hash table with RTE_HASH_EXTRA_FLAGS_RW_CONCURRENCY_LF
> only.
> We are getting crashes in multi core environments , we debugged nothing
> wrong in the application , everything looks good.
>
> We call rte_hash_del_key() first and from the returned position we are
> calling rte_hash_free_key_with_position().
>
> Please let me know if we missed something.
>
> Thanks,
> Venkatesh.
>
> On Wed, Jul 6, 2022 at 9:15 AM venkatesh bs <venki.bsv@gmail.com> wrote:
>
>> Hi All,
>>
>> In multithreaded/Multicore  environment can we use RTE_HASH_EXTRA_FLAGS_RW_CONCURRENCY_LF
>> independently,
>> or this flag should always be used with
>> RTE_HASH_EXTRA_FLAGS_MULTI_WRITER_ADD.
>>
>> We are trying to create and access the hash table with RTE_HASH_EXTRA_FLAGS_RW_CONCURRENCY_LF
>> only.
>> We are getting crashes in multi core environments , we debugged nothing
>> wrong in the application , everything looks good.
>>
>> We call rte_hash_del_key() first and from the returned position we are
>> calling rte_hash_free_key_with_position().
>>
>> Please let me know if we missed something.
>>
>> Thanks,
>> Venkatesh.
>>
>

[-- Attachment #2: Type: text/html, Size: 6698 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: clarification on RTE_HASH_EXTRA_FLAGS_RW_CONCURRENCY_LF flag
  2022-07-06 13:37 ` venkatesh bs
  2022-07-06 14:21   ` venkatesh bs
@ 2022-07-06 15:22   ` Stephen Hemminger
  2022-07-08 17:52     ` Honnappa Nagarahalli
  1 sibling, 1 reply; 5+ messages in thread
From: Stephen Hemminger @ 2022-07-06 15:22 UTC (permalink / raw)
  To: venkatesh bs; +Cc: dev

On Wed, 6 Jul 2022 19:07:54 +0530
venkatesh bs <venki.bsv@gmail.com> wrote:

> Hi All,
> 
> In multithreaded/Multicore  environment can we use
> RTE_HASH_EXTRA_FLAGS_RW_CONCURRENCY_LF
> independently,
> or this flag should always be used with
> RTE_HASH_EXTRA_FLAGS_MULTI_WRITER_ADD.
> 
> We are trying to create and access the hash table with
> RTE_HASH_EXTRA_FLAGS_RW_CONCURRENCY_LF
> only.
> We are getting crashes in multi core environments , we debugged nothing
> wrong in the application , everything looks good.
> 
> We call rte_hash_del_key() first and from the returned position we are
> calling rte_hash_free_key_with_position().
> 
> Please let me know if we missed something.
> 
> Thanks,
> Venkatesh.

Repeating same question doesn't get answer faster.

Read the code, it is fairly straightforward.

The multi-writer add means that writers take a lock.
If doing lock free support then:
  1. It is up to your application to use a single writer and/or
     wrap writer calls in a lock.

  2. You need to use RCU mechanism to guarantee that no reader
     will access a deleted entry. Something like:

     rte_hash_del_key()
     synchronize_rcu()
     rte_hash_free_key_with_position()

     You can use either the DPDK RCU library or the userspace RCU library.
     Read that documentation, RCU is non-trivial change.



^ permalink raw reply	[flat|nested] 5+ messages in thread

* RE: clarification on RTE_HASH_EXTRA_FLAGS_RW_CONCURRENCY_LF flag
  2022-07-06 15:22   ` Stephen Hemminger
@ 2022-07-08 17:52     ` Honnappa Nagarahalli
  0 siblings, 0 replies; 5+ messages in thread
From: Honnappa Nagarahalli @ 2022-07-08 17:52 UTC (permalink / raw)
  To: Stephen Hemminger, venkatesh bs; +Cc: dev, nd, nd

<snip>

> On Wed, 6 Jul 2022 19:07:54 +0530
> venkatesh bs <venki.bsv@gmail.com> wrote:
> 
> > Hi All,
> >
> > In multithreaded/Multicore  environment can we use
> > RTE_HASH_EXTRA_FLAGS_RW_CONCURRENCY_LF
> > independently,
This flag is about reader-writer concurrency (not writer-writer concurrency). Reader-writer concurrency will use lock-free algorithm allowing for the data plane to scale well.

> > or this flag should always be used with
> > RTE_HASH_EXTRA_FLAGS_MULTI_WRITER_ADD.
If you have multiple writers, you need to enable this flag. This is unrelated to RTE_HASH_EXTRA_FLAGS_RW_CONCURRENCY_LF.

> >
> > We are trying to create and access the hash table with
> > RTE_HASH_EXTRA_FLAGS_RW_CONCURRENCY_LF
> > only.
> > We are getting crashes in multi core environments , we debugged
> > nothing wrong in the application , everything looks good.
If the crash is happening while adding/deleting keys and there are multiple writers, enabling RTE_HASH_EXTRA_FLAGS_MULTI_WRITER_ADD might solve the problem.

> >
> > We call rte_hash_del_key() first and from the returned position we are
> > calling rte_hash_free_key_with_position().
> >
> > Please let me know if we missed something.
> >
> > Thanks,
> > Venkatesh.
> 
> Repeating same question doesn't get answer faster.
> 
> Read the code, it is fairly straightforward.
> 
> The multi-writer add means that writers take a lock.
> If doing lock free support then:
>   1. It is up to your application to use a single writer and/or
>      wrap writer calls in a lock.
> 
>   2. You need to use RCU mechanism to guarantee that no reader
>      will access a deleted entry. Something like:
> 
>      rte_hash_del_key()
>      synchronize_rcu()
>      rte_hash_free_key_with_position()
> 
>      You can use either the DPDK RCU library or the userspace RCU library.
>      Read that documentation, RCU is non-trivial change.
RCU is integrated in the hash library. You could use that as well. Look at ' rte_hash_rcu_qsbr_add' API for more details.

> 


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2022-07-08 17:52 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-06  3:45 clarification on RTE_HASH_EXTRA_FLAGS_RW_CONCURRENCY_LF flag venkatesh bs
2022-07-06 13:37 ` venkatesh bs
2022-07-06 14:21   ` venkatesh bs
2022-07-06 15:22   ` Stephen Hemminger
2022-07-08 17:52     ` Honnappa Nagarahalli

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).