免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 2690 | 回复: 2
打印 上一主题 下一主题

[网络子系统] 何时调用tcp_any_retrans_done或该函数的意图是什么 [复制链接]

论坛徽章:
1
IT运维版块每日发帖之星
日期:2015-12-20 06:20:00
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2017-07-21 12:34 |只看该作者 |倒序浏览
哪位大哥能帮忙解释一下这个函数的用意是什么,代码里有很大的一段注释,但是感觉还是不很明白。说真的,虽然kernel说20%的是注释,但是感觉那些注释都写的不是很好懂
  1. /* Undo procedures. */

  2. /* We can clear retrans_stamp when there are no retransmissions in the
  3. * window. It would seem that it is trivially available for us in
  4. * tp->retrans_out, however, that kind of assumptions doesn't consider
  5. * what will happen if errors occur when sending retransmission for the
  6. * second time. ...It could the that such segment has only
  7. * TCPCB_EVER_RETRANS set at the present time. It seems that checking
  8. * the head skb is enough except for some reneging corner cases that
  9. * are not worth the effort.
  10. *
  11. * Main reason for all this complexity is the fact that connection dying
  12. * time now depends on the validity of the retrans_stamp, in particular,
  13. * that successive retransmissions of a segment must not advance
  14. * retrans_stamp under any conditions.
  15. */
  16. static bool tcp_any_retrans_done(const struct sock *sk)
  17. {
  18.     const struct tcp_sock *tp = tcp_sk(sk);
  19.     struct sk_buff *skb;

  20.     if (tp->retrans_out)
  21.         return true;

  22.     skb = tcp_write_queue_head(sk);
  23.     if (unlikely(skb && TCP_SKB_CB(skb)->sacked & TCPCB_EVER_RETRANS))
  24.         return true;

  25.     return false;
  26. }
复制代码


论坛徽章:
1
IT运维版块每日发帖之星
日期:2015-12-20 06:20:00
2 [报告]
发表于 2017-07-24 12:20 |只看该作者
人工置顶。。。。

论坛徽章:
7
IT运维版块每日发帖之星
日期:2016-05-27 06:20:00IT运维版块每日发帖之星
日期:2016-06-09 06:20:00操作系统版块每日发帖之星
日期:2016-06-12 06:20:00程序设计版块每日发帖之星
日期:2016-06-12 06:20:00操作系统版块每日发帖之星
日期:2016-06-13 06:20:00IT运维版块每日发帖之星
日期:2016-06-17 06:20:002015-2016NBA季后赛纪念章
日期:2016-06-28 17:42:27
3 [报告]
发表于 2017-07-24 14:17 |只看该作者
判断重传是否完成吧
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP