From nobody Mon Jun 24 07:27:56 2024 X-Original-To: dev-commits-src-main@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 4W70190WN3z5NX7J; Mon, 24 Jun 2024 07:27:57 +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 4W70186XJKz4TPH; Mon, 24 Jun 2024 07:27:56 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1719214076; 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=qCBkjXzN1i7kN3cnDZnGQCMnuJtN6h8mgVr/lrM0DEY=; b=BGVpysu6issCU2vYt/WYD5PPr9rDvFK3PxzfKC0cg2z/+1BddmBVa2nYj8VRuPJjNh9KYt YeM89wPJzSgjuCRdWDR3JvONKvItjFCA/3qSrpRHro1S5mR3Plcj8t1j0Z8O2AEjUbubfU xOnGBuqGZzwE7i3g82We6/QS7Q7tLFR1GWcnYwOScEZdBWllDrIMxVp3XQAuE+56vGSya6 i1K45+Iz7IiZTdrGXvpoLlF5UQhzGkFnxh0Qc+DJ1FTcI8g+PyQniIRdHLzWErXbWga2nb jSjibAJu86NaMbBYQMuMqBmDfZvYBI4hEklI9/dYnAsCBSSbVHAxZJyY1+VBYw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1719214076; a=rsa-sha256; cv=none; b=DRebW15Hon3/TtwMgan1x1KAuwTBwz/lswEr124QHj6NeYACNFVZXsYfMm2Z38TZb5C67q 7cq8tm6+8Rfbe9RrBm3NRtnyuocDPG78+jNGk0/OAoiy115fKp+mxf/8w2azWNCPJp9dh9 edwHAt85p7BZs7vMXYO3Wwp1+7XntXBS2VT7UJL5OB1GHIdiK1mP8s1ZGpaG5iYmTXPHiF Gr7NC+xcn/qCR4Va9RsQ3NoyOFj/z1eMO/HRBqPiNSdbxMf27cvD1NnnBS/balZkKWuuEx jtZgxIP4xKjtzyeFF/eboF/3fTkCdHU0UkHINUC54xU97KgT3FIqvDfS4+VjVA== 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=1719214076; 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=qCBkjXzN1i7kN3cnDZnGQCMnuJtN6h8mgVr/lrM0DEY=; b=M5nHGzJw2jK5IDvY/Fnlw4Z6I6NLrxkVIl5CK8hz4830S4maNL+q6QoRXjMtm86sdPYGng qzx39RWIQ137V5vedrI4Y6I6VWZS4jSRiWPmXhD3GeTAMvAQNT46+mkHh4tujGRJjidfqb IjZLBu2bVrWoTJhOUwpT+Eqw+HrSuvNXUofCXlTSeoLwXTixH89wZR9tE5+xWBCCWvDylN o2SaCoh1b6vZ+Tndeb0+2vA0+ffOMffNfyPWxMIJTc9EI42JMMvO3E91FOBGj1f96Y023W YZVEjClHU8ghWwVENhtShhcs5iGSFx8muDzTg3I9SXvNKCVdlGRI8DngSBnLlw== 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 4W70185yFLz189r; Mon, 24 Jun 2024 07:27:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 45O7RudD044491; Mon, 24 Jun 2024 07:27:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 45O7RuUa044487; Mon, 24 Jun 2024 07:27:56 GMT (envelope-from git) Date: Mon, 24 Jun 2024 07:27:56 GMT Message-Id: <202406240727.45O7RuUa044487@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Doug Moore Subject: git: 87177ce3aa98 - main - irdma: Use round{up,down}_pow_of_two List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dougm X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 87177ce3aa981ab2af40fd26c68481430d0867a4 Auto-Submitted: auto-generated The branch main has been updated by dougm: URL: https://cgit.FreeBSD.org/src/commit/?id=87177ce3aa981ab2af40fd26c68481430d0867a4 commit 87177ce3aa981ab2af40fd26c68481430d0867a4 Author: Doug Moore AuthorDate: 2024-06-24 07:20:49 +0000 Commit: Doug Moore CommitDate: 2024-06-24 07:20:49 +0000 irdma: Use round{up,down}_pow_of_two Use roundup_pow_of_two and rounddown_pow_of_two in place of expressions. Reviewed by: alc, markj Differential Revision: https://reviews.freebsd.org/D45536 --- sys/dev/irdma/irdma_ctrl.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/dev/irdma/irdma_ctrl.c b/sys/dev/irdma/irdma_ctrl.c index 6078ac43815e..79ed14a60670 100644 --- a/sys/dev/irdma/irdma_ctrl.c +++ b/sys/dev/irdma/irdma_ctrl.c @@ -4939,7 +4939,7 @@ irdma_cfg_fpm_val(struct irdma_sc_dev *dev, u32 qp_count) qpwanted = min(qp_count, hmc_info->hmc_obj[IRDMA_HMC_IW_QP].max_cnt); if (qpwanted != 0) - qpwanted = 1 << ilog2(qpwanted); + qpwanted = rounddown_pow_of_two(qpwanted); mrwanted = hmc_info->hmc_obj[IRDMA_HMC_IW_MR].max_cnt; pblewanted = hmc_info->hmc_obj[IRDMA_HMC_IW_PBLE].max_cnt; @@ -4982,7 +4982,7 @@ irdma_cfg_fpm_val(struct irdma_sc_dev *dev, u32 qp_count) hmc_info->hmc_obj[IRDMA_HMC_IW_MR].cnt = mrwanted; hte = round_up(qpwanted + hmc_info->hmc_obj[IRDMA_HMC_IW_FSIMC].cnt, 512); - hte = hte == 0 ? 1 : 1 << fls(hte - 1); + hte = roundup_pow_of_two(hte); hmc_info->hmc_obj[IRDMA_HMC_IW_HTE].cnt = hte * hmc_fpm_misc->ht_multiplier; if (dev->hw_attrs.uk_attrs.hw_rev == IRDMA_GEN_1)