From nobody Wed Jul 17 14:21:48 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 4WPJ651lWtz5RPgP; Wed, 17 Jul 2024 14:21:49 +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 4WPJ645HDDz4t9F; Wed, 17 Jul 2024 14:21:48 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1721226108; 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=wI9EAmhI7TCrAam/oygGqj4Z87hc5YzMfTeVYmYk3WI=; b=Bf5U5GBsuorL9P9zbiIJ38SCeuMbZ6g4OZAr3xWO+D9rJirYaBf4lCKizqgU8VRsZDLyZR PfpsEFOQBbbxl/IInHvI7445fekLPUaZXje13pqMOHSx1/Qj25ptcIYij8RKP5FhcH28d7 TRA1DMjzWpatno+C9fCVDOxhzBDri63EOnXHIfMPhJMvCf7L9ZdNuYsaZwO+DwUGdwh0i5 zRTTFGv0dFTIz/Ct0WH/vJELwbI/aBG8yX4whxfMP3vTbSzbcMQxVrakMskWEyLzGK9Rz7 183L3v52/HL9XEKD9F8S4GD2WEI/m1G59GUjOTFY1Ia9ngjq7PDPRtHa6CLEuw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1721226108; a=rsa-sha256; cv=none; b=QGbzsdoKwBHlbw2AMNqQP2pQeZAy648GNBU1t0DCa8PFCHCC+d7iwXagMGiPYeoIIWBiQh qzx64sbGJDSfdfoDvAf9D327eHDcIZUJGKAxsKdKAj6FEVtEJ2bjE4cLxbL0+hzY3iD301 W36R6bTEw4+oMzqqme2qQGYNetTG18dDp1JH95vsyHKwte7qjyoSdvRu2x7K/WNk2gs1VF T2UacUkCUwOSC/Uys+X+5FB99yUBKrZDU0AjxF6JKn7BHabVHv/Q2+uUU3VX15JnkPJmDk LUG6UPaEvpoXUwUR9hH5QUYZF6U3Qn43cpKZ8z+g/bcUlidBM1oEqcHR0PqdWQ== 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=1721226108; 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=wI9EAmhI7TCrAam/oygGqj4Z87hc5YzMfTeVYmYk3WI=; b=Z9qddDOW2ah0QqxKPmYweCWZ1m53GbCjb6Y+wDEG7jIKS2wZ1qVshAR1q8+f2Ii/srxwuN zL2v0of9qvi3wOTnSzLz2Lf8TUOUwcUGLCiKBVB45TWWzfRfU+Uk+WotibdpD/vV/ptIjk AK9j53W+dJu6h7m/UGn7DK6UhQ8ETvI1LlKCIqte4a5gFbMDuzFOqPdNBJCw+VbOV4HXnI Y2v3/UEm1zveiPPLmUNi/5T/icW88ypGfLUFTwM0xL76w/Ne+pspbaofAqgN2/zeUyj7Xg Bk8QsHYsq1sDG4pe4MPLp6QOKa2QzGeWrbDMliQ4tTjAh4/UX+4+SdtocuP2fg== 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 4WPJ644vdqz1N0f; Wed, 17 Jul 2024 14:21:48 +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 46HELmV2030960; Wed, 17 Jul 2024 14:21:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46HELmlM030957; Wed, 17 Jul 2024 14:21:48 GMT (envelope-from git) Date: Wed, 17 Jul 2024 14:21:48 GMT Message-Id: <202407171421.46HELmlM030957@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Navdeep Parhar Subject: git: c0b69999b1b3 - stable/14 - cxgbe(4): Query TPCHMAP once and not once per port. 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: np X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: c0b69999b1b34cc02b02222a63e0cd918c522e88 Auto-Submitted: auto-generated The branch stable/14 has been updated by np: URL: https://cgit.FreeBSD.org/src/commit/?id=c0b69999b1b34cc02b02222a63e0cd918c522e88 commit c0b69999b1b34cc02b02222a63e0cd918c522e88 Author: Navdeep Parhar AuthorDate: 2024-04-30 23:32:55 +0000 Commit: Navdeep Parhar CommitDate: 2024-07-17 06:38:57 +0000 cxgbe(4): Query TPCHMAP once and not once per port. Sponsored by: Chelsio Communications (cherry picked from commit 7f10048f983a31c09587b436e7fb073f7cbb76e4) --- sys/dev/cxgbe/common/common.h | 4 +++- sys/dev/cxgbe/common/t4_hw.c | 11 ++--------- sys/dev/cxgbe/t4_main.c | 8 ++++++++ 3 files changed, 13 insertions(+), 10 deletions(-) diff --git a/sys/dev/cxgbe/common/common.h b/sys/dev/cxgbe/common/common.h index f43ffc83dff1..67bbf5e43b79 100644 --- a/sys/dev/cxgbe/common/common.h +++ b/sys/dev/cxgbe/common/common.h @@ -402,7 +402,9 @@ struct adapter_params { unsigned int max_ordird_qp; unsigned int max_ird_adapter; - uint32_t mps_bg_map; /* rx buffer group map for all ports (upto 4) */ + /* These values are for all ports (8b/port, upto 4 ports) */ + uint32_t mps_bg_map; /* MPS rx buffer group map */ + uint32_t tp_ch_map; /* TPCHMAP from firmware */ bool ulptx_memwrite_dsgl; /* use of T5 DSGL allowed */ bool fr_nsmr_tpte_wr_support; /* FW support for FR_NSMR_TPTE_WR */ diff --git a/sys/dev/cxgbe/common/t4_hw.c b/sys/dev/cxgbe/common/t4_hw.c index 3e04995eec3b..07940a44f66e 100644 --- a/sys/dev/cxgbe/common/t4_hw.c +++ b/sys/dev/cxgbe/common/t4_hw.c @@ -6774,15 +6774,8 @@ static unsigned int t4_get_rx_e_chan_map(struct adapter *adap, int idx) */ static unsigned int t4_get_rx_c_chan(struct adapter *adap, int idx) { - u32 param, val; - int ret; - - param = (V_FW_PARAMS_MNEM(FW_PARAMS_MNEM_DEV) | - V_FW_PARAMS_PARAM_X(FW_PARAMS_PARAM_DEV_TPCHMAP)); - ret = t4_query_params(adap, adap->mbox, adap->pf, 0, 1, ¶m, &val); - if (!ret) - return (val >> (8 * idx)) & 0xff; - + if (adap->params.tp_ch_map != UINT32_MAX) + return (adap->params.tp_ch_map >> (8 * idx)) & 0xff; return 0; } diff --git a/sys/dev/cxgbe/t4_main.c b/sys/dev/cxgbe/t4_main.c index 1c4fe4b4d0cf..2e885b9c3ffe 100644 --- a/sys/dev/cxgbe/t4_main.c +++ b/sys/dev/cxgbe/t4_main.c @@ -5339,6 +5339,14 @@ get_params__post_init(struct adapter *sc) else sc->params.mps_bg_map = UINT32_MAX; /* Not a legal value. */ + param[0] = FW_PARAM_DEV(TPCHMAP); + val[0] = 0; + rc = -t4_query_params(sc, sc->mbox, sc->pf, 0, 1, param, val); + if (rc == 0) + sc->params.tp_ch_map = val[0]; + else + sc->params.tp_ch_map = UINT32_MAX; /* Not a legal value. */ + /* * Determine whether the firmware supports the filter2 work request. */