Linux PCI subsystem development
 help / color / mirror / Atom feed
From: Leon Romanovsky <leon@kernel.org>
To: Bjorn Helgaas <helgaas@kernel.org>
Cc: "Leon Romanovsky" <leonro@nvidia.com>,
	"Krzysztof Wilczyński" <kw@linux.com>,
	linux-pci@vger.kernel.org, "Ariel Almog" <ariela@nvidia.com>,
	"Aditya Prabhune" <aprabhune@nvidia.com>,
	"Hannes Reinecke" <hare@suse.de>,
	"Heiner Kallweit" <hkallweit1@gmail.com>,
	"Arun Easi" <aeasi@marvell.com>,
	"Jonathan Chocron" <jonnyc@amazon.com>,
	"Bert Kenward" <bkenward@solarflare.com>,
	"Matt Carlson" <mcarlson@broadcom.com>,
	"Kai-Heng Feng" <kai.heng.feng@canonical.com>,
	"Jean Delvare" <jdelvare@suse.de>,
	"Alex Williamson" <alex.williamson@redhat.com>,
	linux-kernel@vger.kernel.org, netdev@vger.kernel.org
Subject: [PATCH v1 2/2] net/mlx5: Enable unprivileged read of PCI VPD file
Date: Thu,  7 Nov 2024 20:56:57 +0200	[thread overview]
Message-ID: <f551f20b0649b4be3f4c9536e756986665366e46.1731005223.git.leonro@nvidia.com> (raw)
In-Reply-To: <cover.1731005223.git.leonro@nvidia.com>

From: Leon Romanovsky <leonro@nvidia.com>

mlx5 devices are PCIe spec compliant, doesn't expose any sensitive
information Vital Product Data (VPD) section. In addition, these devices
are capable to provide an unprivileged read access file exposed by PCI core.

The parsed VPD section looks like this:
08:00.0 Ethernet controller: Mellanox Technologies MT2910 Family
[ConnectX-7]
...
  Capabilities: [48] Vital Product Data
    Product Name: NVIDIA ConnectX-7 HHHL adapter Card, 200GbE / NDR200 IB, Dual-port QSFP112, PCIe 5.0 x16 with x16 PCIe
extension option, Crypto, Secure Boot Capable
    Read-only fields:
        [PN] Part number: MCX713106AEHEA_QP1
        [EC] Engineering changes: A5
        [V2] Vendor specific: MCX713106AEHEA_QP1
        [SN] Serial number: MT2314XZ0JUZ
        [V3] Vendor specific: 0a5efb8958deed118000946dae7db798
        [VA] Vendor specific: MLX:MN=MLNX:CSKU=V2:UUID=V3:PCI=V0:MODL=CX713106A
        [V0] Vendor specific: PCIeGen5 x16
        [VU] Vendor specific: MT2314XZ0JUZMLNXS0D0F0
        [RV] Reserved: checksum good, 1 byte(s) reserved
    End

Signed-off-by: Leon Romanovsky <leonro@nvidia.com>
---
 drivers/net/ethernet/mellanox/mlx5/core/main.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/ethernet/mellanox/mlx5/core/main.c b/drivers/net/ethernet/mellanox/mlx5/core/main.c
index 220a9ac75c8b..7e34badd174b 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/main.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/main.c
@@ -2280,6 +2280,7 @@ static struct pci_driver mlx5_core_driver = {
 	.sriov_configure   = mlx5_core_sriov_configure,
 	.sriov_get_vf_total_msix = mlx5_sriov_get_vf_total_msix,
 	.sriov_set_msix_vec_count = mlx5_core_sriov_set_msix_vec_count,
+	.downgrade_vpd_read = true,
 };
 
 /**
-- 
2.47.0


  parent reply	other threads:[~2024-11-07 18:57 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-07 18:56 [PATCH v1 0/2] Fix read permissions for VPD attributes Leon Romanovsky
2024-11-07 18:56 ` [PATCH v1 1/2] PCI/sysfs: Change " Leon Romanovsky
2024-11-11 20:41   ` Bjorn Helgaas
2024-11-11 21:17     ` Leon Romanovsky
2024-11-11 21:48       ` Bjorn Helgaas
2024-11-12  6:36         ` Leon Romanovsky
2024-11-12  0:34     ` Stephen Hemminger
2024-11-12  6:12       ` Leon Romanovsky
2024-11-12  6:44       ` Heiner Kallweit
2024-11-12  7:26         ` Leon Romanovsky
2024-11-12 21:48           ` Bjorn Helgaas
2024-11-11 21:08   ` Thomas Weißschuh
2024-11-07 18:56 ` Leon Romanovsky [this message]
2024-11-07 19:09   ` [PATCH v1 2/2] net/mlx5: Enable unprivileged read of PCI VPD file Jakub Kicinski
2024-11-11 20:31 ` [PATCH v1 0/2] Fix read permissions for VPD attributes Leon Romanovsky

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=f551f20b0649b4be3f4c9536e756986665366e46.1731005223.git.leonro@nvidia.com \
    --to=leon@kernel.org \
    --cc=aeasi@marvell.com \
    --cc=alex.williamson@redhat.com \
    --cc=aprabhune@nvidia.com \
    --cc=ariela@nvidia.com \
    --cc=bkenward@solarflare.com \
    --cc=hare@suse.de \
    --cc=helgaas@kernel.org \
    --cc=hkallweit1@gmail.com \
    --cc=jdelvare@suse.de \
    --cc=jonnyc@amazon.com \
    --cc=kai.heng.feng@canonical.com \
    --cc=kw@linux.com \
    --cc=leonro@nvidia.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=mcarlson@broadcom.com \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox