From 861fa1490335b8e3cc91a1efafd8b9e481813931 Mon Sep 17 00:00:00 2001 From: Nils Nieuwejaar Date: Sun, 15 Aug 2021 11:30:44 -0400 Subject: 14017 Add support for TCP_QUICKACK Reviewed by: Joshua M. Clulow Reviewed by: Andy Fiddaman Approved by: Dan McDonald --- usr/src/uts/common/inet/tcp/tcp.c | 2 ++ usr/src/uts/common/inet/tcp/tcp_input.c | 4 ++++ usr/src/uts/common/inet/tcp/tcp_opt_data.c | 11 +++++++++++ 3 files changed, 17 insertions(+) (limited to 'usr/src/uts/common/inet/tcp') diff --git a/usr/src/uts/common/inet/tcp/tcp.c b/usr/src/uts/common/inet/tcp/tcp.c index 6cae350878..9348ea3d0f 100644 --- a/usr/src/uts/common/inet/tcp/tcp.c +++ b/usr/src/uts/common/inet/tcp/tcp.c @@ -25,6 +25,7 @@ * Copyright (c) 2013, 2017 by Delphix. All rights reserved. * Copyright 2014, OmniTI Computer Consulting, Inc. All rights reserved. * Copyright 2020 Joyent, Inc. + * Copyright 2022 Oxide Computer Company */ /* Copyright (c) 1990 Mentat Inc. */ @@ -2406,6 +2407,7 @@ tcp_init_values(tcp_t *tcp, tcp_t *parent) tcp->tcp_fin_wait_2_flush_interval = parent->tcp_fin_wait_2_flush_interval; + tcp->tcp_quickack = parent->tcp_quickack; tcp->tcp_ka_interval = parent->tcp_ka_interval; tcp->tcp_ka_abort_thres = parent->tcp_ka_abort_thres; diff --git a/usr/src/uts/common/inet/tcp/tcp_input.c b/usr/src/uts/common/inet/tcp/tcp_input.c index b3e4a07303..dd264528fc 100644 --- a/usr/src/uts/common/inet/tcp/tcp_input.c +++ b/usr/src/uts/common/inet/tcp/tcp_input.c @@ -25,6 +25,7 @@ * Copyright 2019 Joyent, Inc. * Copyright (c) 2014, 2016 by Delphix. All rights reserved. * Copyright 2020 OmniOS Community Edition (OmniOSce) Association. + * Copyright 2022 Oxide Computer Company */ /* This file contains all TCP input processing functions. */ @@ -4754,6 +4755,9 @@ update_ack: tcp->tcp_rack_cur_max = tcp->tcp_rack_abs_max; else tcp->tcp_rack_cur_max = cur_max; + } else if (tcp->tcp_quickack) { + /* The executable asked that we ack each packet */ + flags |= TH_ACK_NEEDED; } else if (TCP_IS_DETACHED(tcp)) { /* We don't have an ACK timer for detached TCP. */ flags |= TH_ACK_NEEDED; diff --git a/usr/src/uts/common/inet/tcp/tcp_opt_data.c b/usr/src/uts/common/inet/tcp/tcp_opt_data.c index fa7c8b2f48..8687b52d53 100644 --- a/usr/src/uts/common/inet/tcp/tcp_opt_data.c +++ b/usr/src/uts/common/inet/tcp/tcp_opt_data.c @@ -24,6 +24,7 @@ * Copyright 2019 Joyent, Inc. * Copyright (c) 2016 by Delphix. All rights reserved. * Copyright 2020 OmniOS Community Edition (OmniOSce) Association. + * Copyright 2022 Oxide Computer Company */ #include @@ -135,6 +136,8 @@ opdes_t tcp_opt_arr[] = { { TCP_CORK, IPPROTO_TCP, OA_RW, OA_RW, OP_NP, 0, sizeof (int), 0 }, +{ TCP_QUICKACK, IPPROTO_TCP, OA_RW, OA_RW, OP_NP, 0, sizeof (int), 0 }, + { TCP_RTO_INITIAL, IPPROTO_TCP, OA_RW, OA_RW, OP_NP, 0, sizeof (uint32_t), 0 }, { TCP_RTO_MIN, IPPROTO_TCP, OA_RW, OA_RW, OP_NP, 0, sizeof (uint32_t), 0 }, @@ -449,6 +452,9 @@ tcp_opt_get(conn_t *connp, int level, int name, uchar_t *ptr) case TCP_CORK: *i1 = tcp->tcp_cork; return (sizeof (int)); + case TCP_QUICKACK: + *i1 = tcp->tcp_quickack; + return (sizeof (int)); case TCP_RTO_INITIAL: *i1 = tcp->tcp_rto_initial; return (sizeof (uint32_t)); @@ -919,6 +925,11 @@ tcp_opt_set(conn_t *connp, uint_t optset_context, int level, int name, tcp->tcp_cork = onoff; } break; + case TCP_QUICKACK: + if (!checkonly) { + tcp->tcp_quickack = onoff; + } + break; case TCP_RTO_INITIAL: if (checkonly || val == 0) break; -- cgit v1.2.3