Yulilang, > Thanks for the detailed response. > > However, from the experiment I did, I see the same packet being processed by > two threads. That is why I asked this question. Maybe I made some mistakes, > here is what I did: > > - In vlib_main_or_worker_loop function, I print out all pending frames here, > as well as the thread_index of them, and the node name. > - I start the vpp with 4 worker threads, and set up SNAT according to the > progressive tutorial. > - I run iperf that go through the SNAT. > > The printed information shows that, each TCP packet from the inside to the > outside of the SNAT will go through the ethernet-input and snat-in2out. But > the thread_index at the ethernet-input is 2, while the thread_index at > snat-in2out is 1. > > Is the above expected?
Yes. To avoid locking the SNAT plugin splits the "state space" across the set of workers and does hand off between workers to ensure to match of the right packet with the worker owning the state for that session. Best regards, Ole
signature.asc
Description: Message signed with OpenPGP
_______________________________________________ vpp-dev mailing list vpp-dev@lists.fd.io https://lists.fd.io/mailman/listinfo/vpp-dev