From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C6EDB36C9E5 for ; Thu, 13 Aug 2026 04:56:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786596988; cv=none; b=ksXLxgpWdn4kkXPOWNu3XCw4lsxJvkdiLgvbFgad/3PVXaiGV2bhDcuLkuyzK9FeHLYocT/w54DOYN8DcETI+R6YLCTrNfeOCfAREATlZVX82FVDwqRk18YIZkP1+O0oC8jpc3Na77bkrpASQteW99i7qY8ssqgfA3YflhM5v2Q= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786596988; c=relaxed/simple; bh=OQUFoHXEeqrBs2ooxhgk/nUF6hz4dlQcceLTBucO9/8=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=hqk6IpDKmTabQIfqLC2YxkgogxKl9Ev5FlERiTNF/mHTTq130R5YnD5K4ENocWyKFB8vZHFOl5yNryboj3BeRz8s/K3nVLwiXcglQrkM//QytrvaXicvoqQ8Z5RUY9Q0NXNG7ejtpxL3bwsVzN2n0L2LuJHKblGtnIyneLb7W/k= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=kfGPSSgC; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="kfGPSSgC" Received: by smtp.kernel.org (Postfix) with ESMTPSA id C78EA1F000E9; Thu, 13 Aug 2026 04:56:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1786596987; bh=oGTZ2lxO6SWnrcJg/cD07+Rv5kqoQMTTilWNtoVTqpo=; h=Date:Subject:To:Cc:References:From:In-Reply-To; b=kfGPSSgCQ190k/T7wCVbovGG/5MvL3mHscqlAwOcCT7tKWPOTaDF3DEUopRzoBS2M 26VdL9s2TKz9dcDd/muDZS65Qwxs30ZujuT7uU2smyBKIdQ0dNvzXnsFJS68RWF4DP xyeJ6O3LFURYjxClQYbMwPdbCOjozJd+PZgNMoAyaKUEcHI64ULZ8j32T8UuMZ9Hs4 7IMTQPpSHi9yM7wyhhRWR/W0hXdZ+IAKqrTihwatjMctNCYzmQEkNjSa22c88m8eEz EevZi1YTLDi1cZ4cU36c1psc0ZQWjoxX53Lty5EvPIsyckH48YuB1G1wgtRP3wca+x EEmZYOIn2Nj2Q== Message-ID: <0798e7f0-47fb-4cd1-9963-5b22f6564e03@kernel.org> Date: Thu, 13 Aug 2026 06:56:20 +0200 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] powerpc/pseries/pci: Fix misleading VF limit error message To: Jiangshan Yi , maddy@linux.ibm.com Cc: mpe@ellerman.id.au, npiggin@gmail.com, nayna@linux.ibm.com, gcwilson@linux.ibm.com, kees@kernel.org, linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, 13667453960@163.com References: <20260813035323.245229-1-yijiangshan@kylinos.cn> Content-Language: fr-FR From: "Christophe Leroy (CS GROUP)" In-Reply-To: <20260813035323.245229-1-yijiangshan@kylinos.cn> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Le 13/08/2026 à 05:53, Jiangshan Yi a écrit : > [Vous ne recevez pas souvent de courriers de yijiangshan@kylinos.cn. Découvrez pourquoi ceci est important à https://aka.ms/LearnAboutSenderIdentification ] > > When the number of requested VFs exceeds MAX_VFS_FOR_MAP_PE, the > message prints that limit but labels it "Configurable VFs". Print > each limit with its own message so both are reported when both are > exceeded. > > Signed-off-by: Jiangshan Yi > --- > arch/powerpc/platforms/pseries/pci.c | 10 ++++++---- > 1 file changed, 6 insertions(+), 4 deletions(-) > > diff --git a/arch/powerpc/platforms/pseries/pci.c b/arch/powerpc/platforms/pseries/pci.c > index d11a64a086c1..1e1903bf3f1d 100644 > --- a/arch/powerpc/platforms/pseries/pci.c > +++ b/arch/powerpc/platforms/pseries/pci.c > @@ -133,10 +133,12 @@ static int pseries_pci_sriov_enable(struct pci_dev *pdev, u16 num_vfs) > /* First integer stores max config */ > max_config_vfs = of_read_number(&max_vfs[0], 1); > if (max_config_vfs < num_vfs || num_vfs > MAX_VFS_FOR_MAP_PE) { > - dev_err(&pdev->dev, > - "Num VFs %x > %x Configurable VFs\n", > - num_vfs, (num_vfs > MAX_VFS_FOR_MAP_PE) ? > - MAX_VFS_FOR_MAP_PE : max_config_vfs); > + if (max_config_vfs < num_vfs) > + dev_err(&pdev->dev, "Num VFs %x > %x Configurable VFs\n", > + num_vfs, max_config_vfs); > + if (num_vfs > MAX_VFS_FOR_MAP_PE) > + dev_err(&pdev->dev, "Num VFs %x > %x PE mapping limit\n", > + num_vfs, MAX_VFS_FOR_MAP_PE); > return -EINVAL; > } What about the following instead, to avoid the double 'if' ? diff --git a/arch/powerpc/platforms/pseries/pci.c b/arch/powerpc/platforms/pseries/pci.c index d11a64a086c1..6fc13f4a79a3 100644 --- a/arch/powerpc/platforms/pseries/pci.c +++ b/arch/powerpc/platforms/pseries/pci.c @@ -132,11 +132,14 @@ static int pseries_pci_sriov_enable(struct pci_dev *pdev, u16 num_vfs) /* First integer stores max config */ max_config_vfs = of_read_number(&max_vfs[0], 1); - if (max_config_vfs < num_vfs || num_vfs > MAX_VFS_FOR_MAP_PE) { - dev_err(&pdev->dev, - "Num VFs %x > %x Configurable VFs\n", - num_vfs, (num_vfs > MAX_VFS_FOR_MAP_PE) ? - MAX_VFS_FOR_MAP_PE : max_config_vfs); + if (max_config_vfs < num_vfs) { + dev_err(&pdev->dev, "Num VFs %x > %x Configurable VFs\n", + num_vfs, max_config_vfs); + return -EINVAL; + } + if (num_vfs > MAX_VFS_FOR_MAP_PE) { + dev_err(&pdev->dev, "Num VFs %x > %x PE mapping limit\n", + num_vfs, MAX_VFS_FOR_MAP_PE); return -EINVAL; }