Skip to content

Commit 956957e

Browse files
committed
Crank version number. Remove BufferLimit option.
The HPNBufferLimit option was intended to clamp the inbound flow control buffer to half of the available window. Unfortunately, it looks like it's been broken for some time with a tendancy to reduce the window to zero and cut the connection. As this option was specifically to deal with one special case and it's broken, fixing it doesn't seem like the right thing to do.
1 parent 535def6 commit 956957e

File tree

15 files changed

+7
-86
lines changed

15 files changed

+7
-86
lines changed

channels.c

Lines changed: 4 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -2408,40 +2408,20 @@ channel_check_window(struct ssh *ssh, Channel *c)
24082408
{
24092409
int r;
24102410

2411-
/* going back to a set denominator of 2. Prior versions had a
2412-
* dynamic denominator based on the size of the buffer. This may
2413-
* have been helpful in some situations but it isn't helping in
2414-
* the general case -cjr 6/30/23 */
24152411
if (c->type == SSH_CHANNEL_OPEN &&
24162412
!(c->flags & (CHAN_CLOSE_SENT|CHAN_CLOSE_RCVD)) &&
24172413
((c->local_window_max - c->local_window > c->local_maxpacket*3) ||
24182414
c->local_window < c->local_window_max/2) &&
24192415
c->local_consumed > 0) {
2420-
u_int addition = 0;
2416+
int addition = 0;
24212417
u_int32_t tcpwinsz = channel_tcpwinsz(ssh);
24222418
/* adjust max window size if we are in a dynamic environment
24232419
* and the tcp receive buffer is larger than the ssh window */
24242420
if (c->dynamic_window && (tcpwinsz > c->local_window_max)) {
2425-
if (c->hpn_buffer_limit) {
2426-
/* limit window growth to prevent buffer issues
2427-
* still not sure what is causing the buffer issues
2428-
* but it may be an issue with c->local_consumed not being
2429-
* handled properly in the cases of bottenecked IO to the
2430-
* wfd endpoint. This does have an impact on throughput
2431-
* as we're essentially maxing out local_window_max to
2432-
* half of the window size */
2433-
addition = (tcpwinsz/2 - c->local_window_max);
2434-
}
2435-
else {
2436-
/* aggressively grow the window */
2437-
addition = tcpwinsz - c->local_window_max;
2438-
}
2421+
/* aggressively grow the window */
2422+
addition = tcpwinsz - c->local_window_max;
24392423
c->local_window_max += addition;
2440-
/* doesn't look like we need these
2441-
* sshbuf_set_window_max(c->output, c->local_window_max);
2442-
* sshbuf_set_window_max(c->input, c->local_window_max);
2443-
*/
2444-
debug("Channel %d: Window growth to %d by %d bytes",c->self,
2424+
debug_f("Channel %d: Window growth to %d by %d bytes",c->self,
24452425
c->local_window_max, addition);
24462426
}
24472427
if (!c->have_remote_id)

channels.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,6 @@ struct Channel {
175175
u_int local_consumed;
176176
u_int local_maxpacket;
177177
int dynamic_window;
178-
int hpn_buffer_limit;
179178
int extended_usage;
180179
int single_connection;
181180
/* u_int tcpwinsz; */

clientloop.c

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2911,11 +2911,6 @@ client_session2_setup(struct ssh *ssh, int id, int want_tty, int want_subsystem,
29112911
if ((c = channel_lookup(ssh, id)) == NULL)
29122912
fatal_f("channel %d: unknown channel", id);
29132913

2914-
if (options.hpn_buffer_limit) {
2915-
debug_f("Limiting receive buffer size");
2916-
c->hpn_buffer_limit = 1;
2917-
}
2918-
29192914
ssh_packet_set_interactive(ssh, want_tty,
29202915
options.ip_qos_interactive, options.ip_qos_bulk);
29212916

hpnssh.1

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -555,7 +555,6 @@ For full details of the options listed below, and their possible values, see
555555
.It HostKeyAlias
556556
.It Hostname
557557
.It HPNDisabled*
558-
.It HPNBufferLimit*
559558
.It IdentitiesOnly
560559
.It IdentityAgent
561560
.It IdentityFile

hpnssh_config.5

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1081,15 +1081,6 @@ In some situations, such as transfers on a local area network, the impact
10811081
of the HPN code produces a net decrease in performance. In these cases it is
10821082
helpful to disable the HPN functionality. By default HPNDisabled is set to
10831083
.Cm no. HPNSSH only.
1084-
.It Cm HPNBufferLimit
1085-
This option will force the hpnssh receive buffer to grow more slowly and limits
1086-
the growth to one half of the TCP receive buffer. This option can prove useful
1087-
in situation where a high speed path with larger RTTs are writing to a slower
1088-
device or file system. Enabling this option will reduce performance but may provide
1089-
a more stable connection. The option only impacts the receiving side of the connection.
1090-
For example, a client receiving data from a server but not a client sending data.
1091-
By default this option is set to
1092-
.Cm no. HPNSSH only.
10931084
.It Cm IdentitiesOnly
10941085
Specifies that
10951086
.Xr ssh 1

hpnsshd_config.5

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -890,16 +890,6 @@ In some situations, such as transfers on a local area network, the impact
890890
of the HPN code produces a net decrease in performance. In these cases it is
891891
helpful to disable the HPN functionality. By default HPNDisabled is set to
892892
.CM no.
893-
.It Cm HPNBufferLimit
894-
This option will force the hpnssh receive buffer to grow more slowly and limits
895-
the growth to one half of the TCP receive buffer. This option can prove useful
896-
in situation where a high speed path with larger RTTs are writing to a slower
897-
device or file system. Enabling this option will reduce performance but may provide
898-
a more stable connection. The option only impacts the receiving side of the connection.
899-
For example, a client receiving data from a server but not a client sending data. If
900-
enabled on a server this will impact all incoming connections.
901-
By default this option is set to
902-
.Cm no. HPNSSH only.
903893
.It Cm IgnoreRhosts
904894
Specifies whether to ignore per-user
905895
.Pa .rhosts

packet.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -97,9 +97,6 @@ struct ssh {
9797

9898
/* track if we have disabled the mac as well */
9999
int none_mac;
100-
101-
/* use the less agressive window growth option */
102-
int hpn_buffer_limit;
103100
};
104101

105102
typedef int (ssh_packet_hook_fn)(struct ssh *, struct sshbuf *,

readconf.c

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ typedef enum {
171171
oTunnel, oTunnelDevice,
172172
oLocalCommand, oPermitLocalCommand, oRemoteCommand,
173173
oTcpRcvBufPoll, oHPNDisabled,
174-
oNoneEnabled, oNoneMacEnabled, oNoneSwitch, oHPNBufferLimit,
174+
oNoneEnabled, oNoneMacEnabled, oNoneSwitch,
175175
oMetrics, oMetricsPath, oMetricsInterval, oFallback, oFallbackPort,
176176
oVisualHostKey,
177177
oKexAlgorithms, oIPQoS, oRequestTTY, oSessionType, oStdinNull,
@@ -310,7 +310,6 @@ static struct {
310310
{ "noneenabled", oNoneEnabled },
311311
{ "nonemacenabled", oNoneMacEnabled },
312312
{ "noneswitch", oNoneSwitch },
313-
{ "hpnbufferlimit", oHPNBufferLimit },
314313
{ "metrics", oMetrics },
315314
{ "metricspath", oMetricsPath },
316315
{ "metricsinterval", oMetricsInterval },
@@ -1270,10 +1269,6 @@ process_config_line_depth(Options *options, struct passwd *pw, const char *host,
12701269
intptr = &options->nonemac_enabled;
12711270
goto parse_flag;
12721271

1273-
case oHPNBufferLimit:
1274-
intptr = &options->hpn_buffer_limit;
1275-
goto parse_flag;
1276-
12771272
case oMetrics:
12781273
intptr = &options->metrics;
12791274
goto parse_flag;
@@ -2701,7 +2696,6 @@ initialize_options(Options * options)
27012696
options->metrics_path = NULL;
27022697
options->metrics_interval = -1;
27032698
options->hpn_disabled = -1;
2704-
options->hpn_buffer_limit = -1;
27052699
options->fallback = -1;
27062700
options->fallback_port = -1;
27072701
options->tcp_rcv_buf_poll = -1;
@@ -2880,8 +2874,6 @@ fill_default_options(Options * options)
28802874
options->server_alive_count_max = 3;
28812875
if (options->hpn_disabled == -1)
28822876
options->hpn_disabled = 0;
2883-
if (options->hpn_buffer_limit == -1)
2884-
options->hpn_buffer_limit = 0;
28852877
if (options->tcp_rcv_buf_poll == -1)
28862878
options->tcp_rcv_buf_poll = 1;
28872879
if (options->none_switch == -1)

readconf.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@ typedef struct {
5252
int tcp_keep_alive; /* Set SO_KEEPALIVE. */
5353
int tcp_rcv_buf_poll; /* Option to poll recv buf every window transfer */
5454
int hpn_disabled; /* Switch to disable HPN buffer management */
55-
int hpn_buffer_limit; /* limit local_window_max to 1/2 receive buffer */
5655
int ip_qos_interactive; /* IP ToS/DSCP/class for interactive */
5756
int ip_qos_bulk; /* IP ToS/DSCP/class for bulk traffic */
5857
SyslogFacility log_facility; /* Facility for system logging. */

servconf.c

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,6 @@ initialize_server_options(ServerOptions *options)
192192
options->hpn_disabled = -1;
193193
options->none_enabled = -1;
194194
options->nonemac_enabled = -1;
195-
options->hpn_buffer_limit = -1;
196195
options->ip_qos_interactive = -1;
197196
options->ip_qos_bulk = -1;
198197
options->version_addendum = NULL;
@@ -441,8 +440,6 @@ fill_default_server_options(ServerOptions *options)
441440
}
442441
if (options->hpn_disabled == -1)
443442
options->hpn_disabled = 0;
444-
if (options->hpn_buffer_limit == -1)
445-
options->hpn_buffer_limit = 0;
446443
if (options->ip_qos_interactive == -1)
447444
options->ip_qos_interactive = IPTOS_DSCP_AF21;
448445
if (options->ip_qos_bulk == -1)
@@ -524,8 +521,7 @@ typedef enum {
524521
sKerberosGetAFSToken, sPasswordAuthentication,
525522
sKbdInteractiveAuthentication, sListenAddress, sAddressFamily,
526523
sPrintMotd, sPrintLastLog, sIgnoreRhosts,
527-
sNoneEnabled, sNoneMacEnabled, sHPNBufferLimit,
528-
sTcpRcvBufPoll, sHPNDisabled,
524+
sNoneEnabled, sNoneMacEnabled, sTcpRcvBufPoll, sHPNDisabled,
529525
sX11Forwarding, sX11DisplayOffset, sX11UseLocalhost,
530526
sPermitTTY, sStrictModes, sEmptyPasswd, sTCPKeepAlive,
531527
sPermitUserEnvironment, sAllowTcpForwarding, sCompression,
@@ -696,7 +692,6 @@ static struct {
696692
{ "tcprcvbufpoll", sTcpRcvBufPoll, SSHCFG_ALL },
697693
{ "noneenabled", sNoneEnabled, SSHCFG_ALL },
698694
{ "nonemacenabled", sNoneMacEnabled, SSHCFG_ALL },
699-
{ "hpnbufferlimit", sHPNBufferLimit, SSHCFG_ALL },
700695
{ "kexalgorithms", sKexAlgorithms, SSHCFG_GLOBAL },
701696
{ "include", sInclude, SSHCFG_ALL },
702697
{ "ipqos", sIPQoS, SSHCFG_ALL },
@@ -1576,10 +1571,6 @@ process_server_config_line_depth(ServerOptions *options, char *line,
15761571
intptr = &options->nonemac_enabled;
15771572
goto parse_flag;
15781573

1579-
case sHPNBufferLimit:
1580-
intptr = &options->hpn_buffer_limit;
1581-
goto parse_flag;
1582-
15831574
case sHostbasedAuthentication:
15841575
intptr = &options->hostbased_authentication;
15851576
goto parse_flag;

0 commit comments

Comments
 (0)