Timur Tabi
2025-Dec-07 15:55 UTC
[RFC 5/7] gpu: nova-core: set RMSetSriovMode when NVIDIA vGPU is enabled
On Sat, 2025-12-06 at 12:42 +0000, Zhi Wang wrote:> -??? pub(crate) fn new() -> Self { > +??? pub(crate) fn new(vgpu_support: bool) -> Self { > +??????? let num_entries = if vgpu_support { 4 } else { 3 };Instead of passing a bool, and then hard-coding the length based on that bool (which would require that RMSetSriovMode always be the last entry in the array), you need to do what Nouveau does: if VGPU is enabled, then dynamically append the entry to the array.
Joel Fernandes
2025-Dec-07 16:57 UTC
[RFC 5/7] gpu: nova-core: set RMSetSriovMode when NVIDIA vGPU is enabled
> On Dec 7, 2025, at 10:55?AM, Timur Tabi <ttabi at nvidia.com> wrote: > >> On Sat, 2025-12-06 at 12:42 +0000, Zhi Wang wrote: >> - pub(crate) fn new() -> Self { >> + pub(crate) fn new(vgpu_support: bool) -> Self { >> + let num_entries = if vgpu_support { 4 } else { 3 }; > > Instead of passing a bool, and then hard-coding the length based on that bool (which would > require that RMSetSriovMode always be the last entry in the array), you need to do what Nouveau > does: if VGPU is enabled, then dynamically append the entry to the array.Yeah, I agree with Timur. Thanks.