1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-18 10:35:55 +00:00

Optimize away call to bzero() in the common case by directly checking

if a connection has any cached TAO information.
This commit is contained in:
Jeffrey Hsu 2003-01-18 19:03:26 +00:00
parent 1d8dc7e4a3
commit 314e5a3daf
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=109492

View File

@ -105,6 +105,7 @@ SYSCTL_INT(_net_inet_tcp, OID_AUTO, local_slowstart_flightsize, CTLFLAG_RW,
int tcp_do_newreno = 1;
SYSCTL_INT(_net_inet_tcp, OID_AUTO, newreno, CTLFLAG_RW, &tcp_do_newreno,
0, "Enable NewReno Algorithms");
/*
* Tcp output routine: figure out what should be sent and send it.
*/
@ -125,7 +126,6 @@ tcp_output(struct tcpcb *tp)
int maxburst = TCP_MAXBURST;
#endif
struct rmxp_tao *taop;
struct rmxp_tao tao_noncached;
#ifdef INET6
struct ip6_hdr *ip6 = NULL;
int isipv6;
@ -234,10 +234,7 @@ tcp_output(struct tcpcb *tp)
*/
len = (long)ulmin(so->so_snd.sb_cc, win) - off;
if ((taop = tcp_gettaocache(&tp->t_inpcb->inp_inc)) == NULL) {
taop = &tao_noncached;
bzero(taop, sizeof(*taop));
}
taop = tcp_gettaocache(&tp->t_inpcb->inp_inc);
/*
* Lop off SYN bit if it has already been sent. However, if this
@ -248,7 +245,7 @@ tcp_output(struct tcpcb *tp)
flags &= ~TH_SYN;
off--, len++;
if (len > 0 && tp->t_state == TCPS_SYN_SENT &&
taop->tao_ccsent == 0)
(taop == NULL || taop->tao_ccsent == 0))
return 0;
}