From: Shradha Shah <sshah@solarflare•com>
To: David Miller <davem@davemloft•net>
Cc: <netdev@vger•kernel.org>, <linux-net-drivers@solarflare•com>
Subject: [PATCH net v3 2/2] sfc: Restrict PIO to 64-bit architectures
Date: Thu, 29 May 2014 11:20:50 +0100 [thread overview]
Message-ID: <53870A02.6020500@solarflare.com> (raw)
In-Reply-To: <53870984.6020803@solarflare.com>
From: Jon Cooper <jcooper@solarflare•com>
Enable PIO for x86_64 architecture only.
Not tested on platforms other than x86_64.
Fixes:ee45fd92c739
("sfc: Use TX PIO for sufficiently small packets")
Signed-off-by: Shradha Shah <sshah@solarflare•com>
---
drivers/net/ethernet/sfc/io.h | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/drivers/net/ethernet/sfc/io.h b/drivers/net/ethernet/sfc/io.h
index 4d3f119..adadcf0 100644
--- a/drivers/net/ethernet/sfc/io.h
+++ b/drivers/net/ethernet/sfc/io.h
@@ -66,10 +66,18 @@
#define EFX_USE_QWORD_IO 1
#endif
+/* PIO only works on 64-bit architectures */
+#if BITS_PER_LONG == 64
+/* not strictly necessary to restrict to x86 arch, but done for safety
+ * since unusual write combining behaviour can break PIO.
+ */
+#ifdef CONFIG_X86_64
/* PIO is a win only if write-combining is possible */
#ifdef ARCH_HAS_IOREMAP_WC
#define EFX_USE_PIO 1
#endif
+#endif
+#endif
#ifdef EFX_USE_QWORD_IO
static inline void _efx_writeq(struct efx_nic *efx, __le64 value,
prev parent reply other threads:[~2014-05-29 10:20 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-05-29 10:18 [PATCH net v3 0/2] sfc: Restrict PIO for 64bit arch in order to avoid data corruption Shradha Shah
2014-05-29 10:20 ` [PATCH net v3 1/2] sfc: use 64-bit writes for PIO Shradha Shah
2014-06-02 5:25 ` David Miller
2014-05-29 10:20 ` Shradha Shah [this message]
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=53870A02.6020500@solarflare.com \
--to=sshah@solarflare$(echo .)com \
--cc=davem@davemloft$(echo .)net \
--cc=linux-net-drivers@solarflare$(echo .)com \
--cc=netdev@vger$(echo .)kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox