netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCHv2 net-next] cxgb4: Fix for SR-IOV VF initialization
@ 2014-08-06 11:40 Hariprasad Shenai
  2014-08-06 20:47 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Hariprasad Shenai @ 2014-08-06 11:40 UTC (permalink / raw)
  To: netdev; +Cc: davem, leedom, nirranjan, kumaras, anish, Hariprasad Shenai

Commit 35b1de5 ("rdma/cxgb4: Fixes cxgb4 probe failure in VM when PF is exposed
through PCI Passthrough") introduced a regression, where VF failed to
initialize for Physical function 0 to Physical Function 3. In the above
commit, we removed the code which used to enable sriov for PF0 to PF3. Now
adding it back to get sriov working.

V2:
 Removed SRIOV loop for PF[0..3] to instantiate the VF's as per David Miller's
 comment

Signed-off-by: Hariprasad Shenai <hariprasad@chelsio.com>
---
 drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c |    7 +++----
 1 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c
index 4247356..1a162d2 100644
--- a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c
+++ b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c
@@ -6527,11 +6527,9 @@ static int init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
 
 	/* We control everything through one PF */
 	func = SOURCEPF_GET(readl(adapter->regs + PL_WHOAMI));
-	if ((pdev->device == 0xa000 && func != 0) ||
-	    func != ent->driver_data) {
+	if (func != ent->driver_data) {
 		pci_save_state(pdev);        /* to restore SR-IOV later */
-		err = 0;
-		goto out_unmap_bar0;
+		goto sriov;
 	}
 
 	adapter->pdev = pdev;
@@ -6697,6 +6695,7 @@ static int init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
 	if (is_offload(adapter))
 		attach_ulds(adapter);
 
+sriov:
 #ifdef CONFIG_PCI_IOV
 	if (func < ARRAY_SIZE(num_vf) && num_vf[func] > 0)
 		if (pci_enable_sriov(pdev, num_vf[func]) == 0)
-- 
1.7.1

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCHv2 net-next] cxgb4: Fix for SR-IOV VF initialization
  2014-08-06 11:40 [PATCHv2 net-next] cxgb4: Fix for SR-IOV VF initialization Hariprasad Shenai
@ 2014-08-06 20:47 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2014-08-06 20:47 UTC (permalink / raw)
  To: hariprasad; +Cc: netdev, leedom, nirranjan, kumaras, anish

From: Hariprasad Shenai <hariprasad@chelsio.com>
Date: Wed,  6 Aug 2014 17:10:59 +0530

> Commit 35b1de5 ("rdma/cxgb4: Fixes cxgb4 probe failure in VM when PF is exposed
> through PCI Passthrough") introduced a regression, where VF failed to
> initialize for Physical function 0 to Physical Function 3. In the above
> commit, we removed the code which used to enable sriov for PF0 to PF3. Now
> adding it back to get sriov working.
> 
> V2:
>  Removed SRIOV loop for PF[0..3] to instantiate the VF's as per David Miller's
>  comment
> 
> Signed-off-by: Hariprasad Shenai <hariprasad@chelsio.com>

Applied, thanks.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-08-06 20:47 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-08-06 11:40 [PATCHv2 net-next] cxgb4: Fix for SR-IOV VF initialization Hariprasad Shenai
2014-08-06 20:47 ` David Miller

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).