From nobody Thu Oct 31 16:55:03 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 4XfVTz5w4Kz5c2QY; Thu, 31 Oct 2024 16:55:03 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XfVTz3gHHz4kmr; Thu, 31 Oct 2024 16:55:03 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730393703; 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=fv87ny5AGY9WksmTKb5p7IgCmFGnyWMUSNDxf6VIDBM=; b=d0/LJ6ppur3AXk2zEZ/TXloorluDZ5vSaBAZqoMNEfxaipEHHSvq9+SbaHGMjLeBNniDFg iE/Ui6pPPKeCUSkxVl+EeJXhVapnNPo5pyz1YmaeUPWTR9fyDa5xh1wAASmniv6hQW903c TLUruRrw8aLZwUqX1QMru2kj6Po4PRCrlArp9CUNmNzYCMRqNvGR+9RAKCpqmFMs4vzHSn 4aHKs8PrSgCLA2wKQD8GswIonGuD330leS7JwF8NWNqeK4IY7ngX17//el5lI05GtyWtq3 S2D3M7my66yyqvRFCRz2WdblGT0hMTLmDwI0UGIk6KTjgrk9gYFxAYD+LlfFMw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730393703; 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=fv87ny5AGY9WksmTKb5p7IgCmFGnyWMUSNDxf6VIDBM=; b=IwqrUgRdaGf5Q2GPlZqSZrlLaSVHTN0JxEQ4LfqK5TFIsrnVdQzjNR1GRog0BkkYoIqhYa uywVkW0CKe+0XC1vja9LhCHzgDl51zuKdRfgHamWZPGzqQZidhKzDtvzELg83Pz66srGE5 j1VVfTq0WBbYPNbbwj+CL64JpiU87lj4DAM6z5u0cOKOWFqESLPmljSK1kE1C59GYUYLz8 i5BAwKdHNDiDn2oP/i7RjUpUklnTQGCY/QKItGhjvL8o2TAQUf4WkkUW3MXpqgu1LFr9O4 DfoifUs0+X1cf2+XZ6WQYR2ZOfYKqJC+qDlbYU+f5qVB6QaOaneePq74GFkn3g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730393703; a=rsa-sha256; cv=none; b=xi7U1aKnqLz1s0D6yLus0NeeNqNFH4zjFuUmSeVwCGX7S5ZuQWyld/PMqLQzBNhIc1YJ/h wiH7TTJTYai6/yhW9IpCAkUQ/X5Q/k+IjU3e7UM1qXCvT8d6Ajfg7zyM/9TAxfAj5QGn3i 49rtWsi1RaUWAYPjemG088iLRIqbzlZTjKsfPl0U3kXh6g57aCWLEZe1L6G0Gbk2AtEtY9 WZRFd814p3j6pdXOLgGdgbh9tlKmp956axwa46M7uVdYeLI+UH4ZnjwkKVL+6yvtbC9i4O uOToJSeql7PIdg9Zi6PufT8iC03IPzbhXeR86rfpT4BWx3nuRbTvkkjVEAoY7w== 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 4XfVTz2zSDzkq0; Thu, 31 Oct 2024 16:55:03 +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 49VGt3GY070521; Thu, 31 Oct 2024 16:55:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49VGt3JJ070518; Thu, 31 Oct 2024 16:55:03 GMT (envelope-from git) Date: Thu, 31 Oct 2024 16:55:03 GMT Message-Id: <202410311655.49VGt3JJ070518@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Eric Joyner Subject: git: b8ab635de4b5 - stable/14 - iavf(4): Get MSI-X BAR index at runtime instead of hardcoding it 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: erj X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: b8ab635de4b5cac9eb91dff57e9457d7d1f7f533 Auto-Submitted: auto-generated The branch stable/14 has been updated by erj: URL: https://cgit.FreeBSD.org/src/commit/?id=b8ab635de4b5cac9eb91dff57e9457d7d1f7f533 commit b8ab635de4b5cac9eb91dff57e9457d7d1f7f533 Author: Eric Joyner AuthorDate: 2024-08-30 00:58:55 +0000 Commit: Eric Joyner CommitDate: 2024-10-31 16:54:24 +0000 iavf(4): Get MSI-X BAR index at runtime instead of hardcoding it This allows iavf to load on E830 devices since those devices place their MSI-X BAR at a different location than in previous 800 series products. Signed-off-by: Eric Joyner Sponsored by: Intel Corporation Differential Revision: https://reviews.freebsd.org/D46952 (cherry picked from commit e53a21abdf2953714e44e3c54b4bb78557cb096c) --- sys/dev/iavf/iavf_lib.c | 7 ++++--- sys/dev/iavf/if_iavf_iflib.c | 4 ++-- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/sys/dev/iavf/iavf_lib.c b/sys/dev/iavf/iavf_lib.c index f80e3765448f..3116ce0501c2 100644 --- a/sys/dev/iavf/iavf_lib.c +++ b/sys/dev/iavf/iavf_lib.c @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause */ -/* Copyright (c) 2021, Intel Corporation +/* Copyright (c) 2024, Intel Corporation * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -1479,10 +1479,11 @@ iavf_update_msix_devinfo(device_t dev) { struct pci_devinfo *dinfo; u32 msix_ctrl; + u8 msix_location; dinfo = (struct pci_devinfo *)device_get_ivars(dev); - /* We can hardcode this offset since we know the device */ - msix_ctrl = pci_read_config(dev, 0x70 + PCIR_MSIX_CTRL, 2); + msix_location = dinfo->cfg.msix.msix_location; + msix_ctrl = pci_read_config(dev, msix_location + PCIR_MSIX_CTRL, 2); dinfo->cfg.msix.msix_ctrl = msix_ctrl; dinfo->cfg.msix.msix_msgnum = (msix_ctrl & PCIM_MSIXCTRL_TABLE_SIZE) + 1; } diff --git a/sys/dev/iavf/if_iavf_iflib.c b/sys/dev/iavf/if_iavf_iflib.c index 714d34eeebe5..d460df6e0d25 100644 --- a/sys/dev/iavf/if_iavf_iflib.c +++ b/sys/dev/iavf/if_iavf_iflib.c @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause */ -/* Copyright (c) 2021, Intel Corporation +/* Copyright (c) 2024, Intel Corporation * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -370,7 +370,7 @@ iavf_if_attach_pre(if_ctx_t ctx) } scctx->isc_rxqsizes[0] = roundup2(scctx->isc_nrxd[0] * sizeof(union iavf_32byte_rx_desc), DBA_ALIGN); - scctx->isc_msix_bar = PCIR_BAR(IAVF_MSIX_BAR); + scctx->isc_msix_bar = pci_msix_table_bar(dev); scctx->isc_tx_nsegments = IAVF_MAX_TX_SEGS; scctx->isc_tx_tso_segments_max = IAVF_MAX_TSO_SEGS; scctx->isc_tx_tso_size_max = IAVF_TSO_SIZE;