From cc9f022d97d08e4e36d38661857991fe91447d68 Mon Sep 17 00:00:00 2001 From: Francois Romieu Date: Fri, 17 Nov 2006 23:15:17 +0100 Subject: r8169: more alignment for the 0x8168 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 --- drivers/net/r8169.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'drivers/net/r8169.c') diff --git a/drivers/net/r8169.c b/drivers/net/r8169.c index 0b57050252e..2379d83768d 100644 --- a/drivers/net/r8169.c +++ b/drivers/net/r8169.c @@ -2018,7 +2018,7 @@ static int rtl8169_alloc_rx_skb(struct pci_dev *pdev, struct sk_buff **sk_buff, 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(struct sk_buff **sk_buff, int pkt_size, 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); -- cgit v1.2.3-70-g09d2