netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* pull request: sfc-2.6 2011-03-23
@ 2011-03-23 21:14 Ben Hutchings
  2011-03-23 21:16 ` [PATCH net-2.6] sfc: Siena: Disable write-combining when SR-IOV is enabled Ben Hutchings
  2011-03-23 22:56 ` pull request: sfc-2.6 2011-03-23 David Miller
  0 siblings, 2 replies; 3+ messages in thread
From: Ben Hutchings @ 2011-03-23 21:14 UTC (permalink / raw)
  To: David Miller; +Cc: netdev, sf-linux-drivers

The following changes since commit 736561a01f11114146b1b7f82d486fa9c95828ef:

  IPVS: Use global mutex in ip_vs_app.c (2011-03-21 20:39:24 -0700)

are available in the git repository at:
  git://git.kernel.org/pub/scm/linux/kernel/git/bwh/sfc-2.6.git sfc-2.6.39

Bug fix for the latest optimisation.

Ben.

Steve Hodgson (1):
      sfc: Siena: Disable write-combining when SR-IOV is enabled

 drivers/net/sfc/efx.c         |   18 ++++++++++++++++--
 drivers/net/sfc/workarounds.h |    2 ++
 2 files changed, 18 insertions(+), 2 deletions(-)

-- 
Ben Hutchings, Senior Software Engineer, Solarflare
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.


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

* [PATCH net-2.6] sfc: Siena: Disable write-combining when SR-IOV is enabled
  2011-03-23 21:14 pull request: sfc-2.6 2011-03-23 Ben Hutchings
@ 2011-03-23 21:16 ` Ben Hutchings
  2011-03-23 22:56 ` pull request: sfc-2.6 2011-03-23 David Miller
  1 sibling, 0 replies; 3+ messages in thread
From: Ben Hutchings @ 2011-03-23 21:16 UTC (permalink / raw)
  To: David Miller; +Cc: netdev, linux-net-drivers

From: Steve Hodgson <shodgson@solarflare.com>

If SR-IOV is enabled by firmware, even if it is not enabled in the PCI
capability, TX pushes using write-combining may be corrupted.

We want to know whether it is enabled before mapping the NIC
registers, and even if PCI extended capabilities are not accessible.
Therefore, we look for the MSI capability, which is removed if SR-IOV
is enabled.

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
---
 drivers/net/sfc/efx.c         |   18 ++++++++++++++++--
 drivers/net/sfc/workarounds.h |    2 ++
 2 files changed, 18 insertions(+), 2 deletions(-)

diff --git a/drivers/net/sfc/efx.c b/drivers/net/sfc/efx.c
index b8bd936..d890679 100644
--- a/drivers/net/sfc/efx.c
+++ b/drivers/net/sfc/efx.c
@@ -1054,6 +1054,7 @@ static int efx_init_io(struct efx_nic *efx)
 {
 	struct pci_dev *pci_dev = efx->pci_dev;
 	dma_addr_t dma_mask = efx->type->max_dma_mask;
+	bool use_wc;
 	int rc;
 
 	netif_dbg(efx, probe, efx->net_dev, "initialising I/O\n");
@@ -1104,8 +1105,21 @@ static int efx_init_io(struct efx_nic *efx)
 		rc = -EIO;
 		goto fail3;
 	}
-	efx->membase = ioremap_wc(efx->membase_phys,
-				  efx->type->mem_map_size);
+
+	/* bug22643: If SR-IOV is enabled then tx push over a write combined
+	 * mapping is unsafe. We need to disable write combining in this case.
+	 * MSI is unsupported when SR-IOV is enabled, and the firmware will
+	 * have removed the MSI capability. So write combining is safe if
+	 * there is an MSI capability.
+	 */
+	use_wc = (!EFX_WORKAROUND_22643(efx) ||
+		  pci_find_capability(pci_dev, PCI_CAP_ID_MSI));
+	if (use_wc)
+		efx->membase = ioremap_wc(efx->membase_phys,
+					  efx->type->mem_map_size);
+	else
+		efx->membase = ioremap_nocache(efx->membase_phys,
+					       efx->type->mem_map_size);
 	if (!efx->membase) {
 		netif_err(efx, probe, efx->net_dev,
 			  "could not map memory BAR at %llx+%x\n",
diff --git a/drivers/net/sfc/workarounds.h b/drivers/net/sfc/workarounds.h
index e4dd3a7..99ff114 100644
--- a/drivers/net/sfc/workarounds.h
+++ b/drivers/net/sfc/workarounds.h
@@ -38,6 +38,8 @@
 #define EFX_WORKAROUND_15783 EFX_WORKAROUND_ALWAYS
 /* Legacy interrupt storm when interrupt fifo fills */
 #define EFX_WORKAROUND_17213 EFX_WORKAROUND_SIENA
+/* Write combining and sriov=enabled are incompatible */
+#define EFX_WORKAROUND_22643 EFX_WORKAROUND_SIENA
 
 /* Spurious parity errors in TSORT buffers */
 #define EFX_WORKAROUND_5129 EFX_WORKAROUND_FALCON_A
-- 
1.7.4


-- 
Ben Hutchings, Senior Software Engineer, Solarflare
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.


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

* Re: pull request: sfc-2.6 2011-03-23
  2011-03-23 21:14 pull request: sfc-2.6 2011-03-23 Ben Hutchings
  2011-03-23 21:16 ` [PATCH net-2.6] sfc: Siena: Disable write-combining when SR-IOV is enabled Ben Hutchings
@ 2011-03-23 22:56 ` David Miller
  1 sibling, 0 replies; 3+ messages in thread
From: David Miller @ 2011-03-23 22:56 UTC (permalink / raw)
  To: bhutchings; +Cc: netdev, linux-net-drivers

From: Ben Hutchings <bhutchings@solarflare.com>
Date: Wed, 23 Mar 2011 21:14:33 +0000

> The following changes since commit 736561a01f11114146b1b7f82d486fa9c95828ef:
> 
>   IPVS: Use global mutex in ip_vs_app.c (2011-03-21 20:39:24 -0700)
> 
> are available in the git repository at:
>   git://git.kernel.org/pub/scm/linux/kernel/git/bwh/sfc-2.6.git sfc-2.6.39
> 
> Bug fix for the latest optimisation.

Pulled, thanks a lot Ben.

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

end of thread, other threads:[~2011-03-23 22:55 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-03-23 21:14 pull request: sfc-2.6 2011-03-23 Ben Hutchings
2011-03-23 21:16 ` [PATCH net-2.6] sfc: Siena: Disable write-combining when SR-IOV is enabled Ben Hutchings
2011-03-23 22:56 ` pull request: sfc-2.6 2011-03-23 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).