Re: [PATCH 2/2] tulip: hardware mitigation simplify
Stephen Hemminger wrote: The hardware mitigation in tulip can be simpified. 1. The budget with new NAPI will always be less than RX_RING_SIZE because RX_RING_SIZE is 128 and weight is 16. 2. The received counter is redundunt, just use the work_done value. 3. Only one value is used from the mit_table[] Signed-off-by: Stephen Hemminger [EMAIL PROTECTED] --- This can wait for 2.6.25 --- a/drivers/net/tulip/interrupt.c 2007-12-13 09:26:35.0 -0800 +++ b/drivers/net/tulip/interrupt.c 2007-12-13 09:27:29.0 -0800 @@ -21,45 +21,6 @@ int tulip_rx_copybreak; unsigned int tulip_max_interrupt_work; -#ifdef CONFIG_TULIP_NAPI_HW_MITIGATION -#define MIT_SIZE 15 -#define MIT_TABLE 15 /* We use 0 or max */ - -static unsigned int mit_table[MIT_SIZE+1] = -{ -/* CRS11 21143 hardware Mitigation Control Interrupt -We use only RX mitigation we other techniques for -TX intr. mitigation. - - 31Cycle Size (timer control) - 30:27 TX timer in 16 * Cycle size - 26:24 TX No pkts before Int. - 23:20 RX timer in Cycle size - 19:17 RX No pkts before Int. - 16 Continues Mode (CM) -*/ - -0x0, /* IM disabled */ -0x8015, /* RX time = 1, RX pkts = 2, CM = 1 */ -0x8015, -0x8027, -0x8037, -0x8049, -0x8059, -0x8069, -0x807B, -0x808B, -0x809D, -0x80AD, -0x80BD, -0x80CF, -0x80DF, -// 0x80FF /* RX time = 16, RX pkts = 7, CM = 1 */ -0x80F1 /* RX time = 16, RX pkts = 0, CM = 1 */ -}; -#endif - - int tulip_refill_rx(struct net_device *dev) { struct tulip_private *tp = netdev_priv(dev); @@ -113,21 +74,10 @@ int tulip_poll(struct napi_struct *napi, struct net_device *dev = tp-dev; int entry = tp-cur_rx % RX_RING_SIZE; int work_done = 0; -#ifdef CONFIG_TULIP_NAPI_HW_MITIGATION - int received = 0; -#endif if (!netif_running(dev)) goto done; -#ifdef CONFIG_TULIP_NAPI_HW_MITIGATION - -/* that one buffer is needed for mit activation; or might be a - bug in the ring buffer code; check later -- JHS*/ - -if (budget =RX_RING_SIZE) budget--; -#endif - if (tulip_debug 4) printk(KERN_DEBUG In tulip_rx(), entry %d %8.8x.\n, entry, tp-rx_ring[entry].status); @@ -239,9 +189,6 @@ int tulip_poll(struct napi_struct *napi, tp-stats.rx_packets++; tp-stats.rx_bytes += pkt_len; } -#ifdef CONFIG_TULIP_NAPI_HW_MITIGATION - received++; -#endif entry = (++tp-cur_rx) % RX_RING_SIZE; if (tp-cur_rx - tp-dirty_rx RX_RING_SIZE/4) @@ -279,14 +226,14 @@ done: ON: More then 1 pkt received (per intr.) OR we are dropping OFF: Only 1 pkt received - Note. We only use min and max (0, 15) settings from mit_table */ - + Note. We only use max or min values for mit */ if( tp-flags HAS_INTR_MITIGATION) { - if( received 1 ) { + if( work_done 1 ) { if( ! tp-mit_on ) { tp-mit_on = 1; - iowrite32(mit_table[MIT_TABLE], tp-base_addr + CSR11); +/* RX time = 16, RX pkts = 0, CM = 1 */ + iowrite32(0x80F1, tp-base_addr + CSR11); I think it's disappointing to eliminate mit_table[], because that can be modified easily in the current setup -- 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
Re: [PATCH 2/2] tulip: hardware mitigation simplify
Jeff Garzik wrote: Stephen Hemminger wrote: The hardware mitigation in tulip can be simpified. 1. The budget with new NAPI will always be less than RX_RING_SIZE because RX_RING_SIZE is 128 and weight is 16. 2. The received counter is redundunt, just use the work_done value. 3. Only one value is used from the mit_table[] Signed-off-by: Stephen Hemminger [EMAIL PROTECTED] grrr. Mozilla Thunderbird is annoying. Please help me out, and --don't-- reply to [EMAIL PROTECTED] T-bird's multi-profile stuff is fouling me up. Sorry :( Jeff -- 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 2/2] tulip: hardware mitigation simplify
The hardware mitigation in tulip can be simpified. 1. The budget with new NAPI will always be less than RX_RING_SIZE because RX_RING_SIZE is 128 and weight is 16. 2. The received counter is redundunt, just use the work_done value. 3. Only one value is used from the mit_table[] Signed-off-by: Stephen Hemminger [EMAIL PROTECTED] --- This can wait for 2.6.25 --- a/drivers/net/tulip/interrupt.c 2007-12-13 09:26:35.0 -0800 +++ b/drivers/net/tulip/interrupt.c 2007-12-13 09:27:29.0 -0800 @@ -21,45 +21,6 @@ int tulip_rx_copybreak; unsigned int tulip_max_interrupt_work; -#ifdef CONFIG_TULIP_NAPI_HW_MITIGATION -#define MIT_SIZE 15 -#define MIT_TABLE 15 /* We use 0 or max */ - -static unsigned int mit_table[MIT_SIZE+1] = -{ -/* CRS11 21143 hardware Mitigation Control Interrupt -We use only RX mitigation we other techniques for -TX intr. mitigation. - - 31Cycle Size (timer control) - 30:27 TX timer in 16 * Cycle size - 26:24 TX No pkts before Int. - 23:20 RX timer in Cycle size - 19:17 RX No pkts before Int. - 16 Continues Mode (CM) -*/ - -0x0, /* IM disabled */ -0x8015, /* RX time = 1, RX pkts = 2, CM = 1 */ -0x8015, -0x8027, -0x8037, -0x8049, -0x8059, -0x8069, -0x807B, -0x808B, -0x809D, -0x80AD, -0x80BD, -0x80CF, -0x80DF, -// 0x80FF /* RX time = 16, RX pkts = 7, CM = 1 */ -0x80F1 /* RX time = 16, RX pkts = 0, CM = 1 */ -}; -#endif - - int tulip_refill_rx(struct net_device *dev) { struct tulip_private *tp = netdev_priv(dev); @@ -113,21 +74,10 @@ int tulip_poll(struct napi_struct *napi, struct net_device *dev = tp-dev; int entry = tp-cur_rx % RX_RING_SIZE; int work_done = 0; -#ifdef CONFIG_TULIP_NAPI_HW_MITIGATION - int received = 0; -#endif if (!netif_running(dev)) goto done; -#ifdef CONFIG_TULIP_NAPI_HW_MITIGATION - -/* that one buffer is needed for mit activation; or might be a - bug in the ring buffer code; check later -- JHS*/ - -if (budget =RX_RING_SIZE) budget--; -#endif - if (tulip_debug 4) printk(KERN_DEBUG In tulip_rx(), entry %d %8.8x.\n, entry, tp-rx_ring[entry].status); @@ -239,9 +189,6 @@ int tulip_poll(struct napi_struct *napi, tp-stats.rx_packets++; tp-stats.rx_bytes += pkt_len; } -#ifdef CONFIG_TULIP_NAPI_HW_MITIGATION - received++; -#endif entry = (++tp-cur_rx) % RX_RING_SIZE; if (tp-cur_rx - tp-dirty_rx RX_RING_SIZE/4) @@ -279,14 +226,14 @@ done: ON: More then 1 pkt received (per intr.) OR we are dropping OFF: Only 1 pkt received - Note. We only use min and max (0, 15) settings from mit_table */ - + Note. We only use max or min values for mit */ if( tp-flags HAS_INTR_MITIGATION) { - if( received 1 ) { + if( work_done 1 ) { if( ! tp-mit_on ) { tp-mit_on = 1; - iowrite32(mit_table[MIT_TABLE], tp-base_addr + CSR11); +/* RX time = 16, RX pkts = 0, CM = 1 */ + iowrite32(0x80F1, tp-base_addr + CSR11); } } else { -- 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