From nobody Mon Nov 10 19:57:28 2025 X-Original-To: dev-commits-src-branches@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 4d50nP11PSz63LjC; Mon, 10 Nov 2025 19:57:29 +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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4d50nP0C3Lz3c0F; Mon, 10 Nov 2025 19:57:29 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1762804649; 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=elCWHLKiXaxkqyL2x4ycu7IlvNkRYsCdzasK2Wqqi50=; b=Rl+o13t/muTFvsy56rPEZsiCjk6bzicJ36TcfsHO5Ha6A+yd12Sw18ZjWQlgeMBjGQ6f5o mIBK6g+Qdx8CSs91Kfi9Q32blHUsrMptYw/7imE9DshPGecjuZKrFZDhDbT7+iB9SB9l3x Q1LBni830yyF7iBq8p+R8y1AbcaXzQOOGYcJo91t9rFkobVhP+B/EQg6tdbUIGLDR3IdjE n/9yxOZgP7uS0ZnW2j2ZIrJEjbVMVMC3PeQaHQTqWZPayzrL1pcrCXJKvXJC9dlh3aE+6F 9RPmZNe2Mqjb87rf+Gie0QA4H7Ejn84K+D9emME2iz7+i1XOCj05Td4O5rqgbw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1762804649; 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=elCWHLKiXaxkqyL2x4ycu7IlvNkRYsCdzasK2Wqqi50=; b=BY+uXCsBFUUs4cIBXNzMi7QaDwvn813N7jICzHpyy4QpyJBux2+62I5FnoXFYefXJAJN+m kfxYwvsblMHVtfJxMj1ynfWyH6BaT4BygOldYPwGDYttppixrSSQSQ+D/5mFswc2IlNFU+ DUGPtYS6ZZn193sei5NIA/mYQ6qAmkHOaRh/+sm3eUmJE96uOICJdF1cRf+d0nPTR/M74T n4MlaBpz4OkzG1kPngGg/JmbiwQ49SVqXWmSPAXEJH6hjORtbzdGRVWSIJMzNUbh/ZioTD /JGsUbfuy+LItPgaHMrWgcHrTPW/s2xb41J4X7z8PjFFHoY1ZNosONusIyhfLg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1762804649; a=rsa-sha256; cv=none; b=dBCkEcQ87syoE6wTzd+vE6ECka4yW4drj9pKQnlbiz+HgIXrOVBjYqqyPTqX+0bN4knxit iYDmEmDLocPS98juZDXij0a7B7mP8slx9sq2Ckpuf89hVT8ODKrfB4JfTuu0WNcKqqtCe8 uxzo/3QhdfIDo4EdxrU6Gty5FpKR4ux6UCuYCsTGegGRtK5V6Lmbr60ZCHvVvVWcqXgg9Z 24bsaOrxMOzIk3HWrkjLSu+wuzcY98LXIijtKq21mkrcFtQqpSRN4+F3ZYqQFKkbygEVjO cDjbTwHPv+P5yZuFhOp9CfxH4W1jDB0/Ha8cj9YFB2BVZf3TaMG+KmnmHYXLzg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none 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 4d50nN6QcdzY5C; Mon, 10 Nov 2025 19:57:28 +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 5AAJvSqC009181; Mon, 10 Nov 2025 19:57:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5AAJvSu6009178; Mon, 10 Nov 2025 19:57:28 GMT (envelope-from git) Date: Mon, 10 Nov 2025 19:57:28 GMT Message-Id: <202511101957.5AAJvSu6009178@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: ff9dbbc2c6f4 - stable/15 - tcp: improve comments in the syncache code List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@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/15 X-Git-Reftype: branch X-Git-Commit: ff9dbbc2c6f4f4c06c8e3f0aa790a647b7788c73 Auto-Submitted: auto-generated The branch stable/15 has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=ff9dbbc2c6f4f4c06c8e3f0aa790a647b7788c73 commit ff9dbbc2c6f4f4c06c8e3f0aa790a647b7788c73 Author: Michael Tuexen AuthorDate: 2025-11-07 15:27:56 +0000 Commit: Michael Tuexen CommitDate: 2025-11-10 19:56:34 +0000 tcp: improve comments in the syncache code Add a comment explaining why syncache entries are dropped and fix a typo in a comment. Reviewed by: rrs, glebius Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D53564 (cherry picked from commit 17fb082104ee281365b72bd5135604cea5051df2) --- sys/netinet/tcp_syncache.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/sys/netinet/tcp_syncache.c b/sys/netinet/tcp_syncache.c index fa7035771714..6c072e0fec38 100644 --- a/sys/netinet/tcp_syncache.c +++ b/sys/netinet/tcp_syncache.c @@ -535,6 +535,10 @@ syncache_timer(void *xsch) TCPSTAT_INC(tcps_sndtotal); TCPSTAT_INC(tcps_sc_retransmitted); } else { + /* + * Most likely we are memory constrained, so free + * resources. + */ syncache_drop(sc, sch); TCPSTAT_INC(tcps_sc_dropped); } @@ -734,7 +738,7 @@ syncache_unreach(struct in_conninfo *inc, tcp_seq th_seq, uint16_t port) goto done; /* - * If we've rertransmitted 3 times and this is our second error, + * If we've retransmitted 3 times and this is our second error, * we remove the entry. Otherwise, we allow it to continue on. * This prevents us from incorrectly nuking an entry during a * spurious network outage. @@ -1562,6 +1566,10 @@ syncache_add(struct in_conninfo *inc, struct tcpopt *to, struct tcphdr *th, TCPSTAT_INC(tcps_sndacks); TCPSTAT_INC(tcps_sndtotal); } else { + /* + * Most likely we are memory constrained, so free + * resources. + */ syncache_drop(sc, sch); TCPSTAT_INC(tcps_sc_dropped); } @@ -1747,6 +1755,9 @@ syncache_add(struct in_conninfo *inc, struct tcpopt *to, struct tcphdr *th, TCPSTAT_INC(tcps_sndacks); TCPSTAT_INC(tcps_sndtotal); } else { + /* + * Most likely we are memory constrained, so free resources. + */ if (sc != &scs) syncache_free(sc); TCPSTAT_INC(tcps_sc_dropped);