netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jesse Barnes <jbarnes@sgi.com>
To: jgarzik@pobox.com, netdev@oss.sgi.com
Subject: [PATCH] work around 5701 misalignment
Date: Wed, 13 Oct 2004 15:54:19 -0500	[thread overview]
Message-ID: <200410131554.19845.jbarnes@sgi.com> (raw)

[-- 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,

             reply	other threads:[~2004-10-13 20:54 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-10-13 20:54 Jesse Barnes [this message]
2004-10-13 20:57 ` [PATCH] work around 5701 misalignment Jeff Garzik
2004-10-20  6:15   ` David S. Miller

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=200410131554.19845.jbarnes@sgi.com \
    --to=jbarnes@sgi.com \
    --cc=jgarzik@pobox.com \
    --cc=netdev@oss.sgi.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
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;
as well as URLs for NNTP newsgroup(s).