netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jim Lewis <jim@jklewis.com>
To: Jeff Garzik <jgarzik@pobox.com>
Cc: Andrew Morton <akpm@osdl.org>, netdev <netdev@vger.kernel.org>,
	Work <jklewis@us.ibm.com>
Subject: [PATCH] Spidernet - remove ETH_ZLEN check in earlier patch
Date: Fri, 10 Nov 2006 11:50:46 -0600	[thread overview]
Message-ID: <1163181046.4422.11.camel@localhost.localdomain> (raw)

Subject: Spidernet - remove ETH_ZLEN check in earlier patch
From: James K Lewis <jklewis@us.ibm.com>

In an earlier patch, code was added to pad packets that were less that
ETH_ZLEN (60) bytes using the skb_pad function. This has caused hangs
when accessing certain NFS mounted file systems. This patch removes the
check and solves the NFS problem. The driver, with this patch, has been
tested extensively. Please apply.


Signed-off-by: James K Lewis <jklewis@us.ibm.com>


---
 drivers/net/spider_net.c |   17 ++++-------------
 drivers/net/spider_net.h |    2 +-
 2 files changed, 5 insertions(+), 14 deletions(-)

Index: linux-2.6.18/drivers/net/spider_net.c
===================================================================
--- linux-2.6.18.orig/drivers/net/spider_net.c	2006-11-04
13:04:32.000000000 -0600
+++ linux-2.6.18/drivers/net/spider_net.c	2006-11-04 13:10:00.000000000
-0600
@@ -610,20 +610,12 @@ spider_net_prepare_tx_descr(struct spide
 	struct spider_net_descr *descr;
 	dma_addr_t buf;
 	unsigned long flags;
-	int length;
 
-	length = skb->len;
-	if (length < ETH_ZLEN) {
-		if (skb_pad(skb, ETH_ZLEN-length))
-			return 0;
-		length = ETH_ZLEN;
-	}
-
-	buf = pci_map_single(card->pdev, skb->data, length, PCI_DMA_TODEVICE);
+	buf = pci_map_single(card->pdev, skb->data, skb->len,
PCI_DMA_TODEVICE);
 	if (pci_dma_mapping_error(buf)) {
 		if (netif_msg_tx_err(card) && net_ratelimit())
 			pr_err("could not iommu-map packet (%p, %i). "
-				  "Dropping packet\n", skb->data, length);
+				  "Dropping packet\n", skb->data, skb->len);
 		card->spider_stats.tx_iommu_map_error++;
 		return -ENOMEM;
 	}
@@ -633,7 +625,7 @@ spider_net_prepare_tx_descr(struct spide
 	card->tx_chain.head = descr->next;
 
 	descr->buf_addr = buf;
-	descr->buf_size = length;
+	descr->buf_size = skb->len;
 	descr->next_descr_addr = 0;
 	descr->skb = skb;
 	descr->data_status = 0;
@@ -768,8 +760,7 @@ spider_net_release_tx_chain(struct spide
 
 		/* unmap the skb */
 		if (skb) {
-			int len = skb->len < ETH_ZLEN ? ETH_ZLEN : skb->len;
-			pci_unmap_single(card->pdev, buf_addr, len, PCI_DMA_TODEVICE);
+			pci_unmap_single(card->pdev, buf_addr, skb->len, PCI_DMA_TODEVICE);
 			dev_kfree_skb(skb);
 		}
 	}
Index: linux-2.6.18/drivers/net/spider_net.h
===================================================================
--- linux-2.6.18.orig/drivers/net/spider_net.h	2006-11-04
13:03:58.000000000 -0600
+++ linux-2.6.18/drivers/net/spider_net.h	2006-11-04 13:06:11.000000000
-0600
@@ -24,7 +24,7 @@
 #ifndef _SPIDER_NET_H
 #define _SPIDER_NET_H
 
-#define VERSION "1.1 A"
+#define VERSION "1.5 A"
 
 #include "sungem_phy.h"
 



             reply	other threads:[~2006-11-10 17:50 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-11-10 17:50 Jim Lewis [this message]
2006-11-10 17:58 ` [PATCH] Spidernet - remove ETH_ZLEN check in earlier patch Stephen Hemminger
2006-11-10 18:50 ` [PATCH] spidernet: fix transmit routine Stephen Hemminger
     [not found]   ` <OFF9C5DB9C.8DD003F3-ON87257222.0068A615-86257222.006950CA@us.ibm.com>
2006-11-10 19:30     ` Stephen Hemminger

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=1163181046.4422.11.camel@localhost.localdomain \
    --to=jim@jklewis.com \
    --cc=akpm@osdl.org \
    --cc=jgarzik@pobox.com \
    --cc=jklewis@us.ibm.com \
    --cc=netdev@vger.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).