diff options
author | andre <andre@FreeBSD.org> | 2009-09-15 22:23:45 +0000 |
---|---|---|
committer | andre <andre@FreeBSD.org> | 2009-09-15 22:23:45 +0000 |
commit | 3e3fe69f6bc0430a9bb2153acb0c9dccbddd686c (patch) | |
tree | a0a67ad92041c159cc6501220de4b0f504b45fe3 /sys/netinet/tcp_subr.c | |
parent | e1b6b165896ea3f06870ce31cc9b63fbad5e1d39 (diff) | |
download | FreeBSD-src-3e3fe69f6bc0430a9bb2153acb0c9dccbddd686c.zip FreeBSD-src-3e3fe69f6bc0430a9bb2153acb0c9dccbddd686c.tar.gz |
-Put the optimized soreceive_stream() under a compile time option called
TCP_SORECEIVE_STREAM for the time being.
Requested by: brooks
Once compiled in make it easily switchable for testers by using a tuneable
net.inet.tcp.soreceive_stream
and a corresponding read-only sysctl to report the current state.
Suggested by: rwatson
MFC after: 2 days
-This line, and those below, will be ignored--
> Description of fields to fill in above: 76 columns --|
> PR: If a GNATS PR is affected by the change.
> Submitted by: If someone else sent in the change.
> Reviewed by: If someone else reviewed your modification.
> Approved by: If you needed approval for this commit.
> Obtained from: If the change is from a third party.
> MFC after: N [day[s]|week[s]|month[s]]. Request a reminder email.
> Security: Vulnerability reference (one per line) or description.
> Empty fields above will be automatically removed.
M sys/conf/options
M sys/kern/uipc_socket.c
M sys/netinet/tcp_subr.c
M sys/netinet/tcp_usrreq.c
Diffstat (limited to 'sys/netinet/tcp_subr.c')
-rw-r--r-- | sys/netinet/tcp_subr.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/sys/netinet/tcp_subr.c b/sys/netinet/tcp_subr.c index 622c508..22b2ace 100644 --- a/sys/netinet/tcp_subr.c +++ b/sys/netinet/tcp_subr.c @@ -259,6 +259,12 @@ SYSCTL_VNET_INT(_net_inet_tcp_inflight, OID_AUTO, stab, CTLFLAG_RW, &VNET_NAME(tcp_inflight_stab), 0, "Inflight Algorithm Stabilization 20 = 2 packets"); +#ifdef TCP_SORECEIVE_STREAM +static int tcp_soreceive_stream = 0; +SYSCTL_INT(_net_inet_tcp, OID_AUTO, soreceive_stream, CTLFLAG_RDTUN, + &tcp_soreceive_stream, 0, "Using soreceive_stream for TCP sockets"); +#endif + VNET_DEFINE(uma_zone_t, sack_hole_zone); #define V_sack_hole_zone VNET(sack_hole_zone) @@ -420,6 +426,14 @@ tcp_init(void) tcp_finwait2_timeout = TCPTV_FINWAIT2_TIMEOUT; tcp_tcbhashsize = hashsize; +#ifdef TCP_SORECEIVE_STREAM + TUNABLE_INT_FETCH("net.inet.tcp.soreceive_stream", &tcp_soreceive_stream); + if (tcp_soreceive_stream) { + tcp_usrreqs.pru_soreceive = soreceive_stream; + tcp6_usrreqs.pru_soreceive = soreceive_stream; + } +#endif + #ifdef INET6 #define TCP_MINPROTOHDR (sizeof(struct ip6_hdr) + sizeof(struct tcphdr)) #else /* INET6 */ |