All of lore.kernel.org
 help / color / mirror / Atom feed
From: Francois Romieu <romieu@fr.zoreil.com>
To: Jeff Garzik <jeff@garzik.org>
Cc: netdev@vger.kernel.org, isely@pobox.com
Subject: [PATCH 4/5] r8169: more alignment for the 0x8168
Date: Mon, 4 Dec 2006 01:03:27 +0100	[thread overview]
Message-ID: <20061204000327.GE3625@electric-eye.fr.zoreil.com> (raw)
In-Reply-To: <20061203235257.GA3625@electric-eye.fr.zoreil.com>

Two thirds of packets are lost because of misalignment. Users of
Asus laptop did apparently not notice it.

Reported on Gigabyte GA-945GM-S2.

Fix for http://bugzilla.kernel.org/show_bug.cgi?id=7517

Signed-off-by: Francois Romieu <romieu@fr.zoreil.com>
---
 drivers/net/r8169.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/r8169.c b/drivers/net/r8169.c
index 0b57050..2379d83 100644
--- a/drivers/net/r8169.c
+++ b/drivers/net/r8169.c
@@ -2018,7 +2018,7 @@ static int rtl8169_alloc_rx_skb(struct p
 	if (!skb)
 		goto err_out;
 
-	skb_reserve(skb, align);
+	skb_reserve(skb, (align - 1) & (u32)skb->data);
 	*sk_buff = skb;
 
 	mapping = pci_map_single(pdev, skb->data, rx_buf_sz,
@@ -2486,7 +2486,7 @@ static inline int rtl8169_try_rx_copy(st
 
 		skb = dev_alloc_skb(pkt_size + align);
 		if (skb) {
-			skb_reserve(skb, align);
+			skb_reserve(skb, (align - 1) & (u32)skb->data);
 			eth_copy_and_sum(skb, sk_buff[0]->data, pkt_size, 0);
 			*sk_buff = skb;
 			rtl8169_mark_to_asic(desc, rx_buf_sz);
-- 
1.4.2.3


  parent reply	other threads:[~2006-12-04  0:04 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-12-03 23:52 [PATCH 0/5] Pull request for 'r8169-upstream-20061204-00' tag Francois Romieu
2006-12-03 23:54 ` [PATCH 1/5] r8169: more magic during initialization of the hardware Francois Romieu
2006-12-06  5:28   ` Philip Craig
2006-12-03 23:58 ` [PATCH 2/5] r8169: tweak the PCI data parity error recovery Francois Romieu
2006-12-03 23:59   ` [PATCH 3/5] r8169: phy program update Francois Romieu
2006-12-04  0:03 ` Francois Romieu [this message]
2007-02-13  3:50   ` [PATCH 4/5] r8169: more alignment for the 0x8168 Philip Craig
2007-02-13  8:14     ` Francois Romieu
2007-02-13 23:32       ` Mike Isely
2007-02-23 23:13         ` Francois Romieu
2007-02-26  7:42           ` Philip Craig
2007-02-26 22:25             ` Stephen Hemminger
2007-02-28 21:48             ` Francois Romieu
2007-02-28 23:18               ` Francois Romieu
2007-02-13 23:56       ` Philip Craig
2006-12-04  0:14 ` [PATCH 5/5] r8169: teach yourself arithmetic in 21 days Francois Romieu
2006-12-07 10:07 ` [PATCH 0/5] Pull request for 'r8169-upstream-20061204-00' tag 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=20061204000327.GE3625@electric-eye.fr.zoreil.com \
    --to=romieu@fr.zoreil.com \
    --cc=isely@pobox.com \
    --cc=jeff@garzik.org \
    --cc=netdev@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.