Skip to contentSkip to conversation

pcnet32.c bug?

PATCH Brian Murphy 3 participants 3 messages May 29, 2002 – May 30, 2002

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

If I don't apply the following patch to pcnet32.c then the network connection on my vr5000 box is extremely jerky. It also seems quite sensible to have a dma sync operation here.

any comments?

/Brian

net/pcnet32.c +4 -0
@@ -1343,6 +1351,10 @@
 		if (!rx_in_place) {
 		    skb_reserve(skb,2); /* 16 byte align */
 		    skb_put(skb,pkt_len);	/* Make room */
+                    pci_dma_sync_single(lp->pci_dev, 
+				    lp->rx_skbuff[entry]->tail, 
+				    pkt_len,
+				    PCI_DMA_FROMDEVICE);
 		    eth_copy_and_sum(skb,
 				     (unsigned char *)(lp->rx_skbuff[entry]->tail),
 				     pkt_len,0);
#1 lore raw

Yes, this fix is correct... I made the same patch locally... sorry we haven't submited it yet... turns out we've dropeed this one from our own latest sources; thanks for the reminder. :-)

Note that there is another problem with cache line invalidation and the use of pci_dma_sync_single(), where one can get stale entries in the cache when the buffer is next re-used for DMA.

My co-worker Will Jhun <mailto:[email protected]> just sent e-mail on the subject of problems with the cache invalidation routines last Saturday, with Message-ID: <[email protected]>

Kevin

Quoted 23 lines · Brian Murphy

If I don't apply the following patch to pcnet32.c then the network connection on my vr5000 box is extremely jerky. It also seems quite sensible to have a dma sync operation here.

any comments?

/Brian

net/pcnet32.c +4 -0
@@ -1343,6 +1351,10 @@
 		if (!rx_in_place) {
 		    skb_reserve(skb,2); /* 16 byte align */
 		    skb_put(skb,pkt_len);	/* Make room */
+                    pci_dma_sync_single(lp->pci_dev,
+				    lp->rx_skbuff[entry]->tail,
+				    pkt_len,
+				    PCI_DMA_FROMDEVICE);
 		    eth_copy_and_sum(skb,
 				     (unsigned char 
 *)(lp->rx_skbuff[entry]->tail),

pkt_len,0);

#2 lore raw
In reply to Brian Murphy
Quoted 4 lines · Brian Murphy

If I don't apply the following patch to pcnet32.c then the network connection
on my vr5000 box is extremely jerky. It also seems quite sensible to have a dma sync operation here.

Yes, that should be there by all means. We had to add that exact same line to get our pcnet32 working on MIPS.

Thanks,
William