From owner-dev-commits-src-branches@freebsd.org Tue Sep 7 21:12:43 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5785B66C54E; Tue, 7 Sep 2021 21:12:43 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H3yf24gpGz4VWB; Tue, 7 Sep 2021 21:12:42 +0000 (UTC) (envelope-from git@FreeBSD.org) 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 1CB0319BB8; Tue, 7 Sep 2021 21:12:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 187LCgPq023781; Tue, 7 Sep 2021 21:12:42 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 187LCgFc023780; Tue, 7 Sep 2021 21:12:42 GMT (envelope-from git) Date: Tue, 7 Sep 2021 21:12:42 GMT Message-Id: <202109072112.187LCgFc023780@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Alexander V. Chernikov" Subject: git: efa8c43ed6b5 - stable/13 - Rename variables inside nexhtop group consider_resize() code. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: melifaro X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: efa8c43ed6b5eaacb6cf126d978d3c1908607ecf Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Sep 2021 21:12:43 -0000 The branch stable/13 has been updated by melifaro: URL: https://cgit.FreeBSD.org/src/commit/?id=efa8c43ed6b5eaacb6cf126d978d3c1908607ecf commit efa8c43ed6b5eaacb6cf126d978d3c1908607ecf Author: Alexander V. Chernikov AuthorDate: 2021-03-29 23:06:13 +0000 Commit: Alexander V. Chernikov CommitDate: 2021-09-07 21:01:31 +0000 Rename variables inside nexhtop group consider_resize() code. No functional changes. (cherry picked from commit 0f30a36dedef43781f5003bdfcb4254d310f02e4) --- sys/net/route/nhgrp.c | 40 ++++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/sys/net/route/nhgrp.c b/sys/net/route/nhgrp.c index f40ee3c2981c..982ff2a72f15 100644 --- a/sys/net/route/nhgrp.c +++ b/sys/net/route/nhgrp.c @@ -82,7 +82,7 @@ * */ -static void consider_resize(struct nh_control *ctl, uint32_t new_nh_buckets, +static void consider_resize(struct nh_control *ctl, uint32_t new_gr_buckets, uint32_t new_idx_items); static int cmp_nhgrp(const struct nhgrp_priv *a, const struct nhgrp_priv *b); @@ -209,47 +209,47 @@ unlink_nhgrp(struct nh_control *ctl, struct nhgrp_priv *key) * Checks if hash needs resizing and performs this resize if necessary * */ -__noinline static void -consider_resize(struct nh_control *ctl, uint32_t new_nh_buckets, uint32_t new_idx_items) +static void +consider_resize(struct nh_control *ctl, uint32_t new_gr_bucket, uint32_t new_idx_items) { - void *nh_ptr, *nh_idx_ptr; + void *gr_ptr, *gr_idx_ptr; void *old_idx_ptr; size_t alloc_size; - nh_ptr = NULL ; - if (new_nh_buckets != 0) { - alloc_size = CHT_SLIST_GET_RESIZE_SIZE(new_nh_buckets); - nh_ptr = malloc(alloc_size, M_NHOP, M_NOWAIT | M_ZERO); + gr_ptr = NULL ; + if (new_gr_bucket != 0) { + alloc_size = CHT_SLIST_GET_RESIZE_SIZE(new_gr_bucket); + gr_ptr = malloc(alloc_size, M_NHOP, M_NOWAIT | M_ZERO); } - nh_idx_ptr = NULL; + gr_idx_ptr = NULL; if (new_idx_items != 0) { alloc_size = bitmask_get_size(new_idx_items); - nh_idx_ptr = malloc(alloc_size, M_NHOP, M_NOWAIT | M_ZERO); + gr_idx_ptr = malloc(alloc_size, M_NHOP, M_NOWAIT | M_ZERO); } - if (nh_ptr == NULL && nh_idx_ptr == NULL) { + if (gr_ptr == NULL && gr_idx_ptr == NULL) { /* Either resize is not required or allocations have failed. */ return; } - DPRINTF("mp: going to resize: nh:[ptr:%p sz:%u] idx:[ptr:%p sz:%u]", - nh_ptr, new_nh_buckets, nh_idx_ptr, new_idx_items); + DPRINTF("mp: going to resize: gr:[ptr:%p sz:%u] idx:[ptr:%p sz:%u]", + gr_ptr, new_gr_bucket, gr_idx_ptr, new_idx_items); old_idx_ptr = NULL; NHOPS_WLOCK(ctl); - if (nh_ptr != NULL) { - CHT_SLIST_RESIZE(&ctl->gr_head, mpath, nh_ptr, new_nh_buckets); + if (gr_ptr != NULL) { + CHT_SLIST_RESIZE(&ctl->gr_head, mpath, gr_ptr, new_gr_bucket); } - if (nh_idx_ptr != NULL) { - if (bitmask_copy(&ctl->gr_idx_head, nh_idx_ptr, new_idx_items) == 0) - bitmask_swap(&ctl->gr_idx_head, nh_idx_ptr, new_idx_items, &old_idx_ptr); + if (gr_idx_ptr != NULL) { + if (bitmask_copy(&ctl->gr_idx_head, gr_idx_ptr, new_idx_items) == 0) + bitmask_swap(&ctl->gr_idx_head, gr_idx_ptr, new_idx_items, &old_idx_ptr); } NHOPS_WUNLOCK(ctl); - if (nh_ptr != NULL) - free(nh_ptr, M_NHOP); + if (gr_ptr != NULL) + free(gr_ptr, M_NHOP); if (old_idx_ptr != NULL) free(old_idx_ptr, M_NHOP); }