Hi Florin, Just converted the app to edge triggered. And it's working great. Thanks!
-Kyle On 3/2/22, 6:23 PM, "Florin Coras" <fcoras.li...@gmail.com> wrote: Hi Kyle, Is the app by chance trying to do epoll in level trigger mode? If yes, support for it was pushed in sometime around 21.06 so the code you are running might be missing some features. It’s also less tested when compared with edge trigger. Conversely, if the app's running epoll in edge trigger mode, make sure it drains the buffers, i.e., reads until it gets an EAGAIN. UDP with LD_PRELOAD is part of our CI (see here [1]) but compared to your use case iperf “connects” the udp sessions. Regards, Florin [1] https://git.fd.io/vpp/tree/test/test_vcl.py#n783 > On Mar 2, 2022, at 2:46 PM, Kyle Upton (kyupton) via lists.fd.io <kyupton=cisco....@lists.fd.io> wrote: > > Hi, > > I have a simple UDP recvfrom() application (using LD_PRELOAD). When I just use recvfrom(), I can receive packets played from a small PCAP file. > However, when I wrap the recvfrom() in an epoll_wait(), I only receive one packet. The second packet appears to be in the Rx fifo (tail is greater than head). Subsequent PCAP replays show the tail increasing by the size of the packets. > > VPP release is 21.06 > > DBGvpp# show app server > Connection App Wrk > [0:0][CT:U] 0.0.0.0:2055->0.0.0.0:0 ldp-83368-app 0 > [0:1][U] 0.0.0.0:2055->0.0.0.0:0 ldp-83368-app 0 > > root@3355a029760b:/opt/project/vpp/vcl# VCL_DEBUG=2 LDP_DEBUG=2 LD_PRELOAD=/opt/project/vpp/vpp-repo/build-root/install-vpp_debug-native/vpp/lib/libvcl_ldpreload.so ./udp_rx > VCL<83368>: configured VCL debug level (2) from VCL_DEBUG! > ldp<83368>: fd 3: calling libc_close > VCL<83368>: allocated VCL heap = 0x7f2eb0cf2000, size 268435456 (0x10000000) > VCL<83368>: configured app_scope_global (1) > VCL<83368>: configured app_scope_local (1) > VCL<83368>: configured app-socket-api (/var/run/vpp/app_ns_sockets/default) > VCL<83368>: completed parsing vppcom config! > ldp<83368>: fd 3: calling libc_close > ldp<83368>: calling libc_socket > ldp<83368>: fd 3: calling libc_connect(): addr 0x7ffcb7750368, len 110 > vppcom_app_create:1377: vcl<83368:0>: app_name 'ldp-83368-app', my_client_index 1 (0x1) > ldp<83368>: configured LDP debug level (2) from env var LDP_DEBUG! > ldp<83368>: LDP initialization: done! > ldp_constructor:2690: LDP<83368>: LDP constructor: done! > ldp<83368>: calling vls_create: proto 1 (UDP), is_nonblocking 0 > vppcom_session_create:1436: vcl<83368:0>: created session 0 > Created a socket with fd: 32 > ldp<83368>: fd 32 vlsh 0, cmd 3 > socket flags are: 2 > ldp<83368>: fd 32 vlsh 0, cmd 4 > ldp<83368>: fd 32: calling vls_bind: vlsh 0, addr 0x7ffcb774f500, len 16 > vppcom_session_bind:1571: vcl<83368:0>: session 0 handle 0: binding to local IPv4 address 0.0.0.0 port 2055, proto UDP > vppcom_session_listen:1603: vcl<83368:0>: session 0: sending vpp listen request... > vcl_session_app_add_segment_handler:1033: vcl<83368:0>: mapped new segment '14609-27' size 134217728 > vcl_session_bound_handler:665: vcl<83368:0>: session 0 [0x1]: listen succeeded! > ldp<83368>: fd 32: returning 0 > vppcom_epoll_create:2668: vcl<83368:0>: Created vep_idx 1 > ldp<83368>: epoll_create epfd 33 vlsh 1 > ldp<83368>: epfd 33 ep_vlsh 1, fd 32 vlsh 0, op 1 > ldp<83368>: epfd 33: calling vls_epoll_ctl: ep_vlsh 1 op 1, vlsh 0, event 0x7ffcb774f4f4 > vppcom_epoll_ctl:2788: vcl<83368:0>: EPOLL_CTL_ADD: vep_sh 1, sh 0, events 0x1, data 0x20! > Let us wait for a remote client to send some data > About to epoll_wait() > > fd=32; events: EPOLLIN > Received data (len 132 bytes): > About to epoll_wait() > > > DBGvpp# show session verbose 2 > [0:0][CT:U] 0.0.0.0:2055->0.0.0.0:0 LISTEN > [0:1][U] 0.0.0.0:2055->0.0.0.0:0 LISTEN > index 0 flags: OWNS_PORT, LISTEN > Rx fifo: cursize 1073 nitems 1048576 has_event 1 min_alloc 65536 > head 177 tail 1250 segment manager 3 > vpp session 1 thread 0 app session 0 thread 0 > ooo pool 0 active elts newest 4294967295 > Tx fifo: cursize 0 nitems 1048576 has_event 0 min_alloc 65536 > head 0 tail 0 segment manager 3 > vpp session 1 thread 0 app session 0 thread 0 > ooo pool 0 active elts newest 0 > Thread 0: active sessions 2 > > > >
-=-=-=-=-=-=-=-=-=-=-=- Links: You receive all messages sent to this group. View/Reply Online (#20945): https://lists.fd.io/g/vpp-dev/message/20945 Mute This Topic: https://lists.fd.io/mt/89513626/21656 Mute #vpp-hoststack:https://lists.fd.io/g/vpp-dev/mutehashtag/vpp-hoststack Group Owner: vpp-dev+ow...@lists.fd.io Unsubscribe: https://lists.fd.io/g/vpp-dev/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-