From bd6041301a0ba459f34d99a6e4e526ebaafc48b0 Mon Sep 17 00:00:00 2001 From: andre Date: Wed, 11 Apr 2007 09:45:16 +0000 Subject: Change the TCP timer system from using the callout system five times directly to a merged model where only one callout, the next to fire, is registered. Instead of callout_reset(9) and callout_stop(9) the new function tcp_timer_activate() is used which then internally manages the callout. The single new callout is a mutex callout on inpcb simplifying the locking a bit. tcp_timer() is the called function which handles all race conditions in one place and then dispatches the individual timer functions. Reviewed by: rwatson (earlier version) --- sys/netinet/tcp_var.h | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'sys/netinet/tcp_var.h') diff --git a/sys/netinet/tcp_var.h b/sys/netinet/tcp_var.h index 0770412..5752da9 100644 --- a/sys/netinet/tcp_var.h +++ b/sys/netinet/tcp_var.h @@ -84,11 +84,7 @@ struct tcpcb { int t_segqlen; /* segment reassembly queue length */ int t_dupacks; /* consecutive dup acks recd */ - struct callout *tt_rexmt; /* retransmit timer */ - struct callout *tt_persist; /* retransmit persistence */ - struct callout *tt_keep; /* keepalive */ - struct callout *tt_2msl; /* 2*msl TIME_WAIT timer */ - struct callout *tt_delack; /* delayed ACK timer */ + struct tcp_timer *t_timers; /* retransmit timer */ struct inpcb *t_inpcb; /* back pointer to internet pcb */ int t_state; /* state of this connection */ @@ -538,8 +534,8 @@ void tcp_slowtimo(void); struct tcptemp * tcpip_maketemplate(struct inpcb *); void tcpip_fillheaders(struct inpcb *, void *, void *); -struct tcpcb * - tcp_timers(struct tcpcb *, int); +void tcp_timer_activate(struct tcpcb *, int, u_int); +int tcp_timer_active(struct tcpcb *, int); void tcp_trace(int, int, struct tcpcb *, void *, struct tcphdr *, int); void tcp_xmit_bandwidth_limit(struct tcpcb *tp, tcp_seq ack_seq); void syncache_init(void); -- cgit v1.1