Changeset View
Changeset View
Standalone View
Standalone View
sys/netinet/tcp_timer.c
Show First 20 Lines • Show All 227 Lines • ▼ Show 20 Lines | if (! CPU_ABSENT(cpuid)) | |||||||||||
return (cpuid); | return (cpuid); | |||||||||||
return (curcpu); | return (curcpu); | |||||||||||
} else { | } else { | |||||||||||
return (0); | return (0); | |||||||||||
} | } | |||||||||||
} | } | |||||||||||
/* | /* | |||||||||||
* Tcp protocol timeout routine called every 500 ms. | * Legacy TCP global callout routine called every 500 ms. | |||||||||||
* Updates timestamps used for TCP | * Used to cleanup timewait states, which lack their own callouts. | |||||||||||
* causes finite state machine actions if timers expire. | ||||||||||||
*/ | */ | |||||||||||
void | static struct callout tcpslow_callout; | |||||||||||
tcp_slowtimo(void) | static void | |||||||||||
tcp_slowtimo(void *arg __unused) | ||||||||||||
{ | { | |||||||||||
struct epoch_tracker et; | ||||||||||||
VNET_ITERATOR_DECL(vnet_iter); | VNET_ITERATOR_DECL(vnet_iter); | |||||||||||
NET_EPOCH_ENTER(et); | ||||||||||||
VNET_LIST_RLOCK_NOSLEEP(); | VNET_LIST_RLOCK_NOSLEEP(); | |||||||||||
VNET_FOREACH(vnet_iter) { | VNET_FOREACH(vnet_iter) { | |||||||||||
CURVNET_SET(vnet_iter); | CURVNET_SET(vnet_iter); | |||||||||||
(void) tcp_tw_2msl_scan(0); | (void) tcp_tw_2msl_scan(0); | |||||||||||
CURVNET_RESTORE(); | CURVNET_RESTORE(); | |||||||||||
} | } | |||||||||||
VNET_LIST_RUNLOCK_NOSLEEP(); | VNET_LIST_RUNLOCK_NOSLEEP(); | |||||||||||
NET_EPOCH_EXIT(et); | ||||||||||||
callout_reset_sbt(&tcpslow_callout, SBT_1MS * 500, SBT_1MS * 10, | ||||||||||||
melifaroUnsubmitted Not Done Inline Actions
melifaro: | ||||||||||||
tcp_slowtimo, NULL, 0); | ||||||||||||
} | } | |||||||||||
static void | ||||||||||||
tcp_slowtimo_init(void *arg __unused) | ||||||||||||
{ | ||||||||||||
callout_init(&tcpslow_callout, 1); | ||||||||||||
callout_reset_sbt(&tcpslow_callout, SBT_1MS * 500, SBT_1MS * 10, | ||||||||||||
tcp_slowtimo, NULL, 0); | ||||||||||||
} | ||||||||||||
SYSINIT(tcp_timer, SI_SUB_VNET_DONE, SI_ORDER_ANY, tcp_slowtimo_init, NULL); | ||||||||||||
int tcp_backoff[TCP_MAXRXTSHIFT + 1] = | int tcp_backoff[TCP_MAXRXTSHIFT + 1] = | |||||||||||
{ 1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 512, 512, 512 }; | { 1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 512, 512, 512 }; | |||||||||||
int tcp_totbackoff = 2559; /* sum of tcp_backoff[] */ | int tcp_totbackoff = 2559; /* sum of tcp_backoff[] */ | |||||||||||
/* | /* | |||||||||||
* TCP timer processing. | * TCP timer processing. | |||||||||||
▲ Show 20 Lines • Show All 844 Lines • Show Last 20 Lines |