Lines Matching refs:len

137 #define TCP_XMIT_TIMER_ASSERT(tp, len, th_flags)			\
138 KASSERT(((len) == 0 && ((th_flags) & (TH_SYN | TH_FIN)) == 0) ||\
145 long len, int tso);
153 struct tcpopt *to, long len, int tso)
161 hhook_data.len = len;
188 long len, recwin, sendwin;
276 len = 0;
303 len = ((long)ulmin(cwin,
306 len = ((long)ulmin(cwin, p->end - p->rxmit));
310 if (len > 0) {
315 min(len, tp->t_maxseg));
375 * in which case len is already set.
379 len = ((long)ulmin(sbavail(&so->so_snd), sendwin) -
389 len = ((long)ulmin(sbavail(&so->so_snd), tp->snd_wnd) -
392 * Don't remove this (len > 0) check !
393 * We explicitly check for len > 0 here (although it
396 * len above. Without this check, the computation
397 * of len is bungled by the optimizer.
399 if (len > 0) {
405 len = lmin(len, cwin);
427 off--, len++;
436 len = 0;
449 len = 0;
451 if (len <= 0) {
455 * len will be < 0. Otherwise, window shrank
468 len = 0;
479 /* len will be >= 0 after this point. */
480 KASSERT(len >= 0, ("[%s:%d]: len < 0", __func__, __LINE__));
550 if ((tp->t_flags & TF_TSO) && V_tcp_do_tso && len > tp->t_maxseg &&
561 if (SEQ_LT(p->rxmit + len, tp->snd_una + sbused(&so->so_snd)))
564 if (SEQ_LT(tp->snd_nxt + len, tp->snd_una +
573 * conditions when len is non-zero:
583 if (len) {
584 if (len >= tp->t_maxseg)
591 * note: the len + off check is almost certainly unnecessary.
595 len + off >= sbavail(&so->so_snd) &&
601 if (len >= tp->max_sndwnd / 2 && tp->max_sndwnd > 0)
738 if (len > 0) {
739 if (len >= tp->t_maxseg)
848 if (len + optlen + ipoptlen > tp->t_maxseg) {
881 len = 0;
882 } else if (len > max_len) {
884 len = max_len;
906 while (mb != NULL && max_len < len) {
939 len = 0;
940 } else if (len > max_len) {
942 len = max_len;
952 if ((off + len) < sbavail(&so->so_snd)) {
953 moff = len % max_len;
955 len -= moff;
964 if (len <= max_len) {
965 len = max_len;
981 len = tp->t_maxseg - optlen - ipoptlen;
987 KASSERT(len + hdrlen + ipoptlen <= IP_MAXPACKET,
988 ("%s: len > IP_MAXPACKET", __func__));
1003 KASSERT(len >= 0, ("[%s:%d]: len < 0", __func__, __LINE__));
1010 if (len) {
1014 if ((tp->t_flags & TF_FORCEDATA) && len == 1)
1019 TCPSTAT_ADD(tcps_sndrexmitbyte, len);
1022 TCPSTAT_ADD(tcps_sndbyte, len);
1045 mb = sbsndptr(&so->so_snd, off, len, &moff);
1047 if (len <= MHLEN - hdrlen - max_linkhdr) {
1048 m_copydata(mb, moff, (int)len,
1050 m->m_len += len;
1052 m->m_next = m_copy(mb, moff, (int)len);
1068 if ((off + len == sbused(&so->so_snd)) && !(flags & TH_SYN))
1145 if (len > 0 && SEQ_GEQ(tp->snd_nxt, tp->snd_max) &&
1146 !((tp->t_flags & TF_FORCEDATA) && len == 1)) {
1181 if (len || (flags & (TH_SYN|TH_FIN)) ||
1188 p->rxmit += len;
1189 tp->sackhint.sack_bytes_rexmit += len;
1249 tcp_signature_compute(m, 0, len, optlen,
1258 m->m_pkthdr.len = hdrlen + len; /* in6_cksum() need this */
1268 optlen + len, IPPROTO_TCP, 0);
1278 htons(sizeof(struct tcphdr) + IPPROTO_TCP + len + optlen));
1291 KASSERT(len > tp->t_maxseg - optlen,
1292 ("%s: len <= tso_segsz", __func__));
1298 KASSERT(len + hdrlen + ipoptlen - ipsec_optlen == m_length(m, NULL),
1300 __func__, len, hdrlen, ipoptlen, ipsec_optlen, m_length(m, NULL)));
1302 KASSERT(len + hdrlen + ipoptlen == m_length(m, NULL),
1304 __func__, len, hdrlen, ipoptlen, m_length(m, NULL)));
1308 hhook_run_tcp_est_out(tp, th, &to, len, tso);
1321 ipov->ih_len = htons(m->m_pkthdr.len /* - hdrlen + (th->th_off << 2) */);
1339 * m->m_pkthdr.len should have been set before checksum calculation,
1360 ip6->ip6_plen = htons(m->m_pkthdr.len - sizeof(*ip6));
1392 ip->ip_len = htons(m->m_pkthdr.len);
1453 tp->snd_nxt += len;
1484 } else if (len == 0 && sbavail(&so->so_snd) &&
1493 * 3) A -> B: ACK for #2, 0 len packet
1514 int xlen = len;
1522 tp->snd_max = tp->snd_nxt + len;
1545 p->rxmit -= len;
1546 tp->sackhint.sack_bytes_rexmit -= len;
1550 tp->snd_nxt -= len;
1558 TCP_XMIT_TIMER_ASSERT(tp, len, flags);