Hi Florin, Many thanks for your help. I will think about it ) I think, I'll create right thread pool for transit sessions. Unfortunatelly, session_lookup_connection_wt4/6 is not work for me. I thought that it was not intended for transit connections. At now VPP crashes when I call it. Maybe it my mistake, I will look at it again and write later about results. As about memcpy for &tc0->connection, it's for tracing.
Best regards, Aleksander On Fri, Aug 24, 2018 at 07:04 PM, Florin Coras wrote: > > Hi Aleksander, > > The session layer session lookup tables lower are used for transport > connections that are terminated in vpp. They can be used to store any > connection but, as you’ve already figured out, they’ve been written to > work with sessions and transport connections. Moreover, session lookup > functions do more than just exact session matching, i.e., if exact > matching fails, they try listener matching (wildcarded source ip/port) and > session rules matching (mask-match-action lookup table). > > If you’re looking for speed, and what we have is too much overhead for > you, one thing you could do is to reuse the session tables and then write > your own, optimized lookup functions. Another option is to directly use > the underlying hash table data structure, the bihash, and then build your > own CRUD and lookup infrastructure around it, based on all the examples we > have in vpp. ACL and NAT, to name a few, do that already. > > If the session lookup tables is what you were looking for, then I’d > recommend: > - allocating sessions/connections on the right thread pool instead of > using main thread, 0, exclusively. This way you won’t need to lock the > session/tcp pools if you have multiple workers > - do the lookup using session_lookup_connection_wt4/6 and provide the > thread on which you’re doing the lookup > - I don’t understand the logic towards the end of the snippet of code you > provided. I suspect that only on the “tcon0 == 0” branch you want to add > the new connection to the session table, so call > session_lookup_add_connection (&tc0->connection, session_handle(s0)) only > on that branch. No need to do the memcpy, use &tc0->connection. > > Hope this helps, > Florin >
-=-=-=-=-=-=-=-=-=-=-=- Links: You receive all messages sent to this group. View/Reply Online (#10289): https://lists.fd.io/g/vpp-dev/message/10289 Mute This Topic: https://lists.fd.io/mt/24943132/21656 Group Owner: vpp-dev+ow...@lists.fd.io Unsubscribe: https://lists.fd.io/g/vpp-dev/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-