public inbox for rust-for-linux@vger.kernel.org
 help / color / mirror / Atom feed
From: "Alexandre Courbot" <acourbot@nvidia.com>
To: "Zhi Wang" <zhiw@nvidia.com>
Cc: <rust-for-linux@vger.kernel.org>, <linux-pci@vger.kernel.org>,
	<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>, <joelagnelf@nvidia.com>,
	<jhubbard@nvidia.com>, <kjaju@nvidia.com>, <zhiwang@kernel.org>
Subject: Re: [PATCH v3 1/1] rust: pci: add extended capability and SR-IOV support
Date: Sun, 26 Apr 2026 13:12:48 +0900	[thread overview]
Message-ID: <DI2SL4G5INLY.2W1IFTR081ID3@nvidia.com> (raw)
In-Reply-To: <20260420131356.189e7209@inno-dell>

On Mon Apr 20, 2026 at 7:13 PM JST, Zhi Wang wrote:
<snip>
>> > +            return Err(EINVAL);
>> > +        }
>> > +        let low = crate::io_read!(self, .vf_bar[bar_index]?);
>> > +        let high = crate::io_read!(self, .vf_bar[bar_index + 1]?);
>> >  
>> 
>> Don't we want to check whether the bar in question is actually a
>> 64-bit BAR?
>> 
>> I wonder whether this also doesn't call for an iterator-based solution
>> returning an enum with the properly-sized BAR.
>
> Good point. I was assuming that the driver actually know its
> devcie support 64-bit bar or not. Do you prefer that we can have an
> iterator-based solution at this time? I think it makes the code looks
> nicer though. :)

It really depends on how this code is used. If we are going through the
list of BARs in client code, then yes, and iterator would be the
idiomatic solution.

      parent reply	other threads:[~2026-04-26  4:12 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-09 18:52 [PATCH 0/1] Rust PCI capability infrastructure and SR-IOV support Zhi Wang
2026-04-09 18:52 ` [PATCH v3 1/1] rust: pci: add extended capability " Zhi Wang
2026-04-13  6:52   ` Alexandre Courbot
2026-04-20 10:13     ` Zhi Wang
2026-04-20 10:24       ` Gary Guo
2026-04-26  4:12       ` Alexandre Courbot [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=DI2SL4G5INLY.2W1IFTR081ID3@nvidia.com \
    --to=acourbot@nvidia.com \
    --cc=a.hindborg@kernel.org \
    --cc=aliceryhl@google.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=gary@garyguo.net \
    --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=targupta@nvidia.com \
    --cc=tmgross@umich.edu \
    --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