一 线程
单网卡单队列,worker模式下的线程情况:
![](https://img.haomeiwen.com/i1737506/dd44492d9c244af7.png)
二 线程堆栈
2.1 2号线程中断处理线程
2 Thread 0x7fe50b8cc700 (LWP 6558) "eal-intr-thread" 0x00007fe51ce3b257 in epoll_wait () from /lib64/libc.so.6
(gdb) thread 2
[Switching to thread 2 (Thread 0x7fe50b8cc700 (LWP 6558))]
#0 0x00007fe51ce3b257 in epoll_wait () from /lib64/libc.so.6
(gdb) where
#0 0x00007fe51ce3b257 in epoll_wait () from /lib64/libc.so.6
#1 0x00007fe51dce387c in eal_intr_thread_main () from /usr/local/lib64/librte_eal.so.21
#2 0x00007fe51d52514a in start_thread () from /lib64/libpthread.so.0
#3 0x00007fe51ce3af23 in clone () from /lib64/libc.so.6
中断线程执行主体eal_intr_thread_main()函数具体如下:
1、epoll_create()创建epoll模型。
2、将intr_pipe管道加入到epoll中。
3、遍历intr_sources链表,将所有UIO设备加入到epoll中。
4、在eal_intr_handle_interrupts()函数中,在一个for(;;)死循环中,调用epoll_wait()阻塞模式监听事件。如果有事件发生,则调用eal_intr_process_interrupts()函数,最终会调用到相应UIO设备注册的中断处理函数。
参见:https://www.cnblogs.com/MerlinJ/p/4104039.html
2.2 3号线程
3 Thread 0x7fe50b0cb700 (LWP 6559) "rte_mp_handle" 0x00007fe51d52f7b7 in recvmsg () from /lib64/libpthread.so.0
(gdb) thread 3
[Switching to thread 3 (Thread 0x7fe50b0cb700 (LWP 6559))]
#0 0x00007fe51d52f7b7 in recvmsg () from /lib64/libpthread.so.0
(gdb) where
#0 0x00007fe51d52f7b7 in recvmsg () from /lib64/libpthread.so.0
#1 0x00007fe51dcd18ec in mp_handle () from /usr/local/lib64/librte_eal.so.21
#2 0x00007fe51d52514a in start_thread () from /lib64/libpthread.so.0
#3 0x00007fe51ce3af23 in clone () from /lib64/libc.so.6
不知道干嘛的,在recvmsg什么消息.
2.3 4号线程
4 Thread 0x7fe50a8ca700 (LWP 6561) "suricata" 0x00007fe51d52ea07 in accept () from /lib64/libpthread.so.0
(gdb) thread 4
[Switching to thread 4 (Thread 0x7fe50a8ca700 (LWP 6561))]
#0 0x00007fe51d52ea07 in accept () from /lib64/libpthread.so.0
(gdb) where
#0 0x00007fe51d52ea07 in accept () from /lib64/libpthread.so.0
#1 0x00007fe51c9335f9 in socket_listener () from /usr/local/lib64/librte_telemetry.so.21
#2 0x00007fe51d52514a in start_thread () from /lib64/libpthread.so.0
#3 0x00007fe51ce3af23 in clone () from /lib64/libc.so.6
不知道在干嘛.
2.4 5号线程
5 Thread 0x7fe503be2700 (LWP 6562) "DPDKW-000" 0x00007fe516332c8c in eth_em_recv_scattered_pkts () from /usr/local/lib64/dpdk/pmds-21.0/librte_net_e1000.so.21.0
(gdb) thread 5
[Switching to thread 5 (Thread 0x7fe503be2700 (LWP 6562))]
#0 0x00007fe516332c8c in eth_em_recv_scattered_pkts () from /usr/local/lib64/dpdk/pmds-21.0/librte_net_e1000.so.21.0
(gdb) where
#0 0x00007fe516332c8c in eth_em_recv_scattered_pkts () from /usr/local/lib64/dpdk/pmds-21.0/librte_net_e1000.so.21.0
#1 0x00000000008666c3 in rte_eth_rx_burst (nb_pkts=8, rx_pkts=0x7fe503bdf7d0, queue_id=0, port_id=0) at /usr/local/include/rte_ethdev.h:4849
#2 ReceiveDpdkLoop (data=0x17b2161c0, slot=<optimized out>, tv=<optimized out>) at source-dpdk.c:281
#3 0x00000000008b8158 in TmThreadsSlotPktAcqLoop (td=0x6addf00) at tm-threads.c:360
#4 0x00007fe51d52514a in start_thread () from /lib64/libpthread.so.0
#5 0x00007fe51ce3af23 in clone () from /lib64/libc.so.6
收包线程?
网友评论