public inbox for linux-pci@vger.kernel.org
 help / color / mirror / Atom feed
From: Jason Gunthorpe <jgg@nvidia.com>
To: fengchengwen <fengchengwen@huawei.com>
Cc: linux-pci@vger.kernel.org, bhelgaas@google.com
Subject: Re: [RFC] Proposal: Add sysfs interface for PCIe TPH Steering Tag retrieval and configuration
Date: Mon, 13 Apr 2026 10:35:42 -0300	[thread overview]
Message-ID: <20260413133542.GA1233417@nvidia.com> (raw)
In-Reply-To: <6ea4c4c2-774e-aa76-3665-918e2a24cc84@huawei.com>

On Fri, Apr 10, 2026 at 10:30:52PM +0800, fengchengwen wrote:

> Background: The TPH Steering Tag is tightly coupled with both a PCIe
> device (identified by its BDF) and a CPU core. It can only be
> obtained in kernel mode. To allow user-space applications to fetch
> and set this value securely and conveniently, we need a standard
> kernel-to-user interface.

There is no reason for userspace to have this value outside VFIO.

> Proposed Solution: Add several sysfs attributes under each PCIe device's
> sysfs directory:
> 1. /sys/bus/pci/devices/<BDF>/tph_mode to query the TPH mode (interrupt or
> device specific)
> 2. /sys/bus/pci/devices/<BDF>/tph_enable to control the TPH feature
> 3. /sys/bus/pci/devices/<BDF>/tph_st to support both read and write
> operations, e.g.:
>    Read operation:
>      echo "cpu=3" > /sys/bus/pci/devices/0000:01:00.0/tph_st
>      cat /sys/bus/pci/devices/0000:01:00.0/tph_st
>    Write operation:
>      echo "index=10 st=123" > /sys/bus/pci/devices/0000:01:00.0/tph_st

NAK

This is all low level details controled exclusively by the kernel
driver. Allowing userspace to mess it up will break drivers.

There is no justification to give userspace this kind of write access.

Jason

      parent reply	other threads:[~2026-04-13 13:35 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-10 14:30 [RFC] Proposal: Add sysfs interface for PCIe TPH Steering Tag retrieval and configuration fengchengwen
2026-04-13 10:01 ` Leon Romanovsky
2026-04-13 12:04   ` fengchengwen
2026-04-13 13:35 ` Jason Gunthorpe [this message]

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=20260413133542.GA1233417@nvidia.com \
    --to=jgg@nvidia.com \
    --cc=bhelgaas@google.com \
    --cc=fengchengwen@huawei.com \
    --cc=linux-pci@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