> On 13.07.2021., at 18:41, satish amara <satishkam...@gmail.com> wrote:
> 
> Sync is needed. It's a question about the design of packet flow in  VPP. 
> Locks can be avoided if the packets in a flow are processed by the same 
> thread.  

You can use the handoff to make sure all packets belonging to specific flow or 
session end up on the same thread.

You can use bihash to store both thread_index and per-thread flow/session index 
in hash result. Bihash have per-bucket locks so it is safe to use single hash 
table from different workers.

After lookup you can simply compare lookup result thread_index with current 
thread index. if they are different you simply handoff packet to other thread, 
if they are the same you continue processing packets on the same thread.

After that you can build all your data structures as per-thread and avoid 
locking or atomics.

— 
Damjan


-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#19761): https://lists.fd.io/g/vpp-dev/message/19761
Mute This Topic: https://lists.fd.io/mt/84186832/21656
Group Owner: vpp-dev+ow...@lists.fd.io
Unsubscribe: https://lists.fd.io/g/vpp-dev/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to