DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] Safe practices for adding to rte_table_hash_lru
@ 2014-09-24 19:38 Saha, Avik (AWS)
  2014-09-24 20:11 ` Neil Horman
  2014-09-25  8:03 ` Gray, Mark D
  0 siblings, 2 replies; 3+ messages in thread
From: Saha, Avik (AWS) @ 2014-09-24 19:38 UTC (permalink / raw)
  To: dev

Hey guys
   Is it safe to add an entry to the rte_table_hash while the pipeline is being run - for instance if I were to try and add an entry on a port reader action when the packet enters the pipeline?

Thanks
Avik

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

* Re: [dpdk-dev] Safe practices for adding to rte_table_hash_lru
  2014-09-24 19:38 [dpdk-dev] Safe practices for adding to rte_table_hash_lru Saha, Avik (AWS)
@ 2014-09-24 20:11 ` Neil Horman
  2014-09-25  8:03 ` Gray, Mark D
  1 sibling, 0 replies; 3+ messages in thread
From: Neil Horman @ 2014-09-24 20:11 UTC (permalink / raw)
  To: Saha, Avik (AWS); +Cc: dev

On Wed, Sep 24, 2014 at 07:38:49PM +0000, Saha, Avik (AWS) wrote:
> Hey guys
>    Is it safe to add an entry to the rte_table_hash while the pipeline is being run - for instance if I were to try and add an entry on a port reader action when the packet enters the pipeline?
> 
> Thanks
> Avik
> 

No, none of the table implementations are currently thread safe.  They all
assume that you will do your own locking between threads and processes.  There
were a few patches to support thread safety recently, but they are being
reworked currently.

Neil

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

* Re: [dpdk-dev] Safe practices for adding to rte_table_hash_lru
  2014-09-24 19:38 [dpdk-dev] Safe practices for adding to rte_table_hash_lru Saha, Avik (AWS)
  2014-09-24 20:11 ` Neil Horman
@ 2014-09-25  8:03 ` Gray, Mark D
  1 sibling, 0 replies; 3+ messages in thread
From: Gray, Mark D @ 2014-09-25  8:03 UTC (permalink / raw)
  To: Saha, Avik (AWS), dev

> 
> Hey guys
>    Is it safe to add an entry to the rte_table_hash while the pipeline is being
> run - for instance if I were to try and add an entry on a port reader action
> when the packet enters the pipeline?

If the table is part of the pipeline, it is not safe. i.e. the table is not threadsafe.

You can use a control message ring to add entries to the table in an 
asynchronous manner. Your main dpdk loop would then periodically handle
these messages. There are examples of this in Intel DPDK vSwitch (https://github.com/01org/dpdk-ovs)
and also, I think, in the DPDK ip_pipeline sample application.

> 
> Thanks
> Avik

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

end of thread, other threads:[~2014-09-25  7:58 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-09-24 19:38 [dpdk-dev] Safe practices for adding to rte_table_hash_lru Saha, Avik (AWS)
2014-09-24 20:11 ` Neil Horman
2014-09-25  8:03 ` Gray, Mark D

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).