From nobody Fri Nov 04 22:55:51 2022 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 4N3wvq56NLz4h0Hm; Fri, 4 Nov 2022 22:55:51 +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 4N3wvq4J20z40VT; Fri, 4 Nov 2022 22:55:51 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1667602551; 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=t+1r25cIThjuTqDgtLkK8ATm/2mecktNGcC0s3OUi1E=; b=ClpU64J8sHYSOmgO7MoYeBfD2lv8ID+c+sD+N42fV6UwoDfk96bEnB4AJz3LkwerBDfB9o lFRFK07mnev0kh4fNuGzHcW1tHZCtIKQB9NARozzD/kh/Tb07+ilXNkjf4IXaNDAP1Jcq8 t1r/BHWe7Nn5rnoEp2yC6kSAHr3nqWXTEspuubz3z3qOml6I+ahsrkyGCrVom8MGbau8H6 doGgB/OZtweTAwaRwVrWDjw+WpshIZqfhzg/BV3sQonhFqk4yuzvBqOtTL0W/Gp5r8tEnk lJOAtz5GwRdZex+PkLgTSU3rKU5ZD7d+qvWaKCuNw/SgyrPjgtUMxsMXCmDAxQ== 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 4N3wvq36v3zKDB; Fri, 4 Nov 2022 22:55:51 +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 2A4MtpHV032670; Fri, 4 Nov 2022 22:55:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 2A4MtpLL032669; Fri, 4 Nov 2022 22:55:51 GMT (envelope-from git) Date: Fri, 4 Nov 2022 22:55:51 GMT Message-Id: <202211042255.2A4MtpLL032669@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: cfdca95f7834 - main - if_bnxt: Add support for RSS on Thor 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: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: cfdca95f7834d2c10749fb14e12495d8aa7d1be0 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1667602551; 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=t+1r25cIThjuTqDgtLkK8ATm/2mecktNGcC0s3OUi1E=; b=fyPWpT5Ny2pHWM2R6sQn70hI5TBwq422OSSqZxb3G6tUi3GIID/8C2NWSw+lUGq1pM+m77 1p8xiSFHIAux6fPrgNYBJBqOhSE1cF33RasZnM32nVisWf6q6KV282R2oJh4DHWKOENUud 68LAOPreqs2Fw0m264tc11CN/vb93BmCY4c7+bWi5LVOfUn/DUOELftPbKtyl/INh8w9Q7 QYrTAwd5x+majcHyZcXuXsn4oCB3LEkuFaGYLDOFGNqZpAZZGUj+gccJUowUQdwe2RWGk7 g2No5vs9oI/rmSMnn9T8KEMGPNLZJY0sbqt+jd2N9zDB5l62My5F6j8n58uV7g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1667602551; a=rsa-sha256; cv=none; b=duWJRosP9wOmMJk7JVdtEetoLUKLMvaDP6QV3hhhAc09TbNXW7E+lQU0vbJmeMBgEg/Cvl dy21AKEFR0zYjUYDLZ/0Xf6YXnbMVwauMy1f4CkQECpHoJAOxQCyyu9akiv5muvr2K8hSl WleBfHCt6hy7wNYhvmc+eDIvcNPbsjDKz650KPwYA//wEsj5NlOB4KLbDhWbS8RwB/d0EA WfBxZ5WAhhIwqYRoFjbE3R+waqqwIX4JuzddLLFdQpupsjL5rQM275dkRlK1voZcLuiZAe NiXlgxvwk/MtKRWox/sIi1koMDO1IKBEfKO3u0vIPAwSuG6F/gpz+Ec2Q976JQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=cfdca95f7834d2c10749fb14e12495d8aa7d1be0 commit cfdca95f7834d2c10749fb14e12495d8aa7d1be0 Author: Sumit Saxena AuthorDate: 2022-11-04 22:21:20 +0000 Commit: Warner Losh CommitDate: 2022-11-04 22:21:20 +0000 if_bnxt: Add support for RSS on Thor Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D36442 --- sys/dev/bnxt/bnxt_hwrm.c | 9 +++++---- sys/dev/bnxt/if_bnxt.c | 28 +++++++++++++++++++--------- 2 files changed, 24 insertions(+), 13 deletions(-) diff --git a/sys/dev/bnxt/bnxt_hwrm.c b/sys/dev/bnxt/bnxt_hwrm.c index 91e6865449ac..ebcfc5ef03ff 100644 --- a/sys/dev/bnxt/bnxt_hwrm.c +++ b/sys/dev/bnxt/bnxt_hwrm.c @@ -1494,16 +1494,17 @@ bnxt_hwrm_rss_cfg(struct bnxt_softc *softc, struct bnxt_vnic_info *vnic, { struct hwrm_vnic_rss_cfg_input req = {0}; - /* TBD */ - if (BNXT_CHIP_P5(softc)) - return 0; - bnxt_hwrm_cmd_hdr_init(softc, &req, HWRM_VNIC_RSS_CFG); req.hash_type = htole32(hash_type); req.ring_grp_tbl_addr = htole64(vnic->rss_grp_tbl.idi_paddr); req.hash_key_tbl_addr = htole64(vnic->rss_hash_key_tbl.idi_paddr); req.rss_ctx_idx = htole16(vnic->rss_id); + req.hash_mode_flags = HWRM_FUNC_SPD_CFG_INPUT_HASH_MODE_FLAGS_DEFAULT; + if (BNXT_CHIP_P5(softc)) { + req.vnic_id = htole16(vnic->id); + req.ring_table_pair_index = 0x0; + } return hwrm_send_message(softc, &req, sizeof(req)); } diff --git a/sys/dev/bnxt/if_bnxt.c b/sys/dev/bnxt/if_bnxt.c index 6b4e7b516b67..c63b47da4a89 100644 --- a/sys/dev/bnxt/if_bnxt.c +++ b/sys/dev/bnxt/if_bnxt.c @@ -1719,6 +1719,23 @@ bnxt_func_reset(struct bnxt_softc *softc) return; } +static void +bnxt_rss_grp_tbl_init(struct bnxt_softc *softc) +{ + uint16_t *rgt = (uint16_t *) softc->vnic_info.rss_grp_tbl.idi_vaddr; + int i, j; + + for (i = 0, j = 0; i < HW_HASH_INDEX_SIZE; i++) { + if (BNXT_CHIP_P5(softc)) { + rgt[i++] = htole16(softc->rx_rings[j].phys_id); + rgt[i] = htole16(softc->rx_cp_rings[j].ring.phys_id); + } else { + rgt[i] = htole16(softc->grp_info[j].grp_id); + } + if (++j == softc->nrxqsets) + j = 0; + } +} /* Device configuration */ static void @@ -1726,7 +1743,7 @@ bnxt_init(if_ctx_t ctx) { struct bnxt_softc *softc = iflib_get_softc(ctx); struct ifmediareq ifmr; - int i, j; + int i; int rc; if (!BNXT_CHIP_P5(softc)) { @@ -1837,14 +1854,7 @@ skip_def_cp_ring: if (rc) goto fail; - /* Enable RSS on the VNICs */ - for (i = 0, j = 0; i < HW_HASH_INDEX_SIZE; i++) { - ((uint16_t *) - softc->vnic_info.rss_grp_tbl.idi_vaddr)[i] = - htole16(softc->grp_info[j].grp_id); - if (++j == softc->nrxqsets) - j = 0; - } + bnxt_rss_grp_tbl_init(softc); rc = bnxt_hwrm_rss_cfg(softc, &softc->vnic_info, softc->vnic_info.rss_hash_type);