netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] work around 5701 misalignment
@ 2004-10-13 20:54 Jesse Barnes
  2004-10-13 20:57 ` Jeff Garzik
  0 siblings, 1 reply; 3+ messages in thread
From: Jesse Barnes @ 2004-10-13 20:54 UTC (permalink / raw)
  To: jgarzik, netdev

[-- Attachment #1: Type: text/plain, Size: 367 bytes --]

This patch helps deal with 5701s running in PCI-X mode on platforms (like 
ia64) where unaligned accesses are very expensive.  It was made a config 
option at davem's request, afaik, and only affects 5701s when enabled.  Patch 
originally by John Partridge.

Signed-off-by: Jesse Barnes <jbarnes@sgi.com>
Signed-off-by: John Partridge <johnip@sgi.com>

Thanks,
Jesse

[-- Attachment #2: tg3-unaligned-expensive.patch --]
[-- Type: text/x-diff, Size: 1328 bytes --]


===========================================================================
linux/drivers/net/Kconfig
===========================================================================

--- a/linux/drivers/net/Kconfig	2004-10-13 15:25:03.000000000 -0500
+++ b/linux/drivers/net/Kconfig	2004-10-13 15:22:39.000000000 -0500
@@ -2062,6 +2062,15 @@
 
 endmenu
 
+config UNALIGNED_EXPENSIVE
+	depends on TIGON3
+	bool "Do aligned kernel buffers for PCI-X 5701 Cards"
+	help 
+		This aligns kernel buffers for PCI-X 5701
+		other cards do not have this problem.
+		This will help performance on 5701 cards
+		and not adversly affect any other cards.
+
 #
 #	10 Gigabit Ethernet
 #

===========================================================================
linux/drivers/net/tg3.c
===========================================================================

--- a/linux/drivers/net/tg3.c	2004-10-13 15:25:03.000000000 -0500
+++ b/linux/drivers/net/tg3.c	2004-10-13 15:14:45.000000000 -0500
@@ -2352,7 +2352,12 @@
 
 		len = ((desc->idx_len & RXD_LEN_MASK) >> RXD_LEN_SHIFT) - 4; /* omit crc */
 
-		if (len > RX_COPY_THRESHOLD) {
+		if (len > RX_COPY_THRESHOLD
+#if defined(CONFIG_UNALIGNED_EXPENSIVE)
+                                && tp->rx_offset == 2
+#endif
+)
+{
 			int skb_size;
 
 			skb_size = tg3_alloc_rx_skb(tp, opaque_key,

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

* Re: [PATCH] work around 5701 misalignment
  2004-10-13 20:54 [PATCH] work around 5701 misalignment Jesse Barnes
@ 2004-10-13 20:57 ` Jeff Garzik
  2004-10-20  6:15   ` David S. Miller
  0 siblings, 1 reply; 3+ messages in thread
From: Jeff Garzik @ 2004-10-13 20:57 UTC (permalink / raw)
  To: Jesse Barnes; +Cc: netdev, David S. Miller

Jesse Barnes wrote:
> --- a/linux/drivers/net/tg3.c	2004-10-13 15:25:03.000000000 -0500
> +++ b/linux/drivers/net/tg3.c	2004-10-13 15:14:45.000000000 -0500
> @@ -2352,7 +2352,12 @@
>  
>  		len = ((desc->idx_len & RXD_LEN_MASK) >> RXD_LEN_SHIFT) - 4; /* omit crc */
>  
> -		if (len > RX_COPY_THRESHOLD) {
> +		if (len > RX_COPY_THRESHOLD
> +#if defined(CONFIG_UNALIGNED_EXPENSIVE)
> +                                && tp->rx_offset == 2
> +#endif


hmmm, the normal solution is to give RX_COPY_THRESHOLD a per-arch value. 
  Grep for 'rx_copybreak' in bunches of net drivers.

DaveM might squirm a bit but IMHO RX_COPY_THRESHOLD really is 
platform-dependent.

	Jeff

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

* Re: [PATCH] work around 5701 misalignment
  2004-10-13 20:57 ` Jeff Garzik
@ 2004-10-20  6:15   ` David S. Miller
  0 siblings, 0 replies; 3+ messages in thread
From: David S. Miller @ 2004-10-20  6:15 UTC (permalink / raw)
  To: Jeff Garzik; +Cc: jbarnes, netdev, davem

On Wed, 13 Oct 2004 16:57:28 -0400
Jeff Garzik <jgarzik@pobox.com> wrote:

> DaveM might squirm a bit but IMHO RX_COPY_THRESHOLD really is 
> platform-dependent.

I'm not totally against such an idea.
We have something similar already in the form
of NET_IP_ALIGN which ppc64 overrides.

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

end of thread, other threads:[~2004-10-20  6:15 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-10-13 20:54 [PATCH] work around 5701 misalignment Jesse Barnes
2004-10-13 20:57 ` Jeff Garzik
2004-10-20  6:15   ` David S. 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).