mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Alexandre Courbot" <acourbot@nvidia.com>
To: "Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>,
	"Zhi Wang" <zhiw@nvidia.com>,
	"Danilo Krummrich" <dakr@kernel.org>
Cc: "Zhi Wang" <zhiw@nvidia.com>, <rust-for-linux@vger.kernel.org>,
	<linux-pci@vger.kernel.org>,
	"LKML" <linux-kernel@vger.kernel.org>, <dakr@kernel.org>,
	<aliceryhl@google.com>, <bhelgaas@google.com>,
	<kwilczynski@kernel.org>, <ojeda@kernel.org>, <boqun@kernel.org>,
	<gary@garyguo.net>, <bjorn3_gh@protonmail.com>,
	<lossin@kernel.org>, <a.hindborg@kernel.org>, <tmgross@umich.edu>,
	<markus.probst@posteo.de>, <cjia@nvidia.com>, <smitra@nvidia.com>,
	<ankita@nvidia.com>, <aniketa@nvidia.com>, <kwankhede@nvidia.com>,
	<targupta@nvidia.com>, <kjaju@nvidia.com>, <alkumar@nvidia.com>,
	<jhubbard@nvidia.com>, <zhiwang@kernel.org>,
	<joelagnelf@nvidia.com>, <daniel.almeida@collabora.com>,
	<tamird@kernel.org>, <work@onurozkan.dev>
Subject: Re: [PATCH v9 1/1] rust: pci: add extended capability and SR-IOV support
Date: Sun, 06 Sep 2026 09:51:26 +0900	[thread overview]
Message-ID: <DL7TLEGXO3EB.11S8R36MBJN6A@nvidia.com> (raw)
In-Reply-To: <d04e5913-3f22-e574-e123-775cc1246566@linux.intel.com>

On Mon Aug 31, 2026 at 10:21 PM JST, Ilpo Järvinen wrote:
> On Thu, 27 Aug 2026, Zhi Wang wrote:
<...>
>> +crate::bitfield! {
>> +    /// Low DWORD of an SR-IOV VF BAR.
>> +    struct VfBarLow(u32) {
>
> I admit not knowing that much about Rust but this caught my eye...
>
> The PCIe spec says:
>
> "These fields must define the VF’s Base Address Registers (BARs). These 
> fields behave as normal PCI BARs, as described in § Section 7.5.1 ." 
>
> So why doesn't Rust just define this as "normal" BARs (given your naming 
> above, I'd expect simply "BarLow") but names it after "VF" specifically?
> Or does Rust require duplicating things in cases like this for namespacing 
> reasons?
>
> "BarLow" doesn't seem to exist under mainline's rust/, maybe that hasn't 
> been needed so far as C side code will likely be responsible for parsing 
> them.

Agreed, ultimately this BAR register should be defined in the PCI common
code so it can be used across the abstraction without being redefined.

This is not a Rust requirement and technically nothing prevents a common
declaration to be shared. It's more that we are still a bit in a phase
where we are figuring things out and where the ground is moving under
our feet (register definitions are still being actively worked on for
instance), so keeping it defined here at first may help reduce churn in
the end. But at the very least we can probably drop the `Vf` prefix from
its name (and from `VfBarMemoryType`) and add a `// TODO:` comment to
eventually move it to the PCI common code.

Unless Danilo already knows where he wants to take this, in which case
the register definition can be added in a separate patch.

  reply	other threads:[~2026-09-06  0:51 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-27 12:18 [PATCH v9 0/1] Rust PCI capability infrastructure " Zhi Wang
2026-08-27 12:18 ` [PATCH v9 1/1] rust: pci: add extended capability " Zhi Wang
2026-08-31 13:21   ` Ilpo Järvinen
2026-09-06  0:51     ` Alexandre Courbot [this message]
2026-09-06  1:24   ` Alexandre Courbot

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=DL7TLEGXO3EB.11S8R36MBJN6A@nvidia.com \
    --to=acourbot@nvidia.com \
    --cc=a.hindborg@kernel.org \
    --cc=aliceryhl@google.com \
    --cc=alkumar@nvidia.com \
    --cc=aniketa@nvidia.com \
    --cc=ankita@nvidia.com \
    --cc=bhelgaas@google.com \
    --cc=bjorn3_gh@protonmail.com \
    --cc=boqun@kernel.org \
    --cc=cjia@nvidia.com \
    --cc=dakr@kernel.org \
    --cc=daniel.almeida@collabora.com \
    --cc=gary@garyguo.net \
    --cc=ilpo.jarvinen@linux.intel.com \
    --cc=jhubbard@nvidia.com \
    --cc=joelagnelf@nvidia.com \
    --cc=kjaju@nvidia.com \
    --cc=kwankhede@nvidia.com \
    --cc=kwilczynski@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=lossin@kernel.org \
    --cc=markus.probst@posteo.de \
    --cc=ojeda@kernel.org \
    --cc=rust-for-linux@vger.kernel.org \
    --cc=smitra@nvidia.com \
    --cc=tamird@kernel.org \
    --cc=targupta@nvidia.com \
    --cc=tmgross@umich.edu \
    --cc=work@onurozkan.dev \
    --cc=zhiw@nvidia.com \
    --cc=zhiwang@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

all inboxes | Powered by JetHome®