[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAOkoqZnvbj81BPgAfW+2ap5qa5jp-UePVYwejQd4sLznkMfLSA@mail.gmail.com>
Date: Wed, 16 Feb 2022 19:06:18 -0800
From: Dimitris Michailidis <d.michailidis@...gible.com>
To: Jakub Kicinski <kuba@...nel.org>
Cc: davem@...emloft.net, netdev@...r.kernel.org,
Andrew Lunn <andrew@...n.ch>
Subject: Re: [PATCH net-next v6 3/8] net/funeth: probing and netdev ops
On Wed, Jan 12, 2022 at 2:51 PM Jakub Kicinski <kuba@...nel.org> wrote:
>
> On Sun, 9 Jan 2022 17:56:31 -0800 Dimitris Michailidis wrote:
> > +static int funeth_sriov_configure(struct pci_dev *pdev, int nvfs)
> > +{
> > + struct fun_dev *fdev = pci_get_drvdata(pdev);
> > + struct fun_ethdev *ed = to_fun_ethdev(fdev);
> > + int rc;
> > +
> > + if (nvfs == 0) {
> > + if (pci_vfs_assigned(pdev)) {
> > + dev_warn(&pdev->dev,
> > + "Cannot disable SR-IOV while VFs are assigned\n");
> > + return -EPERM;
> > + }
> > +
> > + pci_disable_sriov(pdev);
> > + fun_free_vports(ed);
> > + return 0;
> > + }
> > +
> > + rc = fun_init_vports(ed, nvfs);
> > + if (rc)
> > + return rc;
>
> Also likely needs locking, not that sriov callback is called with
> device lock held and VF configuration with rtnl_lock(), they can
> run in parallel.
Yes, I think you're right. I am adding locking.
Powered by blists - more mailing lists