--- e100.c 2006-12-27 10:18:02.000000000 +0200 +++ e100.c 2007-01-14 18:45:01.000000000 +0200 @@ -178,7 +178,7 @@ #define PFX DRV_NAME ": " #define E100_WATCHDOG_PERIOD (2 * HZ) -#define E100_NAPI_WEIGHT 16 +#define E100_NAPI_WEIGHT 256 MODULE_DESCRIPTION(DRV_DESCRIPTION); MODULE_AUTHOR(DRV_COPYRIGHT); @@ -596,6 +596,7 @@ u16 eeprom[256]; spinlock_t mdio_lock; u32 pm_state[16]; + struct timer_list poll_timer; }; static inline void e100_write_flush(struct nic *nic) @@ -942,7 +943,7 @@ static void e100_get_defaults(struct nic *nic) { struct param_range rfds = { .min = 16, .max = 256, .count = 256 }; - struct param_range cbs = { .min = 64, .max = 256, .count = 128 }; + struct param_range cbs = { .min = 64, .max = 256, .count = 256 }; pci_read_config_byte(nic->pdev, PCI_REVISION_ID, &nic->rev_id); /* MAC type is encoded as rev ID; exception: ICH is treated as 82559 */ @@ -1962,6 +1963,12 @@ return 0; } +static void my_rx_shedule(unsigned long arg) +{ + struct net_device *netdev = (struct net_device *)arg; + __netif_rx_schedule(netdev); +} + static irqreturn_t e100_intr(int irq, void *dev_id, struct pt_regs *regs) { struct net_device *netdev = dev_id; @@ -1984,7 +1991,13 @@ #ifdef CONFIG_E100_NAPI if(likely(netif_rx_schedule_prep(netdev))) { e100_disable_irq(nic); - __netif_rx_schedule(netdev); + //__netif_rx_schedule(netdev); + //--------- + nic->poll_timer.data = (unsigned long)dev_id; + nic->poll_timer.function = my_rx_shedule; + nic->poll_timer.expires = jiffies;//next timer tick - each 1/HZ ms + add_timer(&nic->poll_timer); + //-------- } #else e100_rx_clean(nic, NULL, 0); @@ -2114,6 +2127,8 @@ e100_hw_reset(nic); free_irq(nic->pdev->irq, nic->netdev); del_timer_sync(&nic->watchdog); + //удаляем poll-таймер + del_timer(&nic->poll_timer); netif_carrier_off(nic->netdev); e100_clean_cbs(nic); e100_rx_clean_list(nic); @@ -2720,6 +2735,8 @@ netdev->dev_addr[0], netdev->dev_addr[1], netdev->dev_addr[2], netdev->dev_addr[3], netdev->dev_addr[4], netdev->dev_addr[5]); + //только в случае успеха инициализируем poll-таймер + init_timer(&nic->poll_timer); return 0; err_out_free: