Changeset View
Changeset View
Standalone View
Standalone View
head/sys/netinet/tcp_output.c
Show First 20 Lines • Show All 124 Lines • ▼ Show 20 Lines | SYSCTL_INT(_net_inet_tcp, OID_AUTO, sendbuf_inc, CTLFLAG_VNET | CTLFLAG_RW, | ||||
"Incrementor step size of automatic send buffer"); | "Incrementor step size of automatic send buffer"); | ||||
VNET_DEFINE(int, tcp_autosndbuf_max) = 2*1024*1024; | VNET_DEFINE(int, tcp_autosndbuf_max) = 2*1024*1024; | ||||
#define V_tcp_autosndbuf_max VNET(tcp_autosndbuf_max) | #define V_tcp_autosndbuf_max VNET(tcp_autosndbuf_max) | ||||
SYSCTL_INT(_net_inet_tcp, OID_AUTO, sendbuf_max, CTLFLAG_VNET | CTLFLAG_RW, | SYSCTL_INT(_net_inet_tcp, OID_AUTO, sendbuf_max, CTLFLAG_VNET | CTLFLAG_RW, | ||||
&VNET_NAME(tcp_autosndbuf_max), 0, | &VNET_NAME(tcp_autosndbuf_max), 0, | ||||
"Max size of automatic send buffer"); | "Max size of automatic send buffer"); | ||||
/* | |||||
* Make sure that either retransmit or persist timer is set for SYN, FIN and | |||||
* non-ACK. | |||||
*/ | |||||
#define TCP_XMIT_TIMER_ASSERT(tp, len, th_flags) \ | |||||
KASSERT(((len) == 0 && ((th_flags) & (TH_SYN | TH_FIN)) == 0) ||\ | |||||
tcp_timer_active((tp), TT_REXMT) || \ | |||||
tcp_timer_active((tp), TT_PERSIST), \ | |||||
("neither rexmt nor persist timer is set")) | |||||
static void inline hhook_run_tcp_est_out(struct tcpcb *tp, | static void inline hhook_run_tcp_est_out(struct tcpcb *tp, | ||||
struct tcphdr *th, struct tcpopt *to, | struct tcphdr *th, struct tcpopt *to, | ||||
long len, int tso); | long len, int tso); | ||||
static void inline cc_after_idle(struct tcpcb *tp); | static void inline cc_after_idle(struct tcpcb *tp); | ||||
/* | /* | ||||
* Wrapper for the TCP established output helper hook. | * Wrapper for the TCP established output helper hook. | ||||
*/ | */ | ||||
▲ Show 20 Lines • Show All 1,399 Lines • ▼ Show 20 Lines | if (((tp->t_flags & TF_FORCEDATA) == 0 || | ||||
tp->snd_nxt -= len; | tp->snd_nxt -= len; | ||||
} | } | ||||
SOCKBUF_UNLOCK_ASSERT(&so->so_snd); /* Check gotos. */ | SOCKBUF_UNLOCK_ASSERT(&so->so_snd); /* Check gotos. */ | ||||
switch (error) { | switch (error) { | ||||
case EPERM: | case EPERM: | ||||
tp->t_softerror = error; | tp->t_softerror = error; | ||||
return (error); | return (error); | ||||
case ENOBUFS: | case ENOBUFS: | ||||
if (!tcp_timer_active(tp, TT_REXMT) && | TCP_XMIT_TIMER_ASSERT(tp, len, flags); | ||||
!tcp_timer_active(tp, TT_PERSIST)) | |||||
tcp_timer_activate(tp, TT_REXMT, tp->t_rxtcur); | |||||
tp->snd_cwnd = tp->t_maxseg; | tp->snd_cwnd = tp->t_maxseg; | ||||
return (0); | return (0); | ||||
case EMSGSIZE: | case EMSGSIZE: | ||||
/* | /* | ||||
* For some reason the interface we used initially | * For some reason the interface we used initially | ||||
* to send segments changed to another or lowered | * to send segments changed to another or lowered | ||||
* its MTU. | * its MTU. | ||||
* If TSO was active we either got an interface | * If TSO was active we either got an interface | ||||
▲ Show 20 Lines • Show All 248 Lines • Show Last 20 Lines |