summaryrefslogtreecommitdiffstats
path: root/sys/netinet/tcp_timer.h
diff options
context:
space:
mode:
authorandre <andre@FreeBSD.org>2007-04-11 09:45:16 +0000
committerandre <andre@FreeBSD.org>2007-04-11 09:45:16 +0000
commitbd6041301a0ba459f34d99a6e4e526ebaafc48b0 (patch)
treedb2065ed42263113dca9aaa7ad58c859f3975c57 /sys/netinet/tcp_timer.h
parentbda6bd3e38175b52aef99a649001fdc4143dfb11 (diff)
downloadFreeBSD-src-bd6041301a0ba459f34d99a6e4e526ebaafc48b0.zip
FreeBSD-src-bd6041301a0ba459f34d99a6e4e526ebaafc48b0.tar.gz
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)
Diffstat (limited to 'sys/netinet/tcp_timer.h')
-rw-r--r--sys/netinet/tcp_timer.h21
1 files changed, 16 insertions, 5 deletions
diff --git a/sys/netinet/tcp_timer.h b/sys/netinet/tcp_timer.h
index 8d8742de..1c801ad 100644
--- a/sys/netinet/tcp_timer.h
+++ b/sys/netinet/tcp_timer.h
@@ -128,6 +128,22 @@ static const char *tcptimers[] =
{ "REXMT", "PERSIST", "KEEP", "2MSL" };
#endif
+struct tcp_timer {
+ struct callout tt_timer;
+ int tt_nextc; /* next callout time in time_uptime */
+ int tt_active; /* engaged callouts */
+#define TT_DELACK 0x01
+#define TT_REXMT 0x02
+#define TT_PERSIST 0x04
+#define TT_KEEP 0x08
+#define TT_2MSL 0x10
+ int tt_delack;
+ int tt_rexmt;
+ int tt_persist;
+ int tt_keep;
+ int tt_2msl;
+};
+
/*
* Force a time value to be in a certain range.
*/
@@ -158,15 +174,10 @@ extern int tcp_finwait2_timeout;
extern int tcp_fast_finwait2_recycle;
void tcp_timer_init(void);
-void tcp_timer_2msl(void *xtp);
struct tcptw *
tcp_timer_2msl_tw(int _reuse); /* XXX temporary */
void tcp_timer_2msl_reset(struct tcptw *_tw, int rearm);
void tcp_timer_2msl_stop(struct tcptw *_tw);
-void tcp_timer_keep(void *xtp);
-void tcp_timer_persist(void *xtp);
-void tcp_timer_rexmt(void *xtp);
-void tcp_timer_delack(void *xtp);
#endif /* _KERNEL */
OpenPOWER on IntegriCloud