From: Chris Wright <chrisw@sous-sol.org>
To: Jon Mason <jon.mason@exar.com>
Cc: "David S. Miller" <davem@davemloft.net>,
netdev@vger.kernel.org,
Sivakumar Subramani <sivakumar.subramani@exar.com>,
Sreenivasa Honnur <sreenivasa.honnur@exar.com>,
Ram Vepa <ram.vepa@exar.com>
Subject: Re: [PATCH 2/7] vxge: fix crash of VF when unloading PF
Date: Fri, 10 Dec 2010 17:04:41 -0800 [thread overview]
Message-ID: <20101211010441.GI4040@sequoia.sous-sol.org> (raw)
In-Reply-To: <1292025782-16372-2-git-send-email-jon.mason@exar.com>
* Jon Mason (jon.mason@exar.com) wrote:
> +static int __devinit is_sriov_initialized(struct pci_dev *pdev)
> +{
> + int pos;
> + u16 ctrl;
> +
> + pos = pci_find_ext_capability(pdev, PCI_EXT_CAP_ID_SRIOV);
> + if (pos) {
> + pci_read_config_word(pdev, pos + PCI_SRIOV_CTRL, &ctrl);
> + if (ctrl & PCI_SRIOV_CTRL_VFE)
> + return 1;
> + }
> + return 0;
> +}
This is a helper that should go in drivers/pci/iov.c (it's a pure
pci thing).
> +
> /**
> * vxge_probe
> * @pdev : structure containing the PCI related information of the device.
> @@ -4370,14 +4384,13 @@ vxge_probe(struct pci_dev *pdev, const struct pci_device_id *pre)
> num_vfs = vxge_get_num_vfs(function_mode) - 1;
>
> /* Enable SRIOV mode, if firmware has SRIOV support and if it is a PF */
> - if (is_sriov(function_mode) && (max_config_dev > 1) &&
> - (ll_config->intr_type != INTA) &&
> - (is_privileged == VXGE_HW_OK)) {
> - ret = pci_enable_sriov(pdev, ((max_config_dev - 1) < num_vfs)
> - ? (max_config_dev - 1) : num_vfs);
> + if (is_sriov(function_mode) && !is_sriov_initialized(pdev) &&
> + (ll_config->intr_type != INTA)) {
> + ret = pci_enable_sriov(pdev, num_vfs);
This fundamentally changes the way VF's are allocated. Now you cannot
specifiy the number of vfs to allocate with max_config_dev module
parameter.
> if (ret)
> vxge_debug_ll_config(VXGE_ERR,
> "Failed in enabling SRIOV mode: %d\n", ret);
> + /* No need to fail out, as an error here is non-fatal */
> }
>
> /*
> @@ -4673,8 +4686,6 @@ static void __devexit vxge_remove(struct pci_dev *pdev)
>
> iounmap(vdev->bar0);
>
> - pci_disable_sriov(pdev);
> -
And you can never disable sriov.
This doesn't look like the right behaviour.
thanks,
-chris
next prev parent reply other threads:[~2010-12-11 1:32 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-12-11 0:02 [PATCH 1/7] vxge: code cleanup and reorganization Jon Mason
2010-12-11 0:02 ` [PATCH 2/7] vxge: fix crash of VF when unloading PF Jon Mason
2010-12-11 0:08 ` David Miller
2010-12-11 1:04 ` Chris Wright [this message]
2010-12-11 1:35 ` Ramkrishna Vepa
2010-12-11 0:02 ` [PATCH 3/7] vxge: use pci_request_region() Jon Mason
2010-12-11 0:09 ` David Miller
2010-12-11 0:02 ` [PATCH 4/7] vxge: transmit timeout deadlock Jon Mason
2010-12-11 0:09 ` David Miller
2010-12-11 0:03 ` [PATCH 5/7] vxge: hotplug stall Jon Mason
2010-12-11 0:09 ` David Miller
2010-12-11 0:03 ` [PATCH 6/7] vxge: independent interrupt moderation Jon Mason
2010-12-11 0:09 ` David Miller
2010-12-11 0:03 ` [PATCH 7/7] vxge: update driver version Jon Mason
2010-12-11 0:09 ` David Miller
2010-12-11 0:08 ` [PATCH 1/7] vxge: code cleanup and reorganization David Miller
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=20101211010441.GI4040@sequoia.sous-sol.org \
--to=chrisw@sous-sol.org \
--cc=davem@davemloft.net \
--cc=jon.mason@exar.com \
--cc=netdev@vger.kernel.org \
--cc=ram.vepa@exar.com \
--cc=sivakumar.subramani@exar.com \
--cc=sreenivasa.honnur@exar.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.