From nobody Wed Jul 17 14:24:43 2024 X-Original-To: dev-commits-src-branches@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 4WPJ9S1dXlz5RPyp; Wed, 17 Jul 2024 14:24:44 +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 4WPJ9S0QpLz418N; Wed, 17 Jul 2024 14:24:44 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1721226284; 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=11DpPC1HMOS9GH7uGSo3nOCC4THw7M9VH0nEbtmM1m4=; b=BJd/nEUhNtQohmQtgm95E3ptklgWd97zB8BOatok8skIlixpDG7xuQ+Xh/tvQTA94lWaDT ygXf3iPe+LCI5GZ6bVYV3bgsDAzSPRzqE8r7wPj6ACUKUP3SYOtr4Zu8FDNeBTIe2AMXf7 mBH5IzEfhqoKwW11NMjt0KI7FRYc8Y9x9EpE0Vntn9uOqT70R9WK93D3KB87A6WAj2sZMB xJ9ru3UjmQXE2lK0wQmrWiSHAM6oE6VIGsI6rPZXbi0xFBSpvNB99KTZECe+cY8KtrPipo /4pDUDmoSj8p2w7s52NqjCzq5c2ETW3sjY4wM1CwgQu3sI/ntV4Ia53bTWs8MA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1721226284; a=rsa-sha256; cv=none; b=g2TBSG3ReapKmyeK1oaVw8lgGAXsqRYe41fBDtWOPLcesYw23lJndb8fhE9Z3e8g97bxl1 yODgsKnvTHdcYoCfG5djTsx3suAOWw1p8CNek+cEPEKXdERNoxNSW7QvksNjg3qGvjHUW9 a80AwweFRyAmbulD8aLGDJ2KRmo7i98pdm7ztI42RQEo+eQlUcKKsE3NPrHHCwP8BQXBxn ZSe1Am28p5j5zBIRhXx1BRThc14VSkY155K3YwOXZacrQSx/EbTAQKU2fuFZJaxnI9aFTZ XkqRpuGteM8hLblxiA/BJ1oKwvZSBYgG7gZmwSp8kqPumvVZI+NC0IJnp6Rdyg== 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=1721226284; 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=11DpPC1HMOS9GH7uGSo3nOCC4THw7M9VH0nEbtmM1m4=; b=cc1x8lCQ+McrFHam67RCm8vbQ5FjO6gvGReS5Qvr+FjW4fLFbkoVqL9f1o8r/ALio+juYX kMsqlSNVJRKmeBF/FMmGClNv3t+U5PW0ckZUWkd+JZUjV1rL2ohsWykDZQFQ3H4lXcO+Pf a+jW+njOFP9/50h9FsuELCf/owsmtPHwfpLg/2i91SbCyDmEVh7uQSFX/W1vx/gy5eYej1 I16mVKNd33uw90OD3Bh2l4nFlzdtfN+q1PmRa2IJdjqSbyM9SGTMQ2hWOKe7HkVMb7U4ml OAQN4PGKGB829w9OCw8H/qsVtEuIWzKkGC6JoPXCt19qtiIcjaGw3VpxmHJKcQ== 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 4WPJ9S03Hgz1Mb2; Wed, 17 Jul 2024 14:24:44 +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 46HEOhiK033396; Wed, 17 Jul 2024 14:24:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46HEOhGe033393; Wed, 17 Jul 2024 14:24:43 GMT (envelope-from git) Date: Wed, 17 Jul 2024 14:24:43 GMT Message-Id: <202407171424.46HEOhGe033393@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: ab374f82d9f1 - stable/13 - cxgbe(4): Query TPCHMAP once and not once per port. List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@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/13 X-Git-Reftype: branch X-Git-Commit: ab374f82d9f1060154938117946a2953ac8926c9 Auto-Submitted: auto-generated The branch stable/13 has been updated by np: URL: https://cgit.FreeBSD.org/src/commit/?id=ab374f82d9f1060154938117946a2953ac8926c9 commit ab374f82d9f1060154938117946a2953ac8926c9 Author: Navdeep Parhar AuthorDate: 2024-04-30 23:32:55 +0000 Commit: Navdeep Parhar CommitDate: 2024-07-17 07:16:20 +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 ae6e25e47a15..842eb87e9126 100644 --- a/sys/dev/cxgbe/t4_main.c +++ b/sys/dev/cxgbe/t4_main.c @@ -5412,6 +5412,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. */