Hi Sastry, 

Inline.

> On May 21, 2021, at 11:22 AM, Sastry Sista <sastry.si...@gmail.com> wrote:
> 
> Hi Florin,
>          Gone through your old mails on eventfd of mq and given me decent 
> inputs.
> vppcom_mq_epoll_fd() is returning mq_epfd which I can use for my app dispatch 
> linux epoll. But, My concern is, Can I use this mq_epfd for all my TCP 
> sessions i.e single mq for multiple TCP sessions? I have single worker but 
> multiple TCP sessions.

Yes. If you need to mix linux sockets and vcl sessions you’ll have to rely on 
eventfd notifications for the mq. For more details check how epoll is 
implemented in ldp.c 

> 
> Second, Is it that single shared memory rx/tx channel for multiple TCP 
> sessions data? If thats the case, I need to manage data per session right? 
> like vcl_worker_t internal data structs that I need to use?

The mq is used for io/ctrl events not for data exchanges. VCL does the work of 
tracking sessions for you. If your app has multiple workers, then each worker 
should register itself with vcl (vppcom_worker_register). 

> 
> Please correct my doubts:
> 
> 1. If I have single TCP session, then  vppcom_mq_epoll_fd() can return fd 
> which I can use in my app dispatch loop where linux epoll is used?

If you have single tcp session and no linux sessions, just use vppcom_epoll_*. 
If you need to support both, check ldp.c. The idea is that you can add the mq’s 
eventfd (or indirectly through mqs_epfd) to linux epoll and whenever you get an 
event on it, you can retrieve the vcl sessions with events using 
vppcom_epoll_wait with 0 timeout. 

> 2. If I have multiple TCP sessions, then still use same  single 
> vppcom_mq_epoll_fd() for all session notifications?

Yes, the message queue's eventfd acts as a signal that one or multiple sessions 
in vcl have events. 

Regards,
Florin

> 
> With Regards
> Sastry 
> 
> 

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#19435): https://lists.fd.io/g/vpp-dev/message/19435
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]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to