lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:	Mon, 13 May 2013 18:48:17 +0100
From:	Ben Hutchings <bhutchings@...arflare.com>
To:	David Miller <davem@...emloft.net>,
	Heiko Carstens <heiko.carstens@...ibm.com>,
	Geert Uytterhoeven <geert@...ux-m68k.org>
CC:	<linux-net-drivers@...arflare.com>,
	Linux Kernel Development <linux-kernel@...r.kernel.org>,
	<linux-s390@...r.kernel.org>, <netdev@...r.kernel.org>
Subject: [PATCH net] sfc: Reduce RX scatter buffer size to multiple of 256

efx_start_datapath() asserts that we can fit 2 RX scatter buffers plus
a software structure, each cache-aligned, into a single page.  Where
L1_CACHE_BYTES == 256 and PAGE_SIZE == 4096, which is the case on
s390, this assertion fails.  Reduce EFX_RX_USR_BUF_SIZE to make this
work.

This should also be good for performance, as it ensures that each RX
scatter buffer covers whole cache lines and slightly reduces the use
of DMA writes that can require a read-modify-write on inter-processor
links.

(We could use 2048 - L1_CACHE_BYTES, but EFX_RX_USR_BUF_SIZE also
affects user-level networking where a larger amount of housekeeping
data may be needed.  Although this version of the driver does not
support user-level networking, I prefer to keep scattering behaviour
consistent with the out-of-tree version.)

Reported-by: Geert Uytterhoeven <geert@...ux-m68k.org>
Reported-by: Heiko Carstens <heiko.carstens@...ibm.com>
Signed-off-by: Ben Hutchings <bhutchings@...arflare.com>
---
Heiko or Geert, please confirm that this really does fix the build
failure - I don't have an s390 toolchain.

Ben.

 drivers/net/ethernet/sfc/net_driver.h |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/sfc/net_driver.h b/drivers/net/ethernet/sfc/net_driver.h
index 9bd433a..6c8e1a8 100644
--- a/drivers/net/ethernet/sfc/net_driver.h
+++ b/drivers/net/ethernet/sfc/net_driver.h
@@ -72,8 +72,10 @@
 /* Maximum possible MTU the driver supports */
 #define EFX_MAX_MTU (9 * 1024)
 
-/* Size of an RX scatter buffer.  Small enough to pack 2 into a 4K page. */
-#define EFX_RX_USR_BUF_SIZE 1824
+/* Size of an RX scatter buffer.  Small enough to pack 2 into a 4K page,
+ * and should be a multiple of the cache line size.
+ */
+#define EFX_RX_USR_BUF_SIZE	(2048 - 256)
 
 /* Forward declare Precision Time Protocol (PTP) support structure. */
 struct efx_ptp_data;

-- 
Ben Hutchings, Staff 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.

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ