Commit 1d58df4b authored by Jeff Garzik's avatar Jeff Garzik

Merge redhat.com:/spare/repo/linux-2.5

into redhat.com:/spare/repo/netdev-2.6/tulip
parents 0010bc50 437e374d
...@@ -68,6 +68,26 @@ config TULIP_MMIO ...@@ -68,6 +68,26 @@ config TULIP_MMIO
obscure bugs if your mainboard has memory controller timing issues. obscure bugs if your mainboard has memory controller timing issues.
If in doubt, say N. If in doubt, say N.
config TULIP_NAPI
bool "Use NAPI RX polling "
depends on TULIP
---help---
This is of useful for servers and routers dealing with high network loads.
See <file:Documentation/networking/NAPI_HOWTO.txt>.
If in doubt, say N.
config TULIP_NAPI_HW_MITIGATION
bool "Use Interrupt Mitigation "
depends on TULIP_NAPI
---help---
Use HW to reduce RX interrupts. Not strict necessary since NAPI reduces
RX interrupts but itself. Although this reduces RX interrupts even at
low levels traffic at the cost of a small latency.
If in doubt, say Y.
config DE4X5 config DE4X5
tristate "Generic DECchip & DIGITAL EtherWORKS PCI/EISA" tristate "Generic DECchip & DIGITAL EtherWORKS PCI/EISA"
depends on NET_TULIP && (PCI || EISA) depends on NET_TULIP && (PCI || EISA)
......
This diff is collapsed.
...@@ -126,6 +126,7 @@ enum pci_cfg_driver_reg { ...@@ -126,6 +126,7 @@ enum pci_cfg_driver_reg {
CFDD_Snooze = (1 << 30), CFDD_Snooze = (1 << 30),
}; };
#define RxPollInt (RxIntr|RxNoBuf|RxDied|RxJabber)
/* The bits in the CSR5 status registers, mostly interrupt sources. */ /* The bits in the CSR5 status registers, mostly interrupt sources. */
enum status_bits { enum status_bits {
...@@ -251,9 +252,9 @@ enum t21143_csr6_bits { ...@@ -251,9 +252,9 @@ enum t21143_csr6_bits {
Making the Tx ring too large decreases the effectiveness of channel Making the Tx ring too large decreases the effectiveness of channel
bonding and packet priority. bonding and packet priority.
There are no ill effects from too-large receive rings. */ There are no ill effects from too-large receive rings. */
#define TX_RING_SIZE 16
#define RX_RING_SIZE 32
#define TX_RING_SIZE 32
#define RX_RING_SIZE 128
#define MEDIA_MASK 31 #define MEDIA_MASK 31
#define PKT_BUF_SZ 1536 /* Size of each temporary Rx buffer. */ #define PKT_BUF_SZ 1536 /* Size of each temporary Rx buffer. */
...@@ -343,17 +344,15 @@ struct tulip_private { ...@@ -343,17 +344,15 @@ struct tulip_private {
int flags; int flags;
struct net_device_stats stats; struct net_device_stats stats;
struct timer_list timer; /* Media selection timer. */ struct timer_list timer; /* Media selection timer. */
struct timer_list oom_timer; /* Out of memory timer. */
u32 mc_filter[2]; u32 mc_filter[2];
spinlock_t lock; spinlock_t lock;
spinlock_t mii_lock; spinlock_t mii_lock;
unsigned int cur_rx, cur_tx; /* The next free ring entry */ unsigned int cur_rx, cur_tx; /* The next free ring entry */
unsigned int dirty_rx, dirty_tx; /* The ring entries to be free()ed. */ unsigned int dirty_rx, dirty_tx; /* The ring entries to be free()ed. */
#ifdef CONFIG_NET_HW_FLOWCONTROL #ifdef CONFIG_TULIP_NAPI_HW_MITIGATION
#define RX_A_NBF_STOP 0xffffff3f /* To disable RX and RX-NOBUF ints. */ int mit_on;
int fc_bit;
int mit_sel;
int mit_change; /* Signal for Interrupt Mitigtion */
#endif #endif
unsigned int full_duplex:1; /* Full-duplex operation requested. */ unsigned int full_duplex:1; /* Full-duplex operation requested. */
unsigned int full_duplex_lock:1; unsigned int full_duplex_lock:1;
...@@ -415,6 +414,10 @@ extern unsigned int tulip_max_interrupt_work; ...@@ -415,6 +414,10 @@ extern unsigned int tulip_max_interrupt_work;
extern int tulip_rx_copybreak; extern int tulip_rx_copybreak;
irqreturn_t tulip_interrupt(int irq, void *dev_instance, struct pt_regs *regs); irqreturn_t tulip_interrupt(int irq, void *dev_instance, struct pt_regs *regs);
int tulip_refill_rx(struct net_device *dev); int tulip_refill_rx(struct net_device *dev);
#ifdef CONFIG_TULIP_NAPI
int tulip_poll(struct net_device *dev, int *budget);
#endif
/* media.c */ /* media.c */
int tulip_mdio_read(struct net_device *dev, int phy_id, int location); int tulip_mdio_read(struct net_device *dev, int phy_id, int location);
...@@ -438,6 +441,7 @@ extern int tulip_debug; ...@@ -438,6 +441,7 @@ extern int tulip_debug;
extern const char * const medianame[]; extern const char * const medianame[];
extern const char tulip_media_cap[]; extern const char tulip_media_cap[];
extern struct tulip_chip_table tulip_tbl[]; extern struct tulip_chip_table tulip_tbl[];
void oom_timer(unsigned long data);
extern u8 t21040_csr13[]; extern u8 t21040_csr13[];
#ifndef USE_IO_OPS #ifndef USE_IO_OPS
......
...@@ -14,11 +14,17 @@ ...@@ -14,11 +14,17 @@
*/ */
#include <linux/config.h>
#define DRV_NAME "tulip" #define DRV_NAME "tulip"
#ifdef CONFIG_TULIP_NAPI
#define DRV_VERSION "1.1.13-NAPI" /* Keep at least for test */
#else
#define DRV_VERSION "1.1.13" #define DRV_VERSION "1.1.13"
#endif
#define DRV_RELDATE "May 11, 2002" #define DRV_RELDATE "May 11, 2002"
#include <linux/config.h>
#include <linux/module.h> #include <linux/module.h>
#include "tulip.h" #include "tulip.h"
#include <linux/pci.h> #include <linux/pci.h>
...@@ -466,29 +472,16 @@ static void tulip_up(struct net_device *dev) ...@@ -466,29 +472,16 @@ static void tulip_up(struct net_device *dev)
to an alternate media type. */ to an alternate media type. */
tp->timer.expires = RUN_AT(next_tick); tp->timer.expires = RUN_AT(next_tick);
add_timer(&tp->timer); add_timer(&tp->timer);
} #ifdef CONFIG_TULIP_NAPI
init_timer(&tp->oom_timer);
#ifdef CONFIG_NET_HW_FLOWCONTROL tp->oom_timer.data = (unsigned long)dev;
/* Enable receiver */ tp->oom_timer.function = oom_timer;
void tulip_xon(struct net_device *dev)
{
struct tulip_private *tp = (struct tulip_private *)dev->priv;
clear_bit(tp->fc_bit, &netdev_fc_xoff);
if (netif_running(dev)){
tulip_refill_rx(dev);
outl(tulip_tbl[tp->chip_id].valid_intrs, dev->base_addr+CSR7);
}
}
#endif #endif
}
static int static int
tulip_open(struct net_device *dev) tulip_open(struct net_device *dev)
{ {
#ifdef CONFIG_NET_HW_FLOWCONTROL
struct tulip_private *tp = (struct tulip_private *)dev->priv;
#endif
int retval; int retval;
if ((retval = request_irq(dev->irq, &tulip_interrupt, SA_SHIRQ, dev->name, dev))) if ((retval = request_irq(dev->irq, &tulip_interrupt, SA_SHIRQ, dev->name, dev)))
...@@ -498,10 +491,6 @@ tulip_open(struct net_device *dev) ...@@ -498,10 +491,6 @@ tulip_open(struct net_device *dev)
tulip_up (dev); tulip_up (dev);
#ifdef CONFIG_NET_HW_FLOWCONTROL
tp->fc_bit = netdev_register_fc(dev, tulip_xon);
#endif
netif_start_queue (dev); netif_start_queue (dev);
return 0; return 0;
...@@ -582,10 +571,7 @@ static void tulip_tx_timeout(struct net_device *dev) ...@@ -582,10 +571,7 @@ static void tulip_tx_timeout(struct net_device *dev)
#endif #endif
/* Stop and restart the chip's Tx processes . */ /* Stop and restart the chip's Tx processes . */
#ifdef CONFIG_NET_HW_FLOWCONTROL
if (tp->fc_bit && test_bit(tp->fc_bit,&netdev_fc_xoff))
printk("BUG tx_timeout restarting rx when fc on\n");
#endif
tulip_restart_rxtx(tp); tulip_restart_rxtx(tp);
/* Trigger an immediate transmit demand. */ /* Trigger an immediate transmit demand. */
outl(0, ioaddr + CSR1); outl(0, ioaddr + CSR1);
...@@ -742,7 +728,9 @@ static void tulip_down (struct net_device *dev) ...@@ -742,7 +728,9 @@ static void tulip_down (struct net_device *dev)
unsigned long flags; unsigned long flags;
del_timer_sync (&tp->timer); del_timer_sync (&tp->timer);
#ifdef CONFIG_TULIP_NAPI
del_timer_sync (&tp->oom_timer);
#endif
spin_lock_irqsave (&tp->lock, flags); spin_lock_irqsave (&tp->lock, flags);
/* Disable interrupts by clearing the interrupt mask. */ /* Disable interrupts by clearing the interrupt mask. */
...@@ -781,13 +769,6 @@ static int tulip_close (struct net_device *dev) ...@@ -781,13 +769,6 @@ static int tulip_close (struct net_device *dev)
netif_stop_queue (dev); netif_stop_queue (dev);
#ifdef CONFIG_NET_HW_FLOWCONTROL
if (tp->fc_bit) {
int bit = tp->fc_bit;
tp->fc_bit = 0;
netdev_unregister_fc(bit);
}
#endif
tulip_down (dev); tulip_down (dev);
if (tulip_debug > 1) if (tulip_debug > 1)
...@@ -1629,6 +1610,10 @@ static int __devinit tulip_init_one (struct pci_dev *pdev, ...@@ -1629,6 +1610,10 @@ static int __devinit tulip_init_one (struct pci_dev *pdev,
dev->hard_start_xmit = tulip_start_xmit; dev->hard_start_xmit = tulip_start_xmit;
dev->tx_timeout = tulip_tx_timeout; dev->tx_timeout = tulip_tx_timeout;
dev->watchdog_timeo = TX_TIMEOUT; dev->watchdog_timeo = TX_TIMEOUT;
#ifdef CONFIG_TULIP_NAPI
dev->poll = tulip_poll;
dev->weight = 16;
#endif
dev->stop = tulip_close; dev->stop = tulip_close;
dev->get_stats = tulip_get_stats; dev->get_stats = tulip_get_stats;
dev->do_ioctl = private_ioctl; dev->do_ioctl = private_ioctl;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment