Lines Matching +full:always +full:- +full:wait +full:- +full:for +full:- +full:ack

1 /*-
2 * SPDX-License-Identifier: BSD-3-Clause
21 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
72 * for human representation. To check a bit we
73 * take and shift over by 1 minus the value (1-8).
121 tcp_seq last_sack_ack; /* Most recent/largest sacked ack */
135 #define SEGQ_EMPTY(tp) TAILQ_EMPTY(&(tp)->t_segq)
151 uint64_t end; /* End if not open-range req */
171 * Change Query responses for a stack switch we create a structure
176 * - sendmap
177 * - timers
178 * - rack_times
180 * For the sendmap query the caller fills in the
190 * For timers the standard PACE_TMR_XXXX flags are returned indicating
202 * is unfilled. This may mean that a time is off by a micro-second
206 * from the old stack to the new stack as possible. Though not always
231 #define SNDMAP_TLP 0x000080/* segment sent as tail-loss-probe */
311 #define t_zero_size (sizeof(struct tcpcb) - \
320 /* HPTS. Used by BBR and Rack stacks. See tcp_hpts.c for more info. */
330 #define HPTS_CPU_NONE ((uint16_t)-1)
342 t_delayed_ack: 7, /* Delayed ack variable */
354 uint32_t snd_cwnd; /* congestion-controlled window */
365 int t_srtt; /* smoothed round-trip time */
366 int t_rttvar; /* variance in round-trip time */
368 u_char snd_scale; /* window scaling for send window */
369 u_char rcv_scale; /* window scaling for recv window */
378 uint32_t snd_ssthresh; /* snd_cwnd size threshold for
379 * for slow start exponential to
383 tcp_seq snd_wl2; /* window update seg ack number */
390 tcp_seq snd_recover; /* for use in NewReno Fast Recovery */
406 u_int t_pmtud_saved_maxseg; /* pre-blackhole MSS */
416 int t_sndzerowin; /* zero-window updates sent */
418 u_int t_badrxtwin; /* window for retransmit recovery */
428 int t_rcvoopack; /* out-of-order packets received */
443 int64_t t_pacing_rate; /* bytes / sec, -1 => unlimited */
448 struct statsblob *t_stats; /* Per-connection stats */
453 tcp_seq gput_ack; /* Inbound measurement ack */
461 uint32_t t_dsack_tlp_bytes; /* dsack bytes received for TLPs sent */
468 sbintime_t t_challenge_ack_end; /* End of the challenge ack epoch */
482 struct osd t_osd; /* storage for Khelp module data */
545 /* Flags for tcp functions */
554 * you return non-zero (an error number) to say no you can't.
560 * for LRO. There are two flags that the previous
570 * to move the timers to the correct format for your stack.
574 * for one of three entries and can also state to the old
575 * stack its support for the INP_MBUF_ACKCMP and
577 * queued ack's without that statement the old stack will
579 * can be made for information by the new stacks are:
585 * of the condtion (ptr == &tp->t_fb_ptr) will be
593 * TCP_QUERY_SENDMAP - Query of outstanding data.
594 * TCP_QUERY_TIMERS_UP - Query about running timers.
595 * TCP_SUPPORTED_LRO - Declaration in req_param of
598 * TCP_QUERY_RACK_TIMES - Enquire about various timestamps
659 #define tptoinpcb(tp) (&(tp)->t_inpcb)
660 #define tptosocket(tp) (tp)->t_inpcb.inp_socket
666 * Drop in replacement for the default stack.
676 rv = tp->t_fb->tfb_tcp_output(tp); in tcp_output()
678 KASSERT(tp->t_fb->tfb_flags & TCP_FUNC_OUTPUT_CANDROP, in tcp_output()
680 tp->t_fb->tfb_tcp_block_name, tp)); in tcp_output()
681 tp = tcp_drop(tp, -rv); in tcp_output()
691 * Always returns unlocked, handles drop request from advanced stacks.
692 * Always returns positive error code.
702 rv = tp->t_fb->tfb_tcp_output(tp); in tcp_output_unlock()
704 KASSERT(tp->t_fb->tfb_flags & TCP_FUNC_OUTPUT_CANDROP, in tcp_output_unlock()
706 tp->t_fb->tfb_tcp_block_name, tp)); in tcp_output_unlock()
707 rv = -rv; in tcp_output_unlock()
719 * Always returns locked. It is caller's responsibility to run tcp_drop()!
734 rv = tp->t_fb->tfb_tcp_output(tp); in tcp_output_nodrop()
735 KASSERT(rv >= 0 || tp->t_fb->tfb_flags & TCP_FUNC_OUTPUT_CANDROP, in tcp_output_nodrop()
737 tp->t_fb->tfb_tcp_block_name, tp)); in tcp_output_nodrop()
754 tcp_output_retval = -tcp_output_retval; in tcp_unlock_or_drop()
765 tcp_packets_this_ack(struct tcpcb *tp, tcp_seq ack) in tcp_packets_this_ack() argument
767 return ((ack - tp->snd_una) / tp->t_maxseg + in tcp_packets_this_ack()
768 ((((ack - tp->snd_una) % tp->t_maxseg) != 0) ? 1 : 0)); in tcp_packets_this_ack()
773 * Flags and utility macros for the t_flags field.
775 #define TF_ACKNOW 0x00000001 /* ack peer immediately */
776 #define TF_DELACK 0x00000002 /* ack, but try to delay it */
788 #define TF_PREVVALID 0x00002000 /* saved values for bad rxmit valid
824 #define BYTES_THIS_ACK(tp, th) (th->th_ack - tp->snd_una)
827 * Flags for the t_oobflags field.
833 * Flags for the extended TCP flags field, t_flags2
838 #define TF2_LOG_AUTO 0x00000008 /* Session is auto-logging. */
839 #define TF2_DROP_AF_DATA 0x00000010 /* Drop after all data ack'd */
840 #define TF2_ECN_PERMIT 0x00000020 /* connection ECN-ready */
849 #define TF2_MBUF_L_ACKS 0x00004000 /* large mbufs for ack compression */
850 #define TF2_MBUF_ACKCMP 0x00008000 /* mbuf ack compression ok */
857 #define TF2_NO_ISS_CHECK 0x00400000 /* Don't check SEG.ACK against ISS */
864 * The binary order of the to_flags is relevant for packing of the
873 #define TOF_SIGNATURE 0x0040 /* TCP-MD5 signature option (RFC2385) */
880 u_char *to_signature; /* pointer to the TCP-MD5 signature */
890 * Flags for tcp_dooptions.
892 #define TO_SYN 0x01 /* parse SYN-only options */
895 uint32_t hc_mtu; /* MTU for this path */
900 uint32_t hc_sendpipe; /* outbound delay-bandwidth product */
901 uint32_t hc_recvpipe; /* inbound delay-bandwidth product */
909 * The smoothed round-trip time and estimated variance
911 * For convenience, these scales are also used in smoothing the average
912 * (smoothed = (1/scale)sample + ((scale-1)/scale)smoothed).
917 #define TCP_RTT_SCALE 32 /* multiplier for srtt; 5 bits frac. */
918 #define TCP_RTT_SHIFT 5 /* shift for srtt; 5 bits frac. */
919 #define TCP_RTTVAR_SCALE 16 /* multiplier for rttvar; 4 bits */
920 #define TCP_RTTVAR_SHIFT 4 /* shift for rttvar; 4 bits */
928 * 1 extra tick because of +-1/2 tick uncertainty in the
936 * which results in inappropriately large RTO values for very
940 max((tp)->t_rttmin, (((tp)->t_srtt >> (TCP_RTT_SHIFT - TCP_DELTA_SHIFT)) \
941 + (tp)->t_rttvar) >> TCP_DELTA_SHIFT)
973 uint64_t tcps_sndacks; /* ack-only packets sent */
976 uint64_t tcps_sndwinup; /* window update-only packets sent */
984 uint64_t tcps_rcvreassfull; /* packets dropped for no reass space */
986 uint64_t tcps_rcvduppack; /* duplicate-only packets received */
987 uint64_t tcps_rcvdupbyte; /* duplicate-only bytes received */
989 uint64_t tcps_rcvpartdupbyte; /* dup. bytes in part-dup. packets */
990 uint64_t tcps_rcvoopack; /* out-of-order packets received */
991 uint64_t tcps_rcvoobyte; /* out-of-order bytes received */
997 uint64_t tcps_rcvacktoomuch; /* rcvd acks for unsent data */
998 uint64_t tcps_rcvackpack; /* rcvd ack packets */
1002 uint64_t tcps_predack; /* times hdr predict ok for acks */
1003 uint64_t tcps_preddat; /* times hdr predict ok for data pkts */
1012 uint64_t tcps_badsyn; /* bogus SYN, e.g. premature ACK */
1022 uint64_t tcps_sc_bucketoverflow;/* syncache per-bucket limit hit */
1027 uint64_t tcps_sc_badack; /* removed due to bad ACK */
1076 uint64_t tcps_tw_recycles; /* Times time-wait was recycled. */
1077 uint64_t tcps_tw_resets; /* Times time-wait sent a reset. */
1078 uint64_t tcps_tw_responds; /* Times time-wait sent a valid ack. */
1081 uint64_t tcps_ace_nect; /* ACE SYN packet with Non-ECT */
1099 /* SEG.ACK validation failures */
1100 uint64_t tcps_rcvghostack; /* received ACK for data never sent */
1101 uint64_t tcps_rcvacktooold; /* received ACK for data too long ago */
1104 uint64_t _pad[1]; /* 1 TBD placeholder for STABLE */
1115 * In-kernel consumers can use these accessor macros directly to update
1144 #define TCPSTATES_DEC(state) counter_u64_add(V_tcps_states[state], -1)
1169 * TCB structure exported to user-land via sysctl(3).
1175 * (s) - used by userland utilities in src
1176 * (p) - used by utilities in ports
1177 * (3) - is known to be used by third party software not in ports
1178 * (n) - no known usage
1223 * TCP function information (name-to-id mapping, aliases, and refcnt)
1224 * exported to user-land via sysctl(3).
1234 * Identifiers for TCP sysctl nodes
1236 #define TCPCTL_DO_RFC1323 1 /* use RFC-1323 extensions */
1244 #define TCPCTL_KEEPINIT 10 /* timeout for establishing syn */
1246 #define TCPCTL_DELACKTIME 12 /* time before sending delayed ACK */
1247 #define TCPCTL_V6MSSDFLT 13 /* MSS default for IPv6 */
1411 int register_tcp_functions(struct tcp_function_block *blk, int wait);
1413 int wait, const char *names[], int *num_names);
1415 const char *name, int wait);
1495 extern struct protosw tcp_protosw; /* shared for TOE */
1496 extern struct protosw tcp6_protosw; /* shared for TOE */
1569 tp->t_flags2 &= ~(TF2_SUPPORTS_MBUFQ| in tcp_lro_features_off()
1580 th->th_seq = ntohl(th->th_seq); in tcp_fields_to_host()
1581 th->th_ack = ntohl(th->th_ack); in tcp_fields_to_host()
1582 th->th_win = ntohs(th->th_win); in tcp_fields_to_host()
1583 th->th_urp = ntohs(th->th_urp); in tcp_fields_to_host()
1590 th->th_seq = htonl(th->th_seq); in tcp_fields_to_net()
1591 th->th_ack = htonl(th->th_ack); in tcp_fields_to_net()
1592 th->th_win = htons(th->th_win); in tcp_fields_to_net()
1593 th->th_urp = htons(th->th_urp); in tcp_fields_to_net()