public inbox for drm-ai-reviews@public-inbox.freedesktop.org
 help / color / mirror / Atom feed
From: Claude Code Review Bot <claude-review@example.com>
To: dri-devel-reviews@example.com
Subject: Claude review: samples: rust: add SR-IOV driver sample
Date: Wed, 04 Mar 2026 08:40:17 +1000	[thread overview]
Message-ID: <review-patch10-20260303-rust-pci-sriov-v3-10-4443c35f0c88@redhat.com> (raw)
In-Reply-To: <20260303-rust-pci-sriov-v3-10-4443c35f0c88@redhat.com>

Patch Review

Good sample that exercises the full API: `enable_sriov`, `disable_sriov`, `physfn`, `drvdata`, `is_virtfn`, `is_physfn`, `num_vf`.

```rust
+use core::any::TypeId;
```

Using `TypeId` as dummy private data is a clever way to demonstrate the `drvdata` access without needing actual meaningful state.

The `assert!()` calls (e.g., `assert!(physfn.is_physfn())`, `assert_eq!(pdev.num_vf(), nr_virtfn)`) will panic in the kernel if they fail. For a sample this is fine to clearly demonstrate invariants, but it's worth noting these would be inappropriate in a production driver.

The sample correctly does **not** call `disable_sriov()` in its `PinnedDrop` — the `managed_sriov` mechanism handles this via `pci_iov_disable()` before the driver's remove callback runs.

---
Generated by Claude Code Patch Reviewer

  reply	other threads:[~2026-03-03 22:40 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-03 21:15 [PATCH v3 00/10] rust: pci: add abstractions for SR-IOV capability Peter Colberg
2026-03-03 21:15 ` [PATCH v3 01/10] PCI: add driver flag to opt into disabling SR-IOV on remove() Peter Colberg
2026-03-03 22:40   ` Claude review: " Claude Code Review Bot
2026-03-03 21:15 ` [PATCH v3 02/10] fpga: dfl-pci: set driver flag to disable " Peter Colberg
2026-03-03 22:40   ` Claude review: " Claude Code Review Bot
2026-03-03 21:15 ` [PATCH v3 03/10] rust: pci: add {enable,disable}_sriov(), to control SR-IOV capability Peter Colberg
2026-03-03 22:40   ` Claude review: " Claude Code Review Bot
2026-03-03 21:15 ` [PATCH v3 04/10] rust: pci: add vtable attribute to pci::Driver trait Peter Colberg
2026-03-03 22:40   ` Claude review: " Claude Code Review Bot
2026-03-03 21:15 ` [PATCH v3 05/10] rust: pci: add bus callback sriov_configure(), to control SR-IOV from sysfs Peter Colberg
2026-03-03 22:40   ` Claude review: " Claude Code Review Bot
2026-03-03 21:15 ` [PATCH v3 06/10] rust: pci: add is_virtfn(), to check for VFs Peter Colberg
2026-03-03 22:40   ` Claude review: " Claude Code Review Bot
2026-03-03 21:15 ` [PATCH v3 07/10] rust: pci: add is_physfn(), to check for PFs Peter Colberg
2026-03-03 22:40   ` Claude review: " Claude Code Review Bot
2026-03-03 21:15 ` [PATCH v3 08/10] rust: pci: add num_vf(), to return number of VFs Peter Colberg
2026-03-03 22:40   ` Claude review: " Claude Code Review Bot
2026-03-03 21:15 ` [PATCH v3 09/10] rust: pci: add physfn(), to return PF device for VF device Peter Colberg
2026-03-03 22:40   ` Claude review: " Claude Code Review Bot
2026-03-03 21:15 ` [PATCH v3 10/10] samples: rust: add SR-IOV driver sample Peter Colberg
2026-03-03 22:40   ` Claude Code Review Bot [this message]
2026-03-03 22:40 ` Claude review: rust: pci: add abstractions for SR-IOV capability Claude Code Review Bot

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=review-patch10-20260303-rust-pci-sriov-v3-10-4443c35f0c88@redhat.com \
    --to=claude-review@example.com \
    --cc=dri-devel-reviews@example.com \
    /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