From: Martin Michlmayr <tbm@cyrius.com>
To: Francois Romieu <romieu@fr.zoreil.com>
Cc: netdev@vger.kernel.org, Edward Hsu <edward_hsu@realtek.com.tw>,
bunk@stusta.de
Subject: Re: [PATCH 12/21] r8169: confusion between hardware and IP header alignment
Date: Fri, 23 Nov 2007 08:45:49 +0100 [thread overview]
Message-ID: <20071123074549.GE18081@deprecation.cyrius.com> (raw)
In-Reply-To: <20070629202555.GN3240@electric-eye.fr.zoreil.com>
Hi Francois,
A Debian user reported that NFS transfers are not working correctly on
a Thecus N2100 (which has two 8169 ports). I confirmed this bug with
2.6.18 and 2.6.22 but couldn't reproduce it with 2.6.23. A git bisect
has revealed that your patch "confusion between hardware and IP header
alignment" fixes the issue. Thanks for fixing this bug before we even
got a chance to report it. ;-)
I'd like to backport the fix to the 2.6.18 kernel that is in our
stable release and have a couple of questions:
- Does your later patch "align the IP header when there is no DMA
constraint" fix any bugs or is it merely an improvement?
- Should I change "align" to 8 for RTL_CFG_1, as it's done in
current kernels?
I'd like to backport only the changes needed to actually fix the bug
in order to make sure I won't break any other devices. The patch
below works for me but I'd like to hear your opinion about my
questions above.
[ I added Adrian Bunk to the CC line since he might be interested in
applying the patch from [1] and possibly [2] to his 2.6.16 branch. ]
--- a/drivers/net/r8169.c 2007-11-22 12:20:51.000000000 +0000
+++ b/drivers/net/r8169.c 2007-11-22 12:20:51.000000000 +0000
@@ -202,7 +202,7 @@
unsigned int region;
unsigned int align;
} rtl_cfg_info[] = {
- [RTL_CFG_0] = { 1, NET_IP_ALIGN },
+ [RTL_CFG_0] = { 1, 2 },
[RTL_CFG_1] = { 2, NET_IP_ALIGN },
[RTL_CFG_2] = { 2, 8 }
};
@@ -2487,9 +2487,9 @@
if (pkt_size < rx_copybreak) {
struct sk_buff *skb;
- skb = dev_alloc_skb(pkt_size + align);
+ skb = dev_alloc_skb(pkt_size + NET_IP_ALIGN);
if (skb) {
- skb_reserve(skb, (align - 1) & (u32)skb->data);
+ skb_reserve(skb, NET_IP_ALIGN);
eth_copy_and_sum(skb, sk_buff[0]->data, pkt_size, 0);
*sk_buff = skb;
rtl8169_mark_to_asic(desc, rx_buf_sz);
Some background: the Thecus N2100 is an ARM based NAS device with two
8169 ports. The chips exhibit PCI parity problems so
dev->broken_parity_status is set on this platform. The Debian bug is
http://bugs.debian.org/452069
Here's the output from lspci:
00:01.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL-8169 Gigabit Ethernet (rev 10)
Subsystem: Realtek Semiconductor Co., Ltd. RTL-8169 Gigabit Ethernet
Flags: bus master, 66MHz, medium devsel, latency 0, IRQ 27
I/O ports at fe000000 [size=256]
Memory at 800a0200 (32-bit, non-prefetchable) [size=256]
Expansion ROM at 80080000 [disabled] [size=64K]
Capabilities: [dc] Power Management version 2
Capabilities: [60] Vital Product Data
00:02.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL-8169 Gigabit Ethernet (rev 10)
Subsystem: Realtek Semiconductor Co., Ltd. RTL-8169 Gigabit Ethernet
Flags: bus master, 66MHz, medium devsel, latency 0, IRQ 30
I/O ports at fe000400 [size=256]
Memory at 800a0300 (32-bit, non-prefetchable) [size=256]
Expansion ROM at 80090000 [disabled] [size=64K]
Capabilities: [dc] Power Management version 2
Capabilities: [60] Vital Product Data
[1] http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=864022344caf43dab7fa5219152280d056c6e051
[2] http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=e9f63f30863fd778a5329e93c7e2208b9bcb5b79
--
Martin Michlmayr
http://www.cyrius.com/
next prev parent reply other threads:[~2007-11-23 7:46 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-06-29 20:12 [PATCH 00/21] r8169: pull request for 'r8169-for-jeff-20070629' branch Francois Romieu
2007-06-29 20:13 ` [PATCH 01/21] r8169: use netdev_alloc_skb Francois Romieu
2007-06-29 20:17 ` [PATCH 02/21] r8169: de-obfuscate modulo arithmetic Francois Romieu
2007-06-29 20:17 ` [PATCH 03/21] r8169: kill eth_copy_and_sum() Francois Romieu
2007-06-29 20:18 ` [PATCH 04/21] r8169: Rx path update Francois Romieu
2007-06-29 20:23 ` [PATCH 05/21] r8169: add hooks for per-device hw_start handler Francois Romieu
2007-06-29 20:23 ` [PATCH 06/21] r8169: add helpers " Francois Romieu
2007-06-29 20:23 ` [PATCH 07/21] r8169: populate the hw_start handler for the 8168 Francois Romieu
2007-06-29 20:24 ` [PATCH 08/21] r8169: populate the hw_start handler for the 8110 Francois Romieu
2007-06-29 20:24 ` [PATCH 09/21] r8169: prettify mac_version Francois Romieu
2007-06-29 20:25 ` [PATCH 10/21] r8169: merge with version 6.001.00 of Realtek's r8169 driver Francois Romieu
2007-06-29 20:35 ` Arjan van de Ven
2007-06-29 20:49 ` Jeff Garzik
2007-06-30 9:41 ` Francois Romieu
2007-06-30 9:47 ` Jeff Garzik
2007-06-30 14:43 ` Arjan van de Ven
2007-06-29 20:25 ` [PATCH 11/21] r8169: merge with version 8.001.00 of Realtek's r8168 driver Francois Romieu
2007-06-29 20:25 ` [PATCH 12/21] r8169: confusion between hardware and IP header alignment Francois Romieu
2007-11-23 7:45 ` Martin Michlmayr [this message]
2007-11-25 23:05 ` Francois Romieu
2007-11-26 8:36 ` Martin Michlmayr
2007-11-26 22:42 ` Francois Romieu
2007-06-29 20:26 ` [PATCH 13/21] r8169: small 8101 comment Francois Romieu
2007-06-29 20:26 ` [PATCH 14/21] r8169: remove the media option Francois Romieu
2007-06-29 20:27 ` [PATCH 15/21] r8169: cleanup Francois Romieu
2007-06-29 20:27 ` [PATCH 16/21] r8169: add bit description for the TxPoll register Francois Romieu
2007-06-29 20:27 ` [PATCH 17/21] r8169: align the IP header when there is no DMA constraint Francois Romieu
2007-06-29 20:28 ` [PATCH 18/21] r8169: add endianess annotations to [RT]xDesc Francois Romieu
2007-06-29 20:28 ` [PATCH 19/21] r8169: display some extra debug information during startup Francois Romieu
2007-06-29 20:29 ` [PATCH 20/21] r8169: mac address change support Francois Romieu
2007-06-29 20:29 ` [PATCH 21/21] r8169: perform RX config change after mac filtering Francois Romieu
2007-06-29 20:48 ` [PATCH 00/21] r8169: pull request for 'r8169-for-jeff-20070629' branch Jeff Garzik
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=20071123074549.GE18081@deprecation.cyrius.com \
--to=tbm@cyrius.com \
--cc=bunk@stusta.de \
--cc=edward_hsu@realtek.com.tw \
--cc=netdev@vger.kernel.org \
--cc=romieu@fr.zoreil.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).