From nobody Tue Aug 20 15:35:03 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 4WpD6v1zDBz5TKvZ; Tue, 20 Aug 2024 15:35:03 +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 4WpD6v1SfRz43m2; Tue, 20 Aug 2024 15:35:03 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724168103; 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=m3yv+w0S5KCMnshnTd3fQuECAztO24HJHqD38N8zHLA=; b=l1V8iUDXpNyQgfBMSQ5w2V7EOKEZQAUVKlzkmw7Djp49ktKp6Kcm3t9WWPn0PB9I5ZmzRQ BCnS4OQBs/volcGiJUJi9tH327jo7TLW1YJmC9JB0ap6ZDpm9fg1PFWO5nP0SYoTvZjCFR sO2LA3i2jIhaaQip4JNG9YaeSU4Cj3lKHgvX5s/zYKgYzWbyDTRGVZCn+aQegRkLn4zL2F QC+ZiFGdGKuiy5/9nrr/F/pF8n0kqf6kFoCgdkNPpZYw2IP5752h5XjbU+mCvTlZUs8Ad5 ghl1OXc/vsiMfE1z5aSKHRJgd5W+Yyp0IjJtSOpEWTk2UwSuEn2RxmPnBYX4eA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724168103; a=rsa-sha256; cv=none; b=Ni1NN6NZR1/Tz4X+6VkMh4q0aupkfWzdApMNxe6NvYYD8A0bfDGiQXu8/N1ek6NFOtSCTK ndRamRB695gpdPYdktVl2c0EyR+QzgzEWFfwq9srevpOdDHFNHg9Bw/5q8Fcsa9i0ushH9 AAB/z6Wtcz5YumqfAtVHdoszIDCdWyQkkU/jAWEdOu1uwlZznFv+jq5W2ECKDlvhOMl2xD vu/VoSAhQrwxjv8MK8yxf3tKkt1e0D9+aSHKmQmoaIuyuClbI1RkGDefDEioji6713PnEW TJrx2yGsXqVX7JRx0wQtAdEEn3260bggIHrjrENelgNoFRxTj8yNjblCnBWHCA== 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=1724168103; 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=m3yv+w0S5KCMnshnTd3fQuECAztO24HJHqD38N8zHLA=; b=caLBXnVRSDgA8t+Y9WLmoKqN8r1iHA6UZjZ7mR2FI4AXrvCYWKhWefEia2Keuhbnf1Xzc3 YLcHmmKN7ZyMFFeQ1cF0KSxDRpBn1jUXgOXkYTuGSZkUkS61jXggc2aK8ox/K3GjvtrRox B0UKXK90OoFpEzqYgY0qRcf37w91Yto9vw9oxO/Hxa4ylgSbAkkS8cSljes1BoEecREUtF zEpV88T7eTK5DyJBXDhZSzJWASYbiLD6MIkRNTvZYa8egtyOYmARqUnewYEO3qHJOQ/0bm eLTd4xcIFFJ7Bwm75s0wOgthav+KVp4fNfS+jKkDU+GpOu3EZfUpaVFyCJGmpg== 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 4WpD6v14Wpz15py; Tue, 20 Aug 2024 15:35:03 +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 47KFZ3DK044501; Tue, 20 Aug 2024 15:35:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47KFZ3v8044498; Tue, 20 Aug 2024 15:35:03 GMT (envelope-from git) Date: Tue, 20 Aug 2024 15:35:03 GMT Message-Id: <202408201535.47KFZ3v8044498@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Michael Tuexen Subject: git: aa6c490bf80f - main - 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/main X-Git-Reftype: branch X-Git-Commit: aa6c490bf80fcef15cfc0d3f562fae19ef2375aa Auto-Submitted: auto-generated The branch main has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=aa6c490bf80fcef15cfc0d3f562fae19ef2375aa commit aa6c490bf80fcef15cfc0d3f562fae19ef2375aa Author: Michael Tuexen AuthorDate: 2024-08-20 15:30:55 +0000 Commit: Michael Tuexen CommitDate: 2024-08-20 15:30:55 +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 MFC after: 1 week Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D46378 --- 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 921d28f82517..2603815f9e61 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));