From nobody Thu Oct 31 16:53:38 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 4XfVSM1S1lz5c20Y; Thu, 31 Oct 2024 16:53:39 +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 4XfVSM0bSGz4kMj; Thu, 31 Oct 2024 16:53:39 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730393619; 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=e+mkoKl69XwVLkbHWkpvkU++/aQiKPa7Pi/1CDrPYq4=; b=Rx1ItAojmKPL06knLlxfzU1pdbM0OUgqpWyJoYuh5IgzCw39weaZ4ekYpE7XYK3tKlwaTA sNhmeG3FdmqkcSWf2dPlzZe+YjuUfvhMLz8C+gXfz41Ng5FgdahukT8LVcZbsWy5QI1VN/ 0kLWuiPxnNhcsBC4wVFymvU1dY4+OHTpb0RmEUF9qyQdFYhIx7FZ+JGh3Vsnqo+FEeRCDx 8I0qDSwkIvGZRK2ucIgFPsrAyut+NtfbVZLf/JB9/z+JlJrO3k03QQDrD6lgRt+bXM0s4o o82nPRYqtlNpv+1Hkuz1gJTalTM9IEZeiaD2DahxjLQVmLlVgI/9Yzc4NChttg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730393619; 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=e+mkoKl69XwVLkbHWkpvkU++/aQiKPa7Pi/1CDrPYq4=; b=ANmI9Hxp1mR8vnYD4XEcr8fY1IOP8X/Jbb67dwS9OU2MPvbGJiZTWqijtdRSJO1k+KeOiA JEjDGl58Jt+nJPOLtf49HcoJyOy+n/GqADkdye+bfCSiQ8jLb2HC9efG7nEEA8BvbBdDqO 0WOctqg6VXrdrgG9KIMRI6JgwsxcOSy33HGz2E6Pao58B+O+mW1t2pgeWJpPJsuxRdgvo9 9StJhzE78rJvOnVBt9o4BrBo98ndVnGtMzfqVUSfhF7EBYKwjD1AtNFAPmw22FkSpaSz76 F0R5Sgv00w6MZxIPhnlcf9he8RDP/a9SiDnQ3+Y05K1O6XRQoXESroU55IihRA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730393619; a=rsa-sha256; cv=none; b=jMqfn0wXAy3nVCqlZ54qMtGOaumq1/Mx3TMeR4vy8BL5aOFpQW/ezWUZWqOTifhXylFELf GXX9XdStwD7zFW6xtGYXChBU3wHdcGfwtjByiC5TohfsrMRlU8xlzdZqp4Uj9MpaUzwNhB 4AZhLDhuNnLnBeqmjoL91M/tVAGnRLSCRs/LSweZUeMRq3Zf182OwxaySAdxbFCAEXVQWo 5iyFWeQh8xTcXgvJxLUmr9BOBIShEXejMMwxmuRPpVqZp51pfK9nMfFK4Ph3EFNKzMzRao shzhxeJtVASeSXQYJPCdpJvruvizw/ExQag3CysZu6kp9CxOxETeG7MjLyry9w== 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 4XfVSM0BgTzl4c; Thu, 31 Oct 2024 16:53:39 +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 49VGrcL4069894; Thu, 31 Oct 2024 16:53:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49VGrcnE069891; Thu, 31 Oct 2024 16:53:38 GMT (envelope-from git) Date: Thu, 31 Oct 2024 16:53:38 GMT Message-Id: <202410311653.49VGrcnE069891@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Eric Joyner Subject: git: e53a21abdf29 - main - 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/main X-Git-Reftype: branch X-Git-Commit: e53a21abdf2953714e44e3c54b4bb78557cb096c Auto-Submitted: auto-generated The branch main has been updated by erj: URL: https://cgit.FreeBSD.org/src/commit/?id=e53a21abdf2953714e44e3c54b4bb78557cb096c commit e53a21abdf2953714e44e3c54b4bb78557cb096c Author: Eric Joyner AuthorDate: 2024-08-30 00:58:55 +0000 Commit: Eric Joyner CommitDate: 2024-10-31 16:50:48 +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 --- 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;