From nobody Fri Aug 30 06:45:02 2024 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 4Ww7tk4WmNz5TBTG; Fri, 30 Aug 2024 06:45:02 +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 4Ww7tk3s7Pz4HQj; Fri, 30 Aug 2024 06:45:02 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725000302; 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=pIDK99A/Kd9SEAAAmd2xrukYMJvFhNzLfaEDpXrq/38=; b=o6T9U7eY9HoGGrRaWFR0G8QhuiEob3NHDMhXDCieOVQQrga446EBaeelA6mvxSVh97d0UZ J+lhI2xsw8kZ5gpUMVV0CaQ/wpUSwAJARmCtS3Z6S9JI+d5TFgMFBBLf9SPd88eqXbXVZe z1xgyZb3CN9zzWOC64cULGhaVFF/r4bnjkookqPrdu0c1TfWzvovB+/8dP5yhW0arEIFjU 8bIk9pjDqXHFH08DbnKgjOmhrA7QhdGcGazOcJFjWqGk+xILaJZzbuog3vJFtRa4ijTF5X Xqh+156Mbb4NsYWkciehySvPeSpGOHriiyXZevsXUwirCwbGSnzwLCzOTWQznQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725000302; a=rsa-sha256; cv=none; b=KuIVAAIce9cTx+/iceQ/gz3tWse9aVj6+5YQf+DBmuJ4JTdb/bgixG5mXeoZVrZ9UIVV5b DaCfzSfPQh9x1t398Ei+g0FaMlQ+CuOYaFeyNXddchV/5vh2MmXLQZ3IlkZ5b402lGD66+ 3sFxLElwQHSKYAxfmXZ/VPT463TYDQrSVTKc9w3AUUVvK3s1NzsCcvuxz/Y82ag3ir4iXR y/21cKnlqEHnAqOAiZ39Zqw+f8Y0B5bRuh2V+VUnRo1n2OTz17NAXVwblzwrm9bHn/WiEH P1pHKPWSEb95gOjSYqGmt4jA9eCS45m/0TipOiFgYOdZSDC24iwmbTvA+11cgA== 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=1725000302; 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=pIDK99A/Kd9SEAAAmd2xrukYMJvFhNzLfaEDpXrq/38=; b=aFfBKRPiQBpaieKiAprMaOTz7yC3pM5rbVZteIDaLRNrnbYqneU81etqAUZMIWFf1oTJSl gyMx4duGYpndSMJ/XcBWXxhmfUptFmaElvSHuxYFIB4kRhIwLV8dNuIiL47cPtMKZVaGE0 QEW//YIjk24ENfJu6aSyA+VbdtCvdWUQdt/3yHo62vAgvlSWU7i/VJCpWA5WglTNqxjsck RKzJcqFS15up2oD7VALCJGXjMr5aL5NcJ+nWfwbRVv6G6yPEtVLdP4A77u4xt5SjxraSqi t2eEyO4KLENYsZOmMXVOGKT+W8hJhCc7KbO58IgisvzrtibbzmXpcBfFKVjVew== 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 4Ww7tk3L6BzrMt; Fri, 30 Aug 2024 06:45:02 +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 47U6j2c4074707; Fri, 30 Aug 2024 06:45:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47U6j2Nb074704; Fri, 30 Aug 2024 06:45:02 GMT (envelope-from git) Date: Fri, 30 Aug 2024 06:45:02 GMT Message-Id: <202408300645.47U6j2Nb074704@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: 5420e4f56389 - stable/13 - tcp: initialize the LRO hash table with correct size 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/13 X-Git-Reftype: branch X-Git-Commit: 5420e4f56389c841322f1bf4aad1cf288a9a6482 Auto-Submitted: auto-generated The branch stable/13 has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=5420e4f56389c841322f1bf4aad1cf288a9a6482 commit 5420e4f56389c841322f1bf4aad1cf288a9a6482 Author: Michael Tuexen AuthorDate: 2024-08-20 15:30:55 +0000 Commit: Michael Tuexen CommitDate: 2024-08-30 06:44:35 +0000 tcp: initialize the LRO hash table with correct size There will at most lro_entries entries in the LRO hash table. So no need to take lro_mbufs into account, which only results in the LRO hash table being too large and therefore wasting memory. Reviewed by: rrs Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D46378 (cherry picked from commit aa6c490bf80fcef15cfc0d3f562fae19ef2375aa) --- sys/netinet/tcp_lro.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/sys/netinet/tcp_lro.c b/sys/netinet/tcp_lro.c index 83b730b15558..7f54da48c5f6 100644 --- a/sys/netinet/tcp_lro.c +++ b/sys/netinet/tcp_lro.c @@ -168,7 +168,7 @@ tcp_lro_init_args(struct lro_ctrl *lc, struct ifnet *ifp, { struct lro_entry *le; size_t size; - unsigned i, elements; + unsigned i; lc->lro_bad_csum = 0; lc->lro_queued = 0; @@ -183,11 +183,7 @@ tcp_lro_init_args(struct lro_ctrl *lc, struct ifnet *ifp, LIST_INIT(&lc->lro_active); /* create hash table to accelerate entry lookup */ - if (lro_entries > lro_mbufs) - elements = lro_entries; - else - elements = lro_mbufs; - lc->lro_hash = phashinit_flags(elements, M_LRO, &lc->lro_hashsz, + lc->lro_hash = phashinit_flags(lro_entries, M_LRO, &lc->lro_hashsz, HASH_NOWAIT); if (lc->lro_hash == NULL) { memset(lc, 0, sizeof(*lc));