Changeset View
Changeset View
Standalone View
Standalone View
sys/netinet/tcp_stacks/fastpath.c
Show First 20 Lines • Show All 56 Lines • ▼ Show 20 Lines | |||||
#include "opt_inet.h" | #include "opt_inet.h" | ||||
#include "opt_inet6.h" | #include "opt_inet6.h" | ||||
#include "opt_ipsec.h" | #include "opt_ipsec.h" | ||||
#include "opt_tcpdebug.h" | #include "opt_tcpdebug.h" | ||||
#include <sys/param.h> | #include <sys/param.h> | ||||
#include <sys/module.h> | #include <sys/module.h> | ||||
#include <sys/kernel.h> | #include <sys/kernel.h> | ||||
#ifdef TCP_HHOOK | |||||
#include <sys/hhook.h> | #include <sys/hhook.h> | ||||
#endif | |||||
#include <sys/malloc.h> | #include <sys/malloc.h> | ||||
#include <sys/mbuf.h> | #include <sys/mbuf.h> | ||||
#include <sys/proc.h> /* for proc0 declaration */ | #include <sys/proc.h> /* for proc0 declaration */ | ||||
#include <sys/protosw.h> | #include <sys/protosw.h> | ||||
#include <sys/sdt.h> | #include <sys/sdt.h> | ||||
#include <sys/signalvar.h> | #include <sys/signalvar.h> | ||||
#include <sys/socket.h> | #include <sys/socket.h> | ||||
#include <sys/socketvar.h> | #include <sys/socketvar.h> | ||||
▲ Show 20 Lines • Show All 187 Lines • ▼ Show 20 Lines | if (!tp->t_rttlow || | ||||
tp->t_rttlow > ticks - tp->t_rtttime) | tp->t_rttlow > ticks - tp->t_rtttime) | ||||
tp->t_rttlow = ticks - tp->t_rtttime; | tp->t_rttlow = ticks - tp->t_rtttime; | ||||
tcp_xmit_timer(tp, | tcp_xmit_timer(tp, | ||||
ticks - tp->t_rtttime); | ticks - tp->t_rtttime); | ||||
} | } | ||||
if (winup_only == 0) { | if (winup_only == 0) { | ||||
acked = BYTES_THIS_ACK(tp, th); | acked = BYTES_THIS_ACK(tp, th); | ||||
#ifdef TCP_HHOOK | |||||
/* Run HHOOK_TCP_ESTABLISHED_IN helper hooks. */ | /* Run HHOOK_TCP_ESTABLISHED_IN helper hooks. */ | ||||
hhook_run_tcp_est_in(tp, th, to); | hhook_run_tcp_est_in(tp, th, to); | ||||
#endif | |||||
TCPSTAT_ADD(tcps_rcvackbyte, acked); | TCPSTAT_ADD(tcps_rcvackbyte, acked); | ||||
sbdrop(&so->so_snd, acked); | sbdrop(&so->so_snd, acked); | ||||
if (SEQ_GT(tp->snd_una, tp->snd_recover) && | if (SEQ_GT(tp->snd_una, tp->snd_recover) && | ||||
SEQ_LEQ(th->th_ack, tp->snd_recover)) | SEQ_LEQ(th->th_ack, tp->snd_recover)) | ||||
tp->snd_recover = th->th_ack - 1; | tp->snd_recover = th->th_ack - 1; | ||||
/* | /* | ||||
▲ Show 20 Lines • Show All 756 Lines • ▼ Show 20 Lines | if ((tp->t_flags & TF_SACK_PERMIT) && | ||||
tcp_sack_doack(tp, to, th->th_ack); | tcp_sack_doack(tp, to, th->th_ack); | ||||
else | else | ||||
/* | /* | ||||
* Reset the value so that previous (valid) value | * Reset the value so that previous (valid) value | ||||
* from the last ack with SACK doesn't get used. | * from the last ack with SACK doesn't get used. | ||||
*/ | */ | ||||
tp->sackhint.sacked_bytes = 0; | tp->sackhint.sacked_bytes = 0; | ||||
#ifdef TCP_HHOOK | |||||
/* Run HHOOK_TCP_ESTABLISHED_IN helper hooks. */ | /* Run HHOOK_TCP_ESTABLISHED_IN helper hooks. */ | ||||
hhook_run_tcp_est_in(tp, th, to); | hhook_run_tcp_est_in(tp, th, to); | ||||
#endif | |||||
if (SEQ_LEQ(th->th_ack, tp->snd_una)) { | if (SEQ_LEQ(th->th_ack, tp->snd_una)) { | ||||
if (tlen == 0 && tiwin == tp->snd_wnd) { | if (tlen == 0 && tiwin == tp->snd_wnd) { | ||||
/* | /* | ||||
* If this is the first time we've seen a | * If this is the first time we've seen a | ||||
* FIN from the remote, this is not a | * FIN from the remote, this is not a | ||||
* duplicate and it needs to be processed | * duplicate and it needs to be processed | ||||
* normally. This happens during a | * normally. This happens during a | ||||
▲ Show 20 Lines • Show All 1,069 Lines • ▼ Show 20 Lines | if (!tp->t_rttlow || | ||||
tp->t_rttlow > ticks - tp->t_rtttime) | tp->t_rttlow > ticks - tp->t_rtttime) | ||||
tp->t_rttlow = ticks - tp->t_rtttime; | tp->t_rttlow = ticks - tp->t_rtttime; | ||||
tcp_xmit_timer(tp, | tcp_xmit_timer(tp, | ||||
ticks - tp->t_rtttime); | ticks - tp->t_rtttime); | ||||
} | } | ||||
if (winup_only == 0) { | if (winup_only == 0) { | ||||
acked = BYTES_THIS_ACK(tp, th); | acked = BYTES_THIS_ACK(tp, th); | ||||
#ifdef TCP_HHOOK | |||||
/* Run HHOOK_TCP_ESTABLISHED_IN helper hooks. */ | /* Run HHOOK_TCP_ESTABLISHED_IN helper hooks. */ | ||||
hhook_run_tcp_est_in(tp, th, to); | hhook_run_tcp_est_in(tp, th, to); | ||||
#endif | |||||
TCPSTAT_ADD(tcps_rcvackbyte, acked); | TCPSTAT_ADD(tcps_rcvackbyte, acked); | ||||
sbdrop(&so->so_snd, acked); | sbdrop(&so->so_snd, acked); | ||||
if (SEQ_GT(tp->snd_una, tp->snd_recover) && | if (SEQ_GT(tp->snd_una, tp->snd_recover) && | ||||
SEQ_LEQ(th->th_ack, tp->snd_recover)) | SEQ_LEQ(th->th_ack, tp->snd_recover)) | ||||
tp->snd_recover = th->th_ack - 1; | tp->snd_recover = th->th_ack - 1; | ||||
/* | /* | ||||
▲ Show 20 Lines • Show All 311 Lines • Show Last 20 Lines |