From: Edward Cree <ecree.xilinx@gmail.com>
To: Zhengchao Shao <shaozhengchao@huawei.com>,
netdev@vger.kernel.org, habetsm.xilinx@gmail.com,
davem@davemloft.net, edumazet@google.com, kuba@kernel.org,
pabeni@redhat.com
Cc: pieter.jansen-van-vuuren@amd.com, weiyongjun1@huawei.com,
yuehaibing@huawei.com
Subject: Re: [PATCH net] sfc: fix error process in efx_ef100_pci_sriov_enable()
Date: Tue, 29 Nov 2022 08:19:50 +0000 [thread overview]
Message-ID: <3adfad23-b2dd-3bd9-40da-d4dfaa78b435@gmail.com> (raw)
In-Reply-To: <20221125071958.276454-1-shaozhengchao@huawei.com>
On 25/11/2022 07:19, Zhengchao Shao wrote:
> There are two issues in efx_ef100_pci_sriov_enable():
> 1. When it doesn't have MAE Privilege, it doesn't disable pci sriov.
> 2. When creating VF successfully, it should return vf nums instead of 0.
A single patch should do one thing. If these two issues were
valid, they ought to be fixed separately by two commits.
> Compiled test only.
>
> Fixes: 08135eecd07f ("sfc: add skeleton ef100 VF representors")
> Fixes: 78a9b3c47bef ("sfc: add EF100 VF support via a write to sriov_numvfs")
> Signed-off-by: Zhengchao Shao <shaozhengchao@huawei.com>
> ---
> drivers/net/ethernet/sfc/ef100_sriov.c | 6 ++++--
> 1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/net/ethernet/sfc/ef100_sriov.c b/drivers/net/ethernet/sfc/ef100_sriov.c
> index 94bdbfcb47e8..adf7fb09940e 100644
> --- a/drivers/net/ethernet/sfc/ef100_sriov.c
> +++ b/drivers/net/ethernet/sfc/ef100_sriov.c
> @@ -25,15 +25,17 @@ static int efx_ef100_pci_sriov_enable(struct efx_nic *efx, int num_vfs)
> if (rc)
> goto fail1;
>
> - if (!nic_data->grp_mae)
> + if (!nic_data->grp_mae) {
> + pci_disable_sriov(dev);
> return 0;
> + }
NACK to this part; if we don't have MAE privilege, that means
someone else (e.g. the embedded SoC) is in charge of the MAE
and is responsible for configuring switching behaviour for any
VFs we create.
Thus, the existing behaviour — create the VFs without creating
any corresponding representors — is intended.
>
> for (i = 0; i < num_vfs; i++) {
> rc = efx_ef100_vfrep_create(efx, i);
> if (rc)
> goto fail2;
> }
> - return 0;
> + return num_vfs;
NACK to this too: this is not returned directly to the PCI
core but to ef100_pci_sriov_configure(), which already does
the translation from 0 (success) to num_vfs. So changing it
here is unnecessary.
-ed
>
> fail2:
> list_for_each_entry_safe(efv, next, &efx->vf_reps, list)
>
next prev parent reply other threads:[~2022-11-29 8:19 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-25 7:19 [PATCH net] sfc: fix error process in efx_ef100_pci_sriov_enable() Zhengchao Shao
2022-11-29 8:19 ` Edward Cree [this message]
2022-11-29 9:10 ` shaozhengchao
2022-11-29 8:56 ` Martin Habets
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=3adfad23-b2dd-3bd9-40da-d4dfaa78b435@gmail.com \
--to=ecree.xilinx@gmail.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=habetsm.xilinx@gmail.com \
--cc=kuba@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=pieter.jansen-van-vuuren@amd.com \
--cc=shaozhengchao@huawei.com \
--cc=weiyongjun1@huawei.com \
--cc=yuehaibing@huawei.com \
/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;
as well as URLs for NNTP newsgroup(s).