From nobody Fri Aug 30 06:31:19 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 4Ww7Zv5wYGz5TB5B; Fri, 30 Aug 2024 06:31:19 +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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Ww7Zv5SqRz4Fg7; Fri, 30 Aug 2024 06:31:19 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724999479; 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=Pgigmzog4p1mrN7H8JAQN2OHGARaOXqPgAj2pDT0zSQ=; b=OkAKJvEwhJUUMUkppjhEU8PVPLc5pc4TfRR9rEGSR7mAEPI088Qepz4m/m/ET9O+FdHmYk pGuejPNxc69Q5HEwMPppgoshJje6EefUrYsHe9zdZIkz+/59xbTZsA+wizPk3xAd/aP9zG rmyD02iue1KDYV6tOToGJQnimuwGybeLEGMuSuw3saZRG2MqiDoriQN3FXhjHu7dNGybvJ V5nE4jXbw59tYnetARK3M/eFV0nmHePnI+w8h32/FpMuonaVfq3SUTh59cmfVUnJLCCN3j SkNV2W9zhhbvUW18YbzDGYvdWWeYDQPwOmxnk5lLRC3xRGH9Ca+WdXypaT/sxA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724999479; a=rsa-sha256; cv=none; b=Ml2lBHr10LV8hxVXMgZl8C5wHeyynesn9J1nLIOg1yaAqkO+Zr/zLYYQDCh8EGpC0Y94z0 IxYca1pt38OmKPA1pINp8WbcW4pbvDFUv9bBse9Cr9F633mR6p10yYAeIBd2gxvOVrxpIv PsHNqIXOAPEJUoxN1QVsJ/QeYRjrjUx1JirLGyjNGUJsY6o8c22iZODgTW+VhIS0T9wx2l bTeLH587Mizsl/jM7tPeIq/KAIG+rxghEMYMmUozJIsFhHw+JsBr5vFlmpUuNLqhdX5AMO Q7lDTuclplHpPVp8ZBqpCBopAGbN6Fwkazyn7cZQVBrrUhEyvX2cm+PaV4/h5g== 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=1724999479; 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=Pgigmzog4p1mrN7H8JAQN2OHGARaOXqPgAj2pDT0zSQ=; b=V+POCERlURibvZBW0ha9Gr5/8cBhilJAscVPe2Cs54Yc6mffg9Nv6voyCXXw8Ty5ruCdS6 F8uI53e7R1aAgthzKdWrJVPOr8m/qXcq+L1+WRuk27EvQjRCbVwLvsL6TRxbHHF+0zdhjT HxfcIgDndoPqL2RdASGZ10Kpv2ALx708h5fX8VZ9FkWjC7zfKcOonGYiqZedPGs6LYfug1 MSl3xr8WCPmhD7loAvMPzGX8DMZ0sUJg1EVE3UTveH0f0rZREWuCcjpcZr10+l3TCg4A0q 3ITAPyi+teI0uEdDN3213HI8N+jrZIHLOvmqIPvnQ1IOxq1ZYFJJ6HRuWHoZ5A== 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 4Ww7Zv54Hyzr4j; Fri, 30 Aug 2024 06:31:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 47U6VJvp051623; Fri, 30 Aug 2024 06:31:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47U6VJir051620; Fri, 30 Aug 2024 06:31:19 GMT (envelope-from git) Date: Fri, 30 Aug 2024 06:31:19 GMT Message-Id: <202408300631.47U6VJir051620@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Michael Tuexen Subject: git: 6c0fb6c5ac7b - stable/14 - tcp: improve consistency of SYN-cache handling 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: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 6c0fb6c5ac7b3319ac823ef279b12a21604cf84a Auto-Submitted: auto-generated The branch stable/14 has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=6c0fb6c5ac7b3319ac823ef279b12a21604cf84a commit 6c0fb6c5ac7b3319ac823ef279b12a21604cf84a Author: Michael Tuexen AuthorDate: 2024-08-22 20:17:05 +0000 Commit: Michael Tuexen CommitDate: 2024-08-30 06:30:54 +0000 tcp: improve consistency of SYN-cache handling Originally, a SYN-cache entry was always allocated and later freed, when not needed anymore. Then the allocation was avoided, when no SYN-cache entry was needed, and a copy on the stack was used. But the logic regarding freeing was not updated. This patch doesn't re-check conditions (which may have changed) when deciding to insert or free the entry, but uses the result of the earlier check. This simplifies the code and improves also consistency. Reviewed by: glebius Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D46410 (cherry picked from commit e41364711ca3f7e214f9607ebedf62e03e51633d) --- sys/netinet/tcp_syncache.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/sys/netinet/tcp_syncache.c b/sys/netinet/tcp_syncache.c index 052e257a3cb5..287728fe9162 100644 --- a/sys/netinet/tcp_syncache.c +++ b/sys/netinet/tcp_syncache.c @@ -1730,9 +1730,7 @@ skip_alloc: * Do a standard 3-way handshake. */ if (syncache_respond(sc, m, TH_SYN|TH_ACK) == 0) { - if (V_tcp_syncookies && V_tcp_syncookiesonly && sc != &scs) - syncache_free(sc); - else if (sc != &scs) + if (sc != &scs) syncache_insert(sc, sch); /* locks and unlocks sch */ TCPSTAT_INC(tcps_sndacks); TCPSTAT_INC(tcps_sndtotal);