Re: r8169 MTU greater than 1500 causes corruption for other controllers

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Ilpo Järvinen
Date: Wednesday, August 20, 2008 - 12:21 pm

On Wed, 20 Aug 2008, Timothy J Fontaine wrote:


Hmm, there was no explanation why the tp->rx_buf_sz to pkt_size change
was made in that commit (I have no idea whether those sizes have to match 
to other places that use tp->rx_buf_sz)... Below is a patch to revert 
that part of the change fully though it could be enough to change just 
pci_unmap_single arg (but that would probably need also 
rtl8169_mark_to_asic arg to be changed to match pkt_size).


Thanks for the detailed report btw... :-)

-- 
 i.

----
diff --git a/drivers/net/r8169.c b/drivers/net/r8169.c
index a3e3895..44961ef 100644
--- a/drivers/net/r8169.c
+++ b/drivers/net/r8169.c
@@ -2720,7 +2720,7 @@ static inline bool rtl8169_try_rx_copy(struct sk_buff **sk_buff,
 	if (!skb)
 		goto out;
 
-	pci_dma_sync_single_for_cpu(tp->pci_dev, addr, pkt_size,
+	pci_dma_sync_single_for_cpu(tp->pci_dev, addr, tp->rx_buf_sz,
 				    PCI_DMA_FROMDEVICE);
 	skb_reserve(skb, NET_IP_ALIGN);
 	skb_copy_from_linear_data(*sk_buff, skb->data, pkt_size);
@@ -2789,10 +2789,10 @@ static int rtl8169_rx_interrupt(struct net_device *dev,
 
 			if (rtl8169_try_rx_copy(&skb, tp, pkt_size, addr)) {
 				pci_dma_sync_single_for_device(pdev, addr,
-					pkt_size, PCI_DMA_FROMDEVICE);
+					tp->rx_buf_sz, PCI_DMA_FROMDEVICE);
 				rtl8169_mark_to_asic(desc, tp->rx_buf_sz);
 			} else {
-				pci_unmap_single(pdev, addr, pkt_size,
+				pci_unmap_single(pdev, addr, tp->rx_buf_sz,
 						 PCI_DMA_FROMDEVICE);
 				tp->Rx_skbuff[entry] = NULL;
 			}
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
r8169 MTU greater than 1500 causes corruption for other co ..., Timothy J Fontaine, (Wed Aug 20, 10:09 am)
Re: r8169 MTU greater than 1500 causes corruption for othe ..., Ilpo Järvinen, (Wed Aug 20, 12:21 pm)
Re: r8169 MTU greater than 1500 causes corruption for othe ..., Timothy J Fontaine, (Wed Aug 20, 2:17 pm)
Re: r8169 MTU greater than 1500 causes corruption for othe ..., Timothy J Fontaine, (Thu Aug 21, 8:20 am)