From mboxrd@z Thu Jan 1 00:00:00 1970 From: Claude Code Review Bot To: dri-devel-reviews@example.com Subject: Claude review: rust: pci: add {enable,disable}_sriov(), to control SR-IOV capability Date: Wed, 04 Mar 2026 08:40:15 +1000 Message-ID: In-Reply-To: <20260303-rust-pci-sriov-v3-3-4443c35f0c88@redhat.com> References: <20260303-rust-pci-sriov-v3-0-4443c35f0c88@redhat.com> <20260303-rust-pci-sriov-v3-3-4443c35f0c88@redhat.com> X-Mailer: Claude Code Patch Reviewer Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit MIME-Version: 1.0 Patch Review Setting `managed_sriov = true` unconditionally for all Rust PCI drivers is the right call. For non-SR-IOV devices, `pci_iov_disable()` returns immediately on `!dev->is_physfn`, so there's no overhead. The methods are correctly placed on `Device` and gated with `#[cfg(CONFIG_PCI_IOV)]`. ```rust + pub fn enable_sriov(&self, nr_virtfn: i32) -> Result { ``` **Minor**: `nr_virtfn` as `i32` matches the C API, but semantically VF counts are non-negative. A `u16` would be more idiomatic since SR-IOV is limited to 16 bits in the PCIe spec. However, matching the C signature avoids conversion overhead and is consistent with the rest of the Rust PCI bindings. --- Generated by Claude Code Patch Reviewer