Hi Sastry, Inline.
> On May 25, 2021, at 7:44 AM, Sastry Sista <sastry.si...@gmail.com> wrote: > > Hi Florin, > Thank you. > > Let me be very specific and focused topic: > > I have just single worker but having multiple TCP sessions. So, I will poll > on vppcom_mq_epoll_fd() for all notifications. So, notifications are for me > to do data read/write also? The notification is that the vcl worker got new events. So to grab the events, you’ll need to use something like vppcom_epoll_wait() with 0 timeout. > If there is a data on shm for any session, we will get notification on mq and > I need to check which session_handle I got this event for and I need to get > data on shm using session_handle ? No need to do that manually, instead you use vppcom_epoll_wait to do the parsing and matching of events to the session_handles/fds the app tracks. > > My question is, once EPOLLIN happened on mq and we get mq_event but, how do I > map it to session_handle if I have many session_handles? The steps would be: 1. create vcl_epoll_sh with vppcom_epoll_create and add all of the worker’s fd/sh to it using vpcom_epoll_ctl 2. grab mqs_epfd using vppcom_mq_epoll_fd and add it to the worker’s linux epfd (created using epoll_create) 2. when linux epoll notifies the app that mq_epfds got EPOLLIN call a custom handler wherein vppcom_epoll_wait(vcl_epoll_sh, vcl_events, maxevents, 0 /* timeout*/) is called and all events are grabbed into vcl_events. Regards, Florin > > anyway vppcom_session_read(session_handle,....) === this gives me data for > that TCP session. > > I hope that we do not need epoll_ctl APIs? > > With Regards > Sastry > >
-=-=-=-=-=-=-=-=-=-=-=- Links: You receive all messages sent to this group. View/Reply Online (#19467): https://lists.fd.io/g/vpp-dev/message/19467 Mute This Topic: https://lists.fd.io/mt/82992940/21656 Group Owner: vpp-dev+ow...@lists.fd.io Unsubscribe: https://lists.fd.io/g/vpp-dev/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-