TCP堆栈发送Mbuf链:循环在哪里?

时间:2016-08-10 22:40:08

标签: linux sockets tcp bsd

我是BSD TCP堆栈代码的新手,但我们有一个应用程序在用户模式下转换并使用BSD TCP堆栈代码。我正在调试此应用程序在奇怪的情况下将保留(或不发送数据)的问题。我在下面列出了部分相关的callstack。

sosend中致电uipc_socket之前,我已确认top_m0->m_pkthdr.len中存储的长度是否正确。该链应该包含12个TCP有效载荷,每个有效载荷为1368字节。最后,我的回调函数只调用了10次而不是12次,而10个较小的mbuf链在组合后包含较少的有效负载数据。

我检查了调用堆栈中的每个函数,我无法在任何地方找到一个循环,如我所料,从mbuf链的头部到末尾迭代。我可以找到的循环只是do ... while() sosend_generic中的嵌套uipc_socket.c循环,但是,我的代码路径只执行循环一次,因为resid立即设置为0 (uio == NULL)检查后。

\#2  0x00007ffff1acb868 in ether_output_frame (ifp=0xbf5f290, m=0x7ffff7dfeb00) at .../freebsd_plebnet/net/if_ethersubr.c:457

\#3  0x00007ffff1acb7ef in ether_output (ifp=0xbf5f290, m=0x7ffff7dfeb00, dst=0x7fffffff2c8c, ro=0x7fffffff2c70) at .../freebsd_plebnet/net/if_ethersubr.c:429

\#4  0x00007ffff1ada20b in ip_output (m=0x7ffff7dfeb00, opt=0x0, ro=0x7fffffff2c70, flags=0, imo=0x0, inp=0x7fffd409e000) at .../freebsd_plebnet/netinet/ip_output.c:663
\#5  0x00007ffff1b0743b in tcp_output (tp=0x7fffd409c000) at /scratch/vindu/ec_intg/ims/src/third-party/nse/nsnet.git/freebsd_plebnet/netinet/tcp_output.c:1288

\#6  0x00007ffff1ae2789 in tcp_usr_send (so=0x7fffd40a0000, flags=0, m=0x7ffeda1b7270, nam=0x0, control=0x0, td=0x7ffff1d5f3d0) at .../freebsd_plebnet/netinet/tcp_usrreq.c:882

\#7  0x00007ffff1a93743 in sosend_generic (so=0x7fffd40a0000, addr=0x0, uio=0x0, top=0x7ffeda1b7270, control=0x0, flags=128, td=0x7ffff1d5f3d0) at .../freebsd_plebnet/kern/uipc_socket.c:1390

\#8  0x00007ffff1a9387d in sosend (so=0x7fffd40a0000, addr=0x0, uio=0x0, top=0x7ffeda1b7270, control=0x0, flags=128, td=0x7ffff1d5f3d0) at .../freebsd_plebnet/kern/uipc_socket.c:1434

0 个答案:

没有答案