From: Greg KH <greg@kroah.com>
To: shemminger@osdl.org, romieu@fr.zoreil.com, netdev@oss.sgi.com,
jgarzik@pobox.com
Cc: linux-kernel@vger.kernel.org, stable@kernel.org
Subject: [09/11] r8169: receive descriptor length fix
Date: Thu, 10 Mar 2005 15:09:30 -0800 [thread overview]
Message-ID: <20050310230930.GJ22112@kroah.com> (raw)
In-Reply-To: <20050310230519.GA22112@kroah.com>
-stable review patch. If anyone has any objections, please let us know.
------------------
The status and received packets indication in the Rx descriptor ring
are not correctly reset when a descriptor is recycled.
Signed-off-by: Francois Romieu <romieu@fr.zoreil.com>
Signed-off-by: Chris Wright <chrisw@osdl.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
diff -puN drivers/net/r8169.c~r8169-490 drivers/net/r8169.c
--- a/drivers/net/r8169.c~r8169-490 2005-03-08 00:01:26.000000000 +0100
+++ b/drivers/net/r8169.c 2005-03-09 00:38:34.235464833 +0100
@@ -1683,16 +1683,19 @@ static void rtl8169_free_rx_skb(struct r
rtl8169_make_unusable_by_asic(desc);
}
-static inline void rtl8169_return_to_asic(struct RxDesc *desc, int rx_buf_sz)
+static inline void rtl8169_mark_to_asic(struct RxDesc *desc, u32 rx_buf_sz)
{
- desc->opts1 |= cpu_to_le32(DescOwn + rx_buf_sz);
+ u32 eor = le32_to_cpu(desc->opts1) & RingEnd;
+
+ desc->opts1 = cpu_to_le32(DescOwn | eor | rx_buf_sz);
}
-static inline void rtl8169_give_to_asic(struct RxDesc *desc, dma_addr_t mapping,
- int rx_buf_sz)
+static inline void rtl8169_map_to_asic(struct RxDesc *desc, dma_addr_t mapping,
+ u32 rx_buf_sz)
{
desc->addr = cpu_to_le64(mapping);
- desc->opts1 |= cpu_to_le32(DescOwn + rx_buf_sz);
+ wmb();
+ rtl8169_mark_to_asic(desc, rx_buf_sz);
}
static int rtl8169_alloc_rx_skb(struct pci_dev *pdev, struct sk_buff **sk_buff,
@@ -1712,7 +1715,7 @@ static int rtl8169_alloc_rx_skb(struct p
mapping = pci_map_single(pdev, skb->tail, rx_buf_sz,
PCI_DMA_FROMDEVICE);
- rtl8169_give_to_asic(desc, mapping, rx_buf_sz);
+ rtl8169_map_to_asic(desc, mapping, rx_buf_sz);
out:
return ret;
@@ -2150,7 +2153,7 @@ static inline int rtl8169_try_rx_copy(st
skb_reserve(skb, NET_IP_ALIGN);
eth_copy_and_sum(skb, sk_buff[0]->tail, pkt_size, 0);
*sk_buff = skb;
- rtl8169_return_to_asic(desc, rx_buf_sz);
+ rtl8169_mark_to_asic(desc, rx_buf_sz);
ret = 0;
}
}
_
--
Ueimor
next prev parent reply other threads:[~2005-03-10 23:09 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20050310230519.GA22112@kroah.com>
2005-03-10 23:08 ` [06/11] [TCP]: Put back tcp_timer_bug_msg[] symbol export Greg KH
2005-03-10 23:20 ` Christoph Hellwig
2005-03-10 23:47 ` David S. Miller
2005-03-10 23:09 ` Greg KH [this message]
2005-03-10 23:09 ` [10/11] sis900 kernel oops fix Greg KH
2005-03-10 23:09 ` [11/11] [VIA RHINE] older chips oops on shutdown Greg KH
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=20050310230930.GJ22112@kroah.com \
--to=greg@kroah.com \
--cc=jgarzik@pobox.com \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@oss.sgi.com \
--cc=romieu@fr.zoreil.com \
--cc=shemminger@osdl.org \
--cc=stable@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 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).