All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net-next-2.6] vxge: Enable SRIOV support in the driver.
@ 2009-06-16  9:26 Sivakumar Subramani
  2009-06-16  9:33 ` David Miller
  0 siblings, 1 reply; 3+ messages in thread
From: Sivakumar Subramani @ 2009-06-16  9:26 UTC (permalink / raw)
  To: netdev, davem; +Cc: support, sivakumar.subramani, santosh.rastapur, ram.vepa

- Enabled SRIOV support in the driver.
- Call __vxge_hw_verify_pci_e_info() for the PF only. This function
verifies the negotiated link width and current link speed in the
Link Status Register (offset 12h) which are reserved fields for VFs
as per the SRIOV specification, section 3.5.8.

Signed-off-by: Sivakumar Subramani <sivakumar.subramani@neterion.com>
Signed-off-by: Rastapur Santosh <santosh.rastapur@neterion.com>
Signed-off-by: Ramkrishna Vepa <ram.vepa@neterion.com>
---
diff -urpN org/drivers/net/vxge/vxge-config.c mod/drivers/net/vxge/vxge-config.c
--- org/drivers/net/vxge/vxge-config.c	2009-06-15 22:51:49.000000000 -0700
+++ mod/drivers/net/vxge/vxge-config.c	2009-06-15 22:55:59.000000000 -0700
@@ -454,7 +454,7 @@ __vxge_hw_verify_pci_e_info(struct __vxg
 	return VXGE_HW_OK;
 }
 
-static enum vxge_hw_status
+enum vxge_hw_status
 __vxge_hw_device_is_privilaged(struct __vxge_hw_device *hldev)
 {
 	if ((hldev->host_type == VXGE_HW_NO_MR_NO_SR_NORMAL_FUNCTION ||
@@ -676,10 +676,12 @@ enum vxge_hw_status __vxge_hw_device_ini
 {
 	enum vxge_hw_status status = VXGE_HW_OK;
 
-	/* Validate the pci-e link width and speed */
-	status = __vxge_hw_verify_pci_e_info(hldev);
-	if (status != VXGE_HW_OK)
-		goto exit;
+	if (VXGE_HW_OK == __vxge_hw_device_is_privilaged(hldev)) {
+		/* Validate the pci-e link width and speed */
+		status = __vxge_hw_verify_pci_e_info(hldev);
+		if (status != VXGE_HW_OK)
+			goto exit;
+	}
 
 	vxge_hw_wrr_rebalance(hldev);
 exit:
diff -urpN org/drivers/net/vxge/vxge-main.c mod/drivers/net/vxge/vxge-main.c
--- org/drivers/net/vxge/vxge-main.c	2009-06-15 22:51:43.000000000 -0700
+++ mod/drivers/net/vxge/vxge-main.c	2009-06-15 23:03:04.000000000 -0700
@@ -4203,6 +4203,17 @@ vxge_probe(struct pci_dev *pdev, const s
 		max_vpath_supported++;
 	}
 
+#ifdef CONFIG_PCI_IOV
+	/* Enable SRIOV mode, if firmware has SRIOV support and if it is a PF */
+	if ((VXGE_HW_FUNCTION_MODE_SRIOV ==
+		ll_config.device_hw_info.function_mode) &&
+		(max_config_dev > 1) && (pdev->is_physfn)) {
+			ret = pci_enable_sriov(pdev, max_config_dev - 1);
+			if (ret)
+				vxge_debug_ll_config(VXGE_ERR,
+					"Failed to enable SRIOV: %d \n", ret);
+	}
+#endif
 	/*
 	 * Configure vpaths and get driver configured number of vpaths
 	 * which is less than or equal to the maximum vpaths per function.
@@ -4366,6 +4377,9 @@ _exit6:
 
 	vxge_device_unregister(hldev);
 _exit5:
+#ifdef CONFIG_PCI_IOV
+	pci_disable_sriov(pdev);
+#endif
 	vxge_hw_device_terminate(hldev);
 _exit4:
 	iounmap(attr.bar1);
@@ -4428,6 +4442,9 @@ vxge_remove(struct pci_dev *pdev)
 
 	iounmap(vdev->bar0);
 	iounmap(vdev->bar1);
+#ifdef CONFIG_PCI_IOV
+	pci_disable_sriov(pdev);
+#endif
 
 	/* we are safe to free it now */
 	free_netdev(dev);
diff -urpN org/drivers/net/vxge/vxge-version.h mod/drivers/net/vxge/vxge-version.h
--- org/drivers/net/vxge/vxge-version.h	2009-06-15 22:51:54.000000000 -0700
+++ mod/drivers/net/vxge/vxge-version.h	2009-06-15 23:04:18.000000000 -0700
@@ -17,7 +17,7 @@
 
 #define VXGE_VERSION_MAJOR	"2"
 #define VXGE_VERSION_MINOR	"0"
-#define VXGE_VERSION_FIX	"1"
-#define VXGE_VERSION_BUILD	"17129"
+#define VXGE_VERSION_FIX	"4"
+#define VXGE_VERSION_BUILD	"17784"
 #define VXGE_VERSION_FOR	"k"
 #endif


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

* Re: [PATCH net-next-2.6] vxge: Enable SRIOV support in the driver.
  2009-06-16  9:26 [PATCH net-next-2.6] vxge: Enable SRIOV support in the driver Sivakumar Subramani
@ 2009-06-16  9:33 ` David Miller
  2009-06-16 17:57   ` Sivakumar Subramani
  0 siblings, 1 reply; 3+ messages in thread
From: David Miller @ 2009-06-16  9:33 UTC (permalink / raw)
  To: Sivakumar.Subramani; +Cc: netdev, support, santosh.rastapur, ram.vepa

From: Sivakumar Subramani <Sivakumar.Subramani@neterion.com>
Date: Tue, 16 Jun 2009 05:26:09 -0400 (EDT)

> +#ifdef CONFIG_PCI_IOV
> +	pci_disable_sriov(pdev);
> +#endif

Toss these ifdefs.

These intefaces have NOP versions declared when the define
is not set.

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

* RE: [PATCH net-next-2.6] vxge: Enable SRIOV support in the driver.
  2009-06-16  9:33 ` David Miller
@ 2009-06-16 17:57   ` Sivakumar Subramani
  0 siblings, 0 replies; 3+ messages in thread
From: Sivakumar Subramani @ 2009-06-16 17:57 UTC (permalink / raw)
  To: David Miller; +Cc: netdev, support, Rastapur Santosh, Ramkrishna Vepa

I will fix and resubmit the patch again.

Thanks,
~Siva

-----Original Message-----
From: David Miller [mailto:davem@davemloft.net] 
Sent: Tuesday, June 16, 2009 3:03 PM
To: Sivakumar Subramani
Cc: netdev@vger.kernel.org; support; Rastapur Santosh; Ramkrishna Vepa
Subject: Re: [PATCH net-next-2.6] vxge: Enable SRIOV support in the
driver.

From: Sivakumar Subramani <Sivakumar.Subramani@neterion.com>
Date: Tue, 16 Jun 2009 05:26:09 -0400 (EDT)

> +#ifdef CONFIG_PCI_IOV
> +	pci_disable_sriov(pdev);
> +#endif

Toss these ifdefs.

These intefaces have NOP versions declared when the define
is not set.

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

end of thread, other threads:[~2009-06-16 17:57 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-06-16  9:26 [PATCH net-next-2.6] vxge: Enable SRIOV support in the driver Sivakumar Subramani
2009-06-16  9:33 ` David Miller
2009-06-16 17:57   ` Sivakumar Subramani

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.