From: "Christophe Leroy (CS GROUP)" <chleroy@kernel.org>
To: Jiangshan Yi <yijiangshan@kylinos.cn>, 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
Subject: Re: [PATCH v2] powerpc/pseries/pci: Fix misleading VF limit error message
Date: Thu, 13 Aug 2026 08:43:39 +0200 [thread overview]
Message-ID: <94e0d202-ad52-475c-89c6-69f7b77e0ccf@kernel.org> (raw)
In-Reply-To: <20260813063731.399598-1-yijiangshan@kylinos.cn>
Le 13/08/2026 à 08:37, Jiangshan Yi a écrit :
> When the number of requested VFs exceeds MAX_VFS_FOR_MAP_PE, the
> message prints that limit but labels it "Configurable VFs". Report
> the configurable VF limit and the PE mapping limit with separate
> error messages.
>
> Suggested-by: Christophe Leroy <chleroy@kernel.org>
> Signed-off-by: Jiangshan Yi <yijiangshan@kylinos.cn>
reviewed-by: Christophe Leroy <chleroy@kernel.org>
> ---
> v2:
> - rework as suggested by Christophe Leroy: split the two limit checks
> into separate blocks, each with its own dev_err and error return
>
> arch/powerpc/platforms/pseries/pci.c | 13 ++++++++-----
> 1 file changed, 8 insertions(+), 5 deletions(-)
>
> 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;
> }
>
next prev parent reply other threads:[~2026-08-13 6:43 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-13 6:37 Jiangshan Yi
2026-08-13 6:43 ` Christophe Leroy (CS GROUP) [this message]
2026-09-09 6:19 ` Madhavan Srinivasan
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=94e0d202-ad52-475c-89c6-69f7b77e0ccf@kernel.org \
--to=chleroy@kernel.org \
--cc=13667453960@163.com \
--cc=gcwilson@linux.ibm.com \
--cc=kees@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=maddy@linux.ibm.com \
--cc=mpe@ellerman.id.au \
--cc=nayna@linux.ibm.com \
--cc=npiggin@gmail.com \
--cc=yijiangshan@kylinos.cn \
/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
all inboxes | Powered by JetHome®