diff options
author | hsu <hsu@FreeBSD.org> | 2003-01-18 19:03:26 +0000 |
---|---|---|
committer | hsu <hsu@FreeBSD.org> | 2003-01-18 19:03:26 +0000 |
commit | a18d0c206fb2bbd4eea394e1fd13aada1e17a155 (patch) | |
tree | 004e5f887e9118bb471fbd0aa67ac9aa73badae4 | |
parent | baad1fb8f84de5b15ee509ee3042c76622f53f24 (diff) | |
download | FreeBSD-src-a18d0c206fb2bbd4eea394e1fd13aada1e17a155.zip FreeBSD-src-a18d0c206fb2bbd4eea394e1fd13aada1e17a155.tar.gz |
Optimize away call to bzero() in the common case by directly checking
if a connection has any cached TAO information.
-rw-r--r-- | sys/netinet/tcp_output.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/sys/netinet/tcp_output.c b/sys/netinet/tcp_output.c index 1742477..34b0d84 100644 --- a/sys/netinet/tcp_output.c +++ b/sys/netinet/tcp_output.c @@ -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 @@ again: */ 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 @@ again: 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; } |