[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20220112145110.1ba09f3c@kicinski-fedora-PC1C0HJN.hsd1.ca.comcast.net>
Date: Wed, 12 Jan 2022 14:51:10 -0800
From: Jakub Kicinski <kuba@...nel.org>
To: Dimitris Michailidis <d.michailidis@...gible.com>
Cc: davem@...emloft.net, netdev@...r.kernel.org, andrew@...n.ch
Subject: Re: [PATCH net-next v6 3/8] net/funeth: probing and netdev ops
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.
Powered by blists - more mailing lists