FreeBSD kernel IPv4 code
rack_bbr_common.c File Reference
#include <sys/cdefs.h>
#include "opt_inet.h"
#include "opt_inet6.h"
#include "opt_ipsec.h"
#include "opt_tcpdebug.h"
#include "opt_ratelimit.h"
#include "opt_kern_tls.h"
#include <sys/param.h>
#include <sys/arb.h>
#include <sys/module.h>
#include <sys/kernel.h>
#include <sys/malloc.h>
#include <sys/mbuf.h>
#include <sys/proc.h>
#include <sys/qmath.h>
#include <sys/socket.h>
#include <sys/socketvar.h>
#include <sys/sysctl.h>
#include <sys/systm.h>
#include <sys/tree.h>
#include <sys/refcount.h>
#include <sys/queue.h>
#include <sys/smp.h>
#include <sys/kthread.h>
#include <sys/lock.h>
#include <sys/mutex.h>
#include <sys/tim_filter.h>
#include <sys/time.h>
#include <vm/uma.h>
#include <sys/kern_prefetch.h>
#include <net/route.h>
#include <net/vnet.h>
#include <net/ethernet.h>
#include <net/bpf.h>
#include <netinet/in.h>
#include <netinet/in_kdtrace.h>
#include <netinet/in_pcb.h>
#include <netinet/ip.h>
#include <netinet/ip_icmp.h>
#include <netinet/icmp_var.h>
#include <netinet/ip_var.h>
#include <netinet/ip6.h>
#include <netinet6/in6_pcb.h>
#include <netinet6/ip6_var.h>
#include <netinet/tcp.h>
#include <netinet/tcp_fsm.h>
#include <netinet/tcp_seq.h>
#include <netinet/tcp_timer.h>
#include <netinet/tcp_var.h>
#include <netinet/tcpip.h>
#include <netinet/tcp_hpts.h>
#include <netinet/tcp_lro.h>
#include <netinet/cc/cc.h>
#include <netinet/tcp_log_buf.h>
#include <netinet/tcp_fastopen.h>
#include <netipsec/ipsec_support.h>
#include <net/if.h>
#include <net/if_var.h>
#include <netinet/udp.h>
#include <netinet/udp_var.h>
#include <machine/in_cksum.h>
#include "rack_bbr_common.h"

Go to the source code of this file.

Macros

#define TCPSTATES   /* for logging */
 

Functions

 __FBSDID ("$FreeBSD$")
 
static int ctf_get_enet_type (struct ifnet *ifp, struct mbuf *m)
 
int ctf_process_inbound_raw (struct tcpcb *tp, struct socket *so, struct mbuf *m, int has_pkt)
 
int ctf_do_queued_segments (struct socket *so, struct tcpcb *tp, int have_pkt)
 
uint32_t ctf_outstanding (struct tcpcb *tp)
 
uint32_t ctf_flight_size (struct tcpcb *tp, uint32_t rc_sacked)
 
void ctf_do_dropwithreset (struct mbuf *m, struct tcpcb *tp, struct tcphdr *th, int32_t rstreason, int32_t tlen)
 
void ctf_ack_war_checks (struct tcpcb *tp, uint32_t *ts, uint32_t *cnt)
 
int _ctf_drop_checks (struct tcpopt *to, struct mbuf *m, struct tcphdr *th, struct tcpcb *tp, int32_t *tlenp, int32_t *thf, int32_t *drop_hdrlen, int32_t *ret_val, uint32_t *ts, uint32_t *cnt)
 
void __ctf_do_dropafterack (struct mbuf *m, struct tcpcb *tp, struct tcphdr *th, int32_t thflags, int32_t tlen, int32_t *ret_val, uint32_t *ts, uint32_t *cnt)
 
void ctf_do_drop (struct mbuf *m, struct tcpcb *tp)
 
int __ctf_process_rst (struct mbuf *m, struct tcphdr *th, struct socket *so, struct tcpcb *tp, uint32_t *ts, uint32_t *cnt)
 
void ctf_challenge_ack (struct mbuf *m, struct tcphdr *th, struct tcpcb *tp, int32_t *ret_val)
 
int ctf_ts_check (struct mbuf *m, struct tcphdr *th, struct tcpcb *tp, int32_t tlen, int32_t thflags, int32_t *ret_val)
 
int ctf_ts_check_ac (struct tcpcb *tp, int32_t thflags)
 
void ctf_calc_rwin (struct socket *so, struct tcpcb *tp)
 
void ctf_do_dropwithreset_conn (struct mbuf *m, struct tcpcb *tp, struct tcphdr *th, int32_t rstreason, int32_t tlen)
 
uint32_t ctf_fixed_maxseg (struct tcpcb *tp)
 
void ctf_log_sack_filter (struct tcpcb *tp, int num_sack_blks, struct sackblk *sack_blocks)
 
uint32_t ctf_decay_count (uint32_t count, uint32_t decay)
 
int32_t ctf_progress_timeout_check (struct tcpcb *tp, bool log)
 

Macro Definition Documentation

◆ TCPSTATES

#define TCPSTATES   /* for logging */

Definition at line 80 of file rack_bbr_common.c.

Function Documentation

◆ __ctf_do_dropafterack()

void __ctf_do_dropafterack ( struct mbuf *  m,
struct tcpcb tp,
struct tcphdr *  th,
int32_t  thflags,
int32_t  tlen,
int32_t *  ret_val,
uint32_t ts,
uint32_t cnt 
)

Definition at line 724 of file rack_bbr_common.c.

References BANDLIM_RST_OPENPORT, ctf_ack_war_checks(), ctf_do_dropwithreset(), SEQ_GT, tcpcb::snd_max, tcpcb::snd_una, tcpcb::t_state, and TCPS_SYN_RECEIVED.

Referenced by _ctf_drop_checks(), and rack_process_ack().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ __ctf_process_rst()

◆ __FBSDID()

__FBSDID ( "$FreeBSD$"  )

◆ _ctf_drop_checks()

int _ctf_drop_checks ( struct tcpopt to,
struct mbuf *  m,
struct tcphdr *  th,
struct tcpcb tp,
int32_t *  tlenp,
int32_t *  thf,
int32_t *  drop_hdrlen,
int32_t *  ret_val,
uint32_t ts,
uint32_t cnt 
)

◆ ctf_ack_war_checks()

void ctf_ack_war_checks ( struct tcpcb tp,
uint32_t ts,
uint32_t cnt 
)

Definition at line 579 of file rack_bbr_common.c.

References tcpcb::t_flags, tcp_ack_war_cnt, tcp_ack_war_time_window, tcp_ts_getticks(), TF_ACKNOW, and TSTMP_LT.

Referenced by __ctf_do_dropafterack(), _ctf_drop_checks(), and rack_do_compressed_ack_processing().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ctf_calc_rwin()

◆ ctf_challenge_ack()

void ctf_challenge_ack ( struct mbuf *  m,
struct tcphdr *  th,
struct tcpcb tp,
int32_t *  ret_val 
)

◆ ctf_decay_count()

uint32_t ctf_decay_count ( uint32_t  count,
uint32_t  decay 
)

Definition at line 1019 of file rack_bbr_common.c.

References count.

Referenced by rack_do_decay().

Here is the caller graph for this function:

◆ ctf_do_drop()

◆ ctf_do_dropwithreset()

void ctf_do_dropwithreset ( struct mbuf *  m,
struct tcpcb tp,
struct tcphdr *  th,
int32_t  rstreason,
int32_t  tlen 
)

◆ ctf_do_dropwithreset_conn()

void ctf_do_dropwithreset_conn ( struct mbuf *  m,
struct tcpcb tp,
struct tcphdr *  th,
int32_t  rstreason,
int32_t  tlen 
)

◆ ctf_do_queued_segments()

int ctf_do_queued_segments ( struct socket *  so,
struct tcpcb tp,
int  have_pkt 
)

Definition at line 527 of file rack_bbr_common.c.

References ctf_process_inbound_raw(), tcpcb::t_in_pkt, and tcpcb::t_tail_pkt.

Referenced by bbr_do_segment(), and rack_do_segment().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ctf_fixed_maxseg()

◆ ctf_flight_size()

◆ ctf_get_enet_type()

static int ctf_get_enet_type ( struct ifnet *  ifp,
struct mbuf *  m 
)
static

Definition at line 166 of file rack_bbr_common.c.

References ipovly::ih_len, ipovly::ih_x1, in_pseudo(), ip::ip_dst, ip::ip_hl, ip::ip_len, ip::ip_tos, ip::ip_v, IPPROTO_TCP, IPVERSION, KMOD_TCPSTAT_INC, M_LRO_EHDRSTRP, and in_addr::s_addr.

Referenced by ctf_process_inbound_raw().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ctf_log_sack_filter()

void ctf_log_sack_filter ( struct tcpcb tp,
int  num_sack_blks,
struct sackblk sack_blocks 
)

◆ ctf_outstanding()

◆ ctf_process_inbound_raw()

int ctf_process_inbound_raw ( struct tcpcb tp,
struct socket *  so,
struct mbuf *  m,
int  has_pkt 
)

◆ ctf_progress_timeout_check()

◆ ctf_ts_check()

int ctf_ts_check ( struct mbuf *  m,
struct tcphdr *  th,
struct tcpcb tp,
int32_t  tlen,
int32_t  thflags,
int32_t *  ret_val 
)

◆ ctf_ts_check_ac()

int ctf_ts_check_ac ( struct tcpcb tp,
int32_t  thflags 
)

Definition at line 926 of file rack_bbr_common.c.

References KMOD_TCPSTAT_INC, TCP_PAWS_IDLE, tcp_ts_getticks(), tcpcb::ts_recent, and tcpcb::ts_recent_age.

Referenced by rack_do_compressed_ack_processing().

Here is the call graph for this function:
Here is the caller graph for this function: