From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id ED022CAC5B8 for ; Thu, 2 Oct 2025 12:08:35 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id A456F10E7CC; Thu, 2 Oct 2025 12:08:35 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.b="Ov2s+3Ra"; dkim-atps=neutral Received: from sea.source.kernel.org (sea.source.kernel.org [172.234.252.31]) by gabe.freedesktop.org (Postfix) with ESMTPS id 3452410E7CC for ; Thu, 2 Oct 2025 12:08:34 +0000 (UTC) Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sea.source.kernel.org (Postfix) with ESMTP id 1737141695; Thu, 2 Oct 2025 12:08:34 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1A725C4CEF4; Thu, 2 Oct 2025 12:08:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1759406913; bh=tb+QlM/Ac5Zz+ol4V4q9n2Sx0VeZEGrctLpsPyzSZ/k=; h=Date:Subject:Cc:To:From:References:In-Reply-To:From; b=Ov2s+3RamDIsz558ZwAxKFI3wxtJ6RcDcvlPFYTiGQ9OOT7N5Wwed8fMa9Cs4mKIg vdxvGbGnfFaaj1e0SqgftZikY1SH02xYLw5hG0Gb9siGYXDif56X0aoAUfWkKz02Z7 VTX2wo8znoNbJKCxfwrP24wiSk341/53Ged48CEbYFnKgH9s5t1LULBiMKF2fu6C31 07cqIRRu+z21E/iFXFxjTMRNNBGSA65XB6whdQf7x4Yts4HkxLIHDVhy8HmaZv7x/B 5XvOsA76/buhEn3u0OkqePQt7yiE+6y71o0y9IBJHmUMd/HNcF7bHbJ+U5xmoDGLIp SDyeKIaiS0YFw== Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8 Date: Thu, 02 Oct 2025 14:08:27 +0200 Message-Id: Subject: Re: [PATCH 0/2] rust: pci: expose is_virtfn() and reject VFs in nova-core Cc: "John Hubbard" , "Zhi Wang" , "Alistair Popple" , "Alexandre Courbot" , "Joel Fernandes" , "Timur Tabi" , "Surath Mitra" , "David Airlie" , "Simona Vetter" , "Bjorn Helgaas" , =?utf-8?q?Krzysztof_Wilczy=C5=84ski?= , "Miguel Ojeda" , "Alex Gaynor" , "Boqun Feng" , "Gary Guo" , =?utf-8?q?Bj=C3=B6rn_Roy_Baron?= , "Benno Lossin" , "Andreas Hindborg" , "Alice Ryhl" , "Trevor Gross" , "nouveau@lists.freedesktop.org" , "linux-pci@vger.kernel.org" , "rust-for-linux@vger.kernel.org" , "LKML" , "Alex Williamson" To: "Jason Gunthorpe" From: "Danilo Krummrich" References: <20250930220759.288528-1-jhubbard@nvidia.com> <20251002120149.GC3195801@nvidia.com> In-Reply-To: <20251002120149.GC3195801@nvidia.com> X-BeenThere: nouveau@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Nouveau development list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: nouveau-bounces@lists.freedesktop.org Sender: "Nouveau" On Thu Oct 2, 2025 at 2:01 PM CEST, Jason Gunthorpe wrote: > On Thu, Oct 02, 2025 at 12:52:10AM +0200, Danilo Krummrich wrote: > >> Indicating whether the driver supports VFs through a boolean in struct >> pci_driver is about the same effort (well, maybe slightly more), but sol= ves the >> problem in a cleaner way since it avoids probe() being called in the fir= st >> place. Other existing drivers benefit from that as well. > > I'm strongly against that idea. > > Drivers should not be doing things like this, giving them core code > helpers to do something they should not do is the wrong direction. > > I think this patchset should be simply dropped. Novacore should try to > boot on a VF and fail if it isn't setup. Why? What about other upstream drivers that clearly assert that they don't support VFs? Why would we want to force them to try to boot to a point wher= e they "naturally" fail? I think there's nothing wrong with allowing drivers to "officially" assert = that they're intended for PFs only. Here are a few examples of drivers that have the same requirement: https://elixir.bootlin.com/linux/v6.17/source/drivers/net/ethernet/realtek/= rtase/rtase_main.c#L2195 https://elixir.bootlin.com/linux/v6.17/source/drivers/net/ethernet/intel/ic= e/ice_main.c#L5266 https://elixir.bootlin.com/linux/v6.17/source/drivers/net/ethernet/intel/ig= b/igb_main.c#L3221