From: Manfred Spraul <manfred@colorfullife.com>
To: Jeff Garzik <jgarzik@pobox.com>
Cc: linux-kernel@vger.kernel.org, netdev@oss.sgi.com
Subject: Re: [PATCH] Gigabit Ethernet support for forcedeth
Date: Wed, 30 Jun 2004 20:55:35 +0200 [thread overview]
Message-ID: <40E30CA7.3020209@colorfullife.com> (raw)
In-Reply-To: <40E2E618.5020601@colorfullife.com>
[-- Attachment #1: Type: text/plain, Size: 576 bytes --]
Manfred Spraul wrote:
>>
>> your driver needs to call pci_set_dma_mask() and
>> pci_set_consistent_dma_mask().
>>
> I'll add that.
>
I've checked the pci layer: 32-bit is the default, thus no calls are
required. What's missing is error handling for pci_map, I'll add that later.
Attached is an incremental patch that fixes the simple issues you
mentioned. Could you merge both patches together to your tree? They
improve the driver significantly and I want some test input from users.
I've added message flags and pci_map error handling to my todo list.
--
Manfred
[-- Attachment #2: patch-forced-candidate-inc --]
[-- Type: text/plain, Size: 2436 bytes --]
// $Header$
// Kernel Version:
// VERSION = 2
// PATCHLEVEL = 6
// SUBLEVEL = 7
// EXTRAVERSION = -mm2
--- 2.6/drivers/net/forcedeth.c 2004-06-30 18:45:23.000000000 +0200
+++ build-2.6/drivers/net/forcedeth.c 2004-06-30 18:45:05.000000000 +0200
@@ -348,18 +348,22 @@ struct ring_desc {
/* General driver defaults */
#define NV_WATCHDOG_TIMEO (5*HZ)
-#define DEFAULT_MTU 1500 /* also maximum supported, at least for now */
#define RX_RING 128
#define TX_RING 64
-/* limited to 1 packet until we understand NV_TX_LASTPACKET */
+/*
+ * If your nic mysteriously hangs then try to reduce the limits
+ * to 1/0: It might be required to set NV_TX_LASTPACKET in the
+ * last valid ring entry. But this would be impossible to
+ * implement - probably a disassembly error.
+ */
#define TX_LIMIT_STOP 63
#define TX_LIMIT_START 62
/* rx/tx mac addr + type + vlan + align + slack*/
-#define RX_NIC_BUFSIZE (DEFAULT_MTU + 64)
+#define RX_NIC_BUFSIZE (ETH_DATA_LEN + 64)
/* even more slack */
-#define RX_ALLOC_BUFSIZE (DEFAULT_MTU + 128)
+#define RX_ALLOC_BUFSIZE (ETH_DATA_LEN + 128)
#define OOM_REFILL (1+HZ/20)
#define POLL_WAIT (1+HZ/100)
@@ -988,7 +992,7 @@ static void nv_tx_done(struct net_device
while (np->nic_tx != np->next_tx) {
i = np->nic_tx % TX_RING;
- Flags = cpu_to_le32(np->tx_ring[i].FlagLen);
+ Flags = le32_to_cpu(np->tx_ring[i].FlagLen);
dprintk(KERN_DEBUG "%s: nv_tx_done: looking at packet %d, Flags 0x%x.\n",
dev->name, np->nic_tx, Flags);
@@ -1077,7 +1081,7 @@ static void nv_rx_process(struct net_dev
break; /* we scanned the whole ring - do not continue */
i = np->cur_rx % RX_RING;
- Flags = cpu_to_le32(np->rx_ring[i].FlagLen);
+ Flags = le32_to_cpu(np->rx_ring[i].FlagLen);
len = nv_descr_getlength(&np->rx_ring[i], np->desc_ver);
dprintk(KERN_DEBUG "%s: nv_rx_process: looking at packet %d, Flags 0x%x.\n",
@@ -1193,7 +1197,7 @@ next_pkt:
*/
static int nv_change_mtu(struct net_device *dev, int new_mtu)
{
- if (new_mtu > DEFAULT_MTU)
+ if (new_mtu > ETH_DATA_LEN)
return -EINVAL;
dev->mtu = new_mtu;
return 0;
@@ -1999,7 +2003,7 @@ static void __exit exit_nic(void)
pci_unregister_driver(&driver);
}
-MODULE_PARM(max_interrupt_work, "i");
+module_param(max_interrupt_work, int, 0);
MODULE_PARM_DESC(max_interrupt_work, "forcedeth maximum events handled per interrupt");
MODULE_AUTHOR("Manfred Spraul <manfred@colorfullife.com>");
next prev parent reply other threads:[~2004-06-30 18:59 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-06-30 5:44 [PATCH] Gigabit Ethernet support for forcedeth Manfred Spraul
2004-06-30 6:10 ` Jeff Garzik
2004-06-30 16:11 ` Manfred Spraul
2004-06-30 18:55 ` Manfred Spraul [this message]
2004-07-02 15:51 ` Jeff Garzik
2004-07-02 19:29 ` Manfred Spraul
2004-07-03 6:17 ` Jeff Garzik
2004-07-04 18:27 ` Pavel Machek
-- strict thread matches above, loose matches on Subject: below --
2004-07-30 10:04 Tim Waugh
[not found] ` <410A4A1C.4040608@colorfullife.com>
2004-07-30 16:20 ` Tim Waugh
2004-07-30 16:52 ` Manfred Spraul
2004-07-30 17:16 ` Tim Waugh
2004-07-30 17:29 ` Manfred Spraul
2004-08-02 11:51 ` Tim Waugh
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=40E30CA7.3020209@colorfullife.com \
--to=manfred@colorfullife.com \
--cc=jgarzik@pobox.com \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@oss.sgi.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.