linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] pasemi_mac: two bugfixes for 2.6.24
@ 2007-11-07  4:20 Olof Johansson
  2007-11-07  4:20 ` [PATCH 1/2] pasemi_mac: Don't set replace-source-address descriptor bits Olof Johansson
  2007-11-07  4:21 ` [PATCH 2/2] pasemi_mac: Fix CRC checks Olof Johansson
  0 siblings, 2 replies; 4+ messages in thread
From: Olof Johansson @ 2007-11-07  4:20 UTC (permalink / raw)
  To: jgarzik; +Cc: netdev, linuxppc-dev

Hi Jeff,

Two bugfixes for pasemi_mac for 2.6.24:

[PATCH 1/2] pasemi_mac: Don't set replace-source-address descriptor bits
[PATCH 2/2] pasemi_mac: Fix CRC checks


Thanks,

-Olof

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH 1/2] pasemi_mac: Don't set replace-source-address descriptor bits
  2007-11-07  4:20 [PATCH 0/2] pasemi_mac: two bugfixes for 2.6.24 Olof Johansson
@ 2007-11-07  4:20 ` Olof Johansson
  2007-11-08 17:47   ` Jeff Garzik
  2007-11-07  4:21 ` [PATCH 2/2] pasemi_mac: Fix CRC checks Olof Johansson
  1 sibling, 1 reply; 4+ messages in thread
From: Olof Johansson @ 2007-11-07  4:20 UTC (permalink / raw)
  To: jgarzik; +Cc: netdev, linuxppc-dev

Don't use the "replace source address with local MAC address" bits, since
it causes problems on some variations of the hardware due to an erratum.


Signed-off-by: Olof Johansson <olof@lixom.net>

Index: k.org/drivers/net/pasemi_mac.c
===================================================================
--- k.org.orig/drivers/net/pasemi_mac.c
+++ k.org/drivers/net/pasemi_mac.c
@@ -1126,7 +1126,7 @@ static int pasemi_mac_start_tx(struct sk
 	unsigned long flags;
 	int i, nfrags;
 
-	dflags = XCT_MACTX_O | XCT_MACTX_ST | XCT_MACTX_SS | XCT_MACTX_CRC_PAD;
+	dflags = XCT_MACTX_O | XCT_MACTX_ST | XCT_MACTX_CRC_PAD;
 
 	if (skb->ip_summed == CHECKSUM_PARTIAL) {
 		const unsigned char *nh = skb_network_header(skb);

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH 2/2] pasemi_mac: Fix CRC checks
  2007-11-07  4:20 [PATCH 0/2] pasemi_mac: two bugfixes for 2.6.24 Olof Johansson
  2007-11-07  4:20 ` [PATCH 1/2] pasemi_mac: Don't set replace-source-address descriptor bits Olof Johansson
@ 2007-11-07  4:21 ` Olof Johansson
  1 sibling, 0 replies; 4+ messages in thread
From: Olof Johansson @ 2007-11-07  4:21 UTC (permalink / raw)
  To: jgarzik; +Cc: netdev, linuxppc-dev

Make sure we don't feed packets with bad CRC up the network stack,
and discount the packet length as reported from the MAC for the CRC
field.


Signed-off-by: Olof Johansson <olof@lixom.net>

Index: k.org/drivers/net/pasemi_mac.c
===================================================================
--- k.org.orig/drivers/net/pasemi_mac.c
+++ k.org/drivers/net/pasemi_mac.c
@@ -580,6 +580,16 @@ static int pasemi_mac_clean_rx(struct pa
 
 		len = (macrx & XCT_MACRX_LLEN_M) >> XCT_MACRX_LLEN_S;
 
+		pci_unmap_single(mac->dma_pdev, dma, len, PCI_DMA_FROMDEVICE);
+
+		if (macrx & XCT_MACRX_CRC) {
+			/* CRC error flagged */
+			mac->netdev->stats.rx_errors++;
+			mac->netdev->stats.rx_crc_errors++;
+			dev_kfree_skb_irq(skb);
+			goto next;
+		}
+
 		if (len < 256) {
 			struct sk_buff *new_skb;
 
@@ -595,11 +605,10 @@ static int pasemi_mac_clean_rx(struct pa
 		} else
 			info->skb = NULL;
 
-		pci_unmap_single(mac->dma_pdev, dma, len, PCI_DMA_FROMDEVICE);
-
 		info->dma = 0;
 
-		skb_put(skb, len);
+		/* Don't include CRC */
+		skb_put(skb, len-4);
 
 		if (likely((macrx & XCT_MACRX_HTY_M) == XCT_MACRX_HTY_IPV4_OK)) {
 			skb->ip_summed = CHECKSUM_UNNECESSARY;
@@ -614,6 +623,7 @@ static int pasemi_mac_clean_rx(struct pa
 		skb->protocol = eth_type_trans(skb, mac->netdev);
 		netif_receive_skb(skb);
 
+next:
 		RX_RING(mac, n) = 0;
 		RX_RING(mac, n+1) = 0;
 

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 1/2] pasemi_mac: Don't set replace-source-address descriptor bits
  2007-11-07  4:20 ` [PATCH 1/2] pasemi_mac: Don't set replace-source-address descriptor bits Olof Johansson
@ 2007-11-08 17:47   ` Jeff Garzik
  0 siblings, 0 replies; 4+ messages in thread
From: Jeff Garzik @ 2007-11-08 17:47 UTC (permalink / raw)
  To: Olof Johansson; +Cc: netdev, jgarzik, linuxppc-dev

On Tue, Nov 06, 2007 at 10:20:39PM -0600, Olof Johansson wrote:
> Don't use the "replace source address with local MAC address" bits, since
> it causes problems on some variations of the hardware due to an erratum.
> 
> 
> Signed-off-by: Olof Johansson <olof@lixom.net>

applied 1-2

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2007-11-08 17:53 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-11-07  4:20 [PATCH 0/2] pasemi_mac: two bugfixes for 2.6.24 Olof Johansson
2007-11-07  4:20 ` [PATCH 1/2] pasemi_mac: Don't set replace-source-address descriptor bits Olof Johansson
2007-11-08 17:47   ` Jeff Garzik
2007-11-07  4:21 ` [PATCH 2/2] pasemi_mac: Fix CRC checks Olof Johansson

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).