Re: [PATCH 2/14] Spidernet add net_ratelimit to suppress long output
It is in the LTC Bugzilla. I just checked and it is still there :) Jim On Thu, 2006-12-14 at 10:31 +1100, Michael Ellerman wrote: On Wed, 2006-12-13 at 15:08 -0600, Linas Vepstas wrote: This patch adds net_ratelimit to many of the printks in order to limit extraneous warning messages (created in response to Bug 28554). Bug 28554 in which bug tracking system? I can't find it in LTC or kernel.org bugzilla. cheers - To unsubscribe from this list: send the line unsubscribe netdev in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH] Spidernet - remove ETH_ZLEN check in earlier patch
Subject: Spidernet - remove ETH_ZLEN check in earlier patch From: James K Lewis [EMAIL PROTECTED] 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 [EMAIL PROTECTED] --- 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.0 -0600 +++ linux-2.6.18/drivers/net/spider_net.c 2006-11-04 13:10:00.0 -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.0 -0600 +++ linux-2.6.18/drivers/net/spider_net.h 2006-11-04 13:06:11.0 -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 - To unsubscribe from this list: send the line unsubscribe netdev in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH] Spidernet: add ethtool -S (show statistics)
This patch adds the ethtool -S (show statistics) feature to the Spidernet ethernet driver. I have tested it extensively and believe it is ready to be applied. Signed-off-by: James K Lewis --- drivers/net/spider_net.c | 10 ++ drivers/net/spider_net.h | 11 ++- drivers/net/spider_net_ethtool.c | 56 +++ 3 files changed, 75 insertions(+), 2 deletions(-) Index: linux-2.6.18-rc2/drivers/net/spider_net.c === --- linux-2.6.18-rc2.orig/drivers/net/spider_net.c 2006-09-05 17:56:19.0 -0500 +++ linux-2.6.18-rc2/drivers/net/spider_net.c 2006-09-20 14:03:54.0 -0500 @@ -472,6 +472,7 @@ spider_net_prepare_rx_descr(struct spide if (!descr-skb) { if (netif_msg_rx_err(card) net_ratelimit()) pr_err(Not enough memory to allocate rx buffer\n); + card-spider_stats.alloc_rx_skb_error++; return -ENOMEM; } descr-buf_size = bufsize; @@ -492,6 +493,7 @@ spider_net_prepare_rx_descr(struct spide dev_kfree_skb_any(descr-skb); if (netif_msg_rx_err(card) net_ratelimit()) pr_err(Could not iommu-map rx buffer\n); + card-spider_stats.rx_iommu_map_error++; descr-dmac_cmd_status = SPIDER_NET_DESCR_NOT_IN_USE; } else { descr-dmac_cmd_status = SPIDER_NET_DESCR_CARDOWNED | @@ -721,6 +723,7 @@ spider_net_prepare_tx_descr(struct spide if (netif_msg_tx_err(card) net_ratelimit()) pr_err(could not iommu-map packet (%p, %i). Dropping packet\n, skb-data, skb-len); + card-spider_stats.tx_iommu_map_error++; return -ENOMEM; } @@ -942,6 +945,7 @@ spider_net_xmit(struct sk_buff *skb, str } if (spider_net_get_descr_status(descr) != SPIDER_NET_DESCR_NOT_IN_USE) { + card-netdev_stats.tx_dropped++; result = NETDEV_TX_LOCKED; netif_stop_queue(netdev); goto out; @@ -1047,6 +1051,7 @@ spider_net_pass_skb_up(struct spider_net pr_err(error in received descriptor found, data_status=x%08x, data_error=x%08x\n, data_status, data_error); + card-spider_stats.rx_desc_error++; return 0; } @@ -1144,9 +1149,11 @@ spider_net_decode_one_descr(struct spide if ( (status != SPIDER_NET_DESCR_COMPLETE) (status != SPIDER_NET_DESCR_FRAME_END) ) { - if (netif_msg_rx_err(card)) + if (netif_msg_rx_err(card)) { pr_err(%s: RX descriptor with state %d\n, card-netdev-name, status); + card-spider_stats.rx_desc_unk_state++; + } goto refill; } @@ -2112,6 +2119,7 @@ spider_net_tx_timeout(struct net_device schedule_work(card-tx_timeout_task); else atomic_dec(card-tx_timeout_task_counter); + card-spider_stats.tx_timeouts++; } /** Index: linux-2.6.18-rc2/drivers/net/spider_net.h === --- linux-2.6.18-rc2.orig/drivers/net/spider_net.h 2006-09-07 17:45:15.0 -0500 +++ linux-2.6.18-rc2/drivers/net/spider_net.h 2006-09-20 14:02:10.0 -0500 @@ -438,6 +438,15 @@ struct spider_net_options { NETIF_MSG_HW | \ NETIF_MSG_WOL ) +struct spider_net_extra_stats { + unsigned long rx_desc_error; + unsigned long tx_timeouts; + unsigned long alloc_rx_skb_error; + unsigned long rx_iommu_map_error; + unsigned long tx_iommu_map_error; + unsigned long rx_desc_unk_state; +}; + struct spider_net_card { struct net_device *netdev; struct pci_dev *pdev; @@ -464,9 +473,9 @@ struct spider_net_card { /* for ethtool */ int msg_enable; - int rx_desc; int tx_desc; + struct spider_net_extra_stats spider_stats; struct spider_net_descr descr[0]; }; Index: linux-2.6.18-rc2/drivers/net/spider_net_ethtool.c === --- linux-2.6.18-rc2.orig/drivers/net/spider_net_ethtool.c 2006-08-23 19:01:02.0 -0500 +++ linux-2.6.18-rc2/drivers/net/spider_net_ethtool.c 2006-09-20 14:06:28.0 -0500 @@ -27,6 +27,27 @@ #include spider_net.h + +#define SPIDER_NET_NUM_STATS 13 + +static struct { + const char str[ETH_GSTRING_LEN]; +} ethtool_stats_keys[] = { + { tx_packets }, + { tx_bytes }, + { rx_packets }, + { rx_bytes }, + { tx_errors }, + { tx_dropped }, + {
[PATCH]: Add to MAINTAINERS file
This patch adds Jim Lewis to the MAINTAINERS file for the Spidernet network driver. Signed-off-by: James K Lewis [EMAIL PROTECTED] --- MAINTAINERS |6 ++ 1 file changed, 6 insertions(+) Index: linux-2.6.18-rc2/MAINTAINERS === --- linux-2.6.18-rc2.orig/MAINTAINERS 2006-08-21 16:59:25.0 -0500 +++ linux-2.6.18-rc2/MAINTAINERS2006-08-21 17:19:14.0 -0500 @@ -2702,6 +2702,12 @@ M: [EMAIL PROTECTED] L: linux-kernel@vger.kernel.org ? S: Supported +SPIDERNET NETWORK DRIVER for CELL +P: Jim Lewis +M: [EMAIL PROTECTED] +L: netdev@vger.kernel.org +S: Supported + SRM (Alpha) environment access P: Jan-Benedict Glaw M: [EMAIL PROTECTED] - To unsubscribe from this list: send the line unsubscribe netdev in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html