From: Jeff Garzik <JGarzik@DunveganMedia•com>
To: Stephen Hemminger <shemminger@linux-foundation•org>
Cc: "David S. Miller" <davem@davemloft•net>,
Jeff Garzik <jgarzik@pobox•com>,
netdev@vger•kernel.org, kristjan <kristjan.ugrin@gmail•com>
Subject: Re: [PATCH 2/2] tulip: hardware mitigation simplify
Date: Mon, 11 Feb 2008 10:33:55 -0500 [thread overview]
Message-ID: <47B06AE3.4020809@DunveganMedia.com> (raw)
In-Reply-To: <20071213093554.5c4909ed@freepuppy.rosehill>
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 <shemminger@linux-foundation•org>
> ---
> This can wait for 2.6.25
>
> --- a/drivers/net/tulip/interrupt.c 2007-12-13 09:26:35.000000000 -0800
> +++ b/drivers/net/tulip/interrupt.c 2007-12-13 09:27:29.000000000 -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.
> -
> - 31 Cycle 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 */
> - 0x80150000, /* RX time = 1, RX pkts = 2, CM = 1 */
> - 0x80150000,
> - 0x80270000,
> - 0x80370000,
> - 0x80490000,
> - 0x80590000,
> - 0x80690000,
> - 0x807B0000,
> - 0x808B0000,
> - 0x809D0000,
> - 0x80AD0000,
> - 0x80BD0000,
> - 0x80CF0000,
> - 0x80DF0000,
> -// 0x80FF0000 /* RX time = 16, RX pkts = 7, CM = 1 */
> - 0x80F10000 /* 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(0x80F10000, tp->base_addr + CSR11);
I think it's disappointing to eliminate mit_table[], because that can be
modified easily in the current setup
next prev parent reply other threads:[~2008-02-11 15:34 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-12-13 17:35 [PATCH 2/2] tulip: hardware mitigation simplify Stephen Hemminger
2008-02-11 15:33 ` Jeff Garzik [this message]
2008-02-11 15:43 ` Jeff Garzik
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=47B06AE3.4020809@DunveganMedia.com \
--to=jgarzik@dunveganmedia$(echo .)com \
--cc=davem@davemloft$(echo .)net \
--cc=jgarzik@pobox$(echo .)com \
--cc=kristjan.ugrin@gmail$(echo .)com \
--cc=netdev@vger$(echo .)kernel.org \
--cc=shemminger@linux-foundation$(echo .)org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox