From nobody Fri Aug 30 06:30:17 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 4Ww7Yj2hKGz5T9cs; Fri, 30 Aug 2024 06:30:17 +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 4Ww7Yj26ypz4FFS; Fri, 30 Aug 2024 06:30:17 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724999417; 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=8bC6TWBdOA13lnPX+r/4Yq10q9CVFKu4CaBnwn/3FNY=; b=fLocUuB3+44vxzy1wUJ6eMTSsetsLgF46olTmHCHeG/YCws6o65OOVk5NfYAdaA1FT6suf LsW1QY/MJRMTcuvlUI0gjOVN2iZhgLom8IfsGp3GD16v8Vvkae85GHmL2s0ZkDKkgLq9Xi COMlSeBuMY8kFLsNwD7ORGApe73AxFWUgPXTU4JfhdtfGZn+Q7sg0TzPwKJ2m2UPZOJHzV fkBtTCzzJGrocYXcBFslPiTDPryjeS/ccJjrmmQfFTjUpOaMtkKc34J3Zv0V3w6LJ4I8uS +Bb2YS1rWWDa2i0fFn4xseRYv2TrpKRiBSDffvJwzi5GMoCGIT4wJgdDdCMfzA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724999417; a=rsa-sha256; cv=none; b=GoHigOInrkNfGsMNbOFqvCN9tclirIhMf69KMTrQtEEZcNyqHNCT3yV1y3MASooXTgMET+ ZjZBjB18mTNZMk7Z/zbXYwTu6wfkfNfKI5/s4g1f3invGfkMystBk5Y1DJwvlDJb/VZcWr DXxF/zX9HdqFNfEaEuxo1wGd90agW3q6IZ1b8FOy+7rMjg7MWas+cqz4MWRnBbauWIPjli +zxCXvfKcYgBGK9Bu7sf0hdHTZ/rPHG4am3YLwgFoMOYQzgDItxab7qjLyhQv1DBhfE4oB tZK7cxU0Yx4Qx7F+dN5SCZxNXiUkkA9QRdBriFYTckbLnu/f6qe2FRYUm9d6WA== 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=1724999417; 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=8bC6TWBdOA13lnPX+r/4Yq10q9CVFKu4CaBnwn/3FNY=; b=BeGr++FqK6JMAhAwcXfjroEidaw4sEQq+bUGotBK5SkZmsPwMmhHHvT08UcHt9EdkLK3wR +x6ulPqCtmMHwwYIwKe94LllkXehBnOSnspc+y7besTgnnqE+NCLpZKYgsXvlWpELffLIX agbN4NYV0u6wliYz1ZiXnvurk89NXaCgFuSX9xIz6MR7mscYzQJMygeG2V4aHCrSl7kONT aLg72iDvfOckm13FpUCMdJ2eHlFsoxGoxJy6AcDkgGtmMofqGssuIrSyiwz+ejV6iq2fzb eqefxMu455FylrCBMJU7x88ueBeYUN4SIRXGsUPLdv2pBFYz537axwJX6QzbTw== 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 4Ww7Yj1kLRzpwc; Fri, 30 Aug 2024 06:30:17 +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 47U6UHu8050118; Fri, 30 Aug 2024 06:30:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47U6UHEf050113; Fri, 30 Aug 2024 06:30:17 GMT (envelope-from git) Date: Fri, 30 Aug 2024 06:30:17 GMT Message-Id: <202408300630.47U6UHEf050113@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: e0bcb3aa4f07 - stable/14 - tcp: initialize the LRO hash table with correct size 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: e0bcb3aa4f07e3336ceec48a3b53ed0c74e03e93 Auto-Submitted: auto-generated The branch stable/14 has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=e0bcb3aa4f07e3336ceec48a3b53ed0c74e03e93 commit e0bcb3aa4f07e3336ceec48a3b53ed0c74e03e93 Author: Michael Tuexen AuthorDate: 2024-08-20 15:30:55 +0000 Commit: Michael Tuexen CommitDate: 2024-08-30 06:29:50 +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 2811cf25a052..906e01257a04 100644 --- a/sys/netinet/tcp_lro.c +++ b/sys/netinet/tcp_lro.c @@ -175,7 +175,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; @@ -190,11 +190,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));