From nobody Wed May 08 12:31:22 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VZDyy41Fxz5J2C1; Wed, 08 May 2024 12:31:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VZDyy3RH7z4M4n; Wed, 8 May 2024 12:31:22 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715171482; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=bn/rDQDFMR18c1RBQkCdvRC5iI6w4EJApTGu2ouDacY=; b=MDuPkn0M1oE8uxqWzlfUbhb0gJv4pmvzDNV1FscjEv0UlfnV9wnYkyv0U5nlDSAuPrakuP nlWrLjpJfDvxde59bkJA/kmHQn/HV64V4fSTwLFH3ZB1ne0YGjyQJyYpG6aHh5JInsK8jB HHK1Yt71OtYjrcY1WMUqjtX2Zf1NAN0mHw8FZIwP3ysRTkKhtQJiYHF3jYLegPeBsnT8g5 cnrAeEEBtMpO3TGoDsC69Wnv27JkbJtXlhIqK0W0T3qdZqmHotQqoW57dAK8GdFg8NcPp/ 9CdOj5s2MV41A5+jDMEWO5h8z9ByAUtmgO5F96+BAna4+hml5JJHnDCmdrz80A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715171482; a=rsa-sha256; cv=none; b=Ri5zvroj8ripPOgMNsrQY+uIyxRmbFhXCm82Xsm0uFF0o1YGlgYV4X5+oGLBhL18MePVWP obeRaJ5jUJ3+tBAPnJUUk+eAGcyd9ycWYGVqi/vyyxuYFiZZadR4NE/Fcd9uqVOT5ucEwA gXvJlvmRceXp29DdKdzErlB9/gTKQkvE9iDg1WqfDHVqpc+FNvxEOfBBhiRuRBNF68CjjL FEpDFWVRG97RgywOG23diewJm+zaLULYAsSLF8WnPQm80ybzgEsfJvf5OQ4h4BNdjUWqg2 vVauU0Tg0g11XoDXxKwyXngTjrLhnovH58CUTpNTUUfeIYyp1f0J/K7n32h06A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715171482; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=bn/rDQDFMR18c1RBQkCdvRC5iI6w4EJApTGu2ouDacY=; b=KGzO7ZPqYbkwTvPAcsIJuhJFC/DLoEKe8RoWuKPfrlqQtwIy9B9aqxpDzD/gBDuwlZvyP3 /RDJ/ZR4yfhTHgYpBXE0ukLpt259YfclhJSMMT1lo8e5ES7NcduA33tamiQRxAg7wgAsK5 G5x/gFk/l5cyOGxq5tsr3so014oTK3UfHWo7Qoqd9xh2cBbpAf2uWleFZw1kUHuTBKXhlN Sq58ot26mowUk2DWekQrVYrvzODpIT2bre7rkbQVCvUmZrUAz76xF8GAsZKV4/Wnluueq+ Rtz/enfAYkpNVBLYlibf452/kqZWG89tmcZVFSOb4qjuT+39GsxobeJWQb07mg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VZDyy32zszQ0G; Wed, 8 May 2024 12:31:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 448CVMcH024662; Wed, 8 May 2024 12:31:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 448CVMSg024659; Wed, 8 May 2024 12:31:22 GMT (envelope-from git) Date: Wed, 8 May 2024 12:31:22 GMT Message-Id: <202405081231.448CVMSg024659@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Richard Scheffenegger Subject: git: cbf3575aa3c2 - main - tcp: filter small SACK blocks List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rscheff X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: cbf3575aa3c2e3d0d9eb7fafb445c783489ab9d9 Auto-Submitted: auto-generated The branch main has been updated by rscheff: URL: https://cgit.FreeBSD.org/src/commit/?id=cbf3575aa3c2e3d0d9eb7fafb445c783489ab9d9 commit cbf3575aa3c2e3d0d9eb7fafb445c783489ab9d9 Author: Richard Scheffenegger AuthorDate: 2024-05-04 19:47:29 +0000 Commit: Richard Scheffenegger CommitDate: 2024-05-08 12:00:10 +0000 tcp: filter small SACK blocks While the SACK Scoreboard in the base stack limits the number of holes by default to only 128 per connection in order to prevent CPU load attacks by splitting SACKs, filtering out SACK blocks of unusually small size can further improve the actual processing of SACK loss recovery. Reviewed By: tuexen, #transport Sponsored by: NetApp, Inc. Differential Revision: https://reviews.freebsd.org/D45075 --- sys/netinet/tcp_sack.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sys/netinet/tcp_sack.c b/sys/netinet/tcp_sack.c index f59cc5fe0d0b..a8cc84397d34 100644 --- a/sys/netinet/tcp_sack.c +++ b/sys/netinet/tcp_sack.c @@ -558,6 +558,7 @@ tcp_sack_doack(struct tcpcb *tp, struct tcpopt *to, tcp_seq th_ack) int i, j, num_sack_blks; sackstatus_t sack_changed; int delivered_data, left_edge_delta; + int maxseg = tp->t_maxseg - MAX_TCPOPTLEN; tcp_seq loss_hiack = 0; int loss_thresh = 0; @@ -604,7 +605,9 @@ tcp_sack_doack(struct tcpcb *tp, struct tcpopt *to, tcp_seq th_ack) SEQ_GT(sack.start, th_ack) && SEQ_LT(sack.start, tp->snd_max) && SEQ_GT(sack.end, tp->snd_una) && - SEQ_LEQ(sack.end, tp->snd_max)) { + SEQ_LEQ(sack.end, tp->snd_max) && + ((sack.end - sack.start) >= maxseg || + SEQ_GEQ(sack.end, tp->snd_max))) { sack_blocks[num_sack_blks++] = sack; } else if (SEQ_LEQ(sack.start, th_ack) && SEQ_LEQ(sack.end, th_ack)) {