public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Jeff Garzik <jgarzik@mandrakesoft.com>
To: Benjamin LaHaise <bcrl@redhat.com>
Cc: "David S. Miller" <davem@redhat.com>,
	whitney@math.berkeley.edu, rgooch@ras.ucalgary.ca,
	linux-kernel@vger.kernel.org, marcelo@conectiva.com.br
Subject: Re: [patch] ns83820 0.17 (Re: Broadcom 5700/5701 Gigabit Ethernet Adapters)
Date: Thu, 14 Mar 2002 20:02:14 -0500	[thread overview]
Message-ID: <3C914816.1010707@mandrakesoft.com> (raw)
In-Reply-To: <200203110205.g2B25Ar05044@adsl-209-76-109-63.dsl.snfc21.pacbell.net> <20020310.180456.91344522.davem@redhat.com> <20020310212210.A27870@redhat.com> <20020310.183033.67792009.davem@redhat.com> <20020312004036.A3441@redhat.com> <3C90733B.4020205@mandrakesoft.com> <20020314153711.D9194@redhat.com>

Benjamin LaHaise wrote:

>>3) Seeing "volatile" in your code.  Cruft?  volatile's meaning change in 
>>recent gcc versions implies to me that your code may need some addition 
>>rmb/wmb calls perhaps, which are getting hidden via the driver's 
>>dependency on a compiler-version-specific implementation of "volatile."
>>
>
>Paranoia during writing.  I'll reaudit.  That said, volatile behaviour 
>is not compiler version specific.
>
gcc 3.1 volatile behavior changes, so, yes, it is...

>>4) Do you really mean to allocate memory for "REAL_RX_BUF_SIZE + 16"? 
>> Why not plain old REAL_RX_BUF_SIZE?
>>
>
>The +16 is for alignment (just like the comment says).  The hardware 
>requires that rx buffers be 64 bit aligned.
>
Cool... just checking.  Both RX_BUF_SIZE and REAL_RX_BUF_SIZE are defined as
    foo + magic_number

so I wasn't sure if the alignment space was -already- accounted for, in 
the definition of RX_BUF_SIZE, thus making the addition op next to 
allocations of REAL_RX_BUF_SIZE superfluous.  But, I stand corrected, 
thanks.

>5) Random question, do you call netif_carrier_{on,off,ok} for link 
>> status manipulation?  (if not, you should...)
>
>
>Ah, api updates.  Added to the todo.
>
More than just api updates... You have a bunch of hack-y logic for when 
the link goes down and up, messing around with netif_stop_queue and 
netif_wake_queue.  That stuff will be simplified or simply go away.  The 
basic idea is, if netif_carrier_ok(dev) is not true, then the net stack 
will not be sending you any packets.  So those extra 
netif_{stop,wake}_queue calls are superflouous.

We're also about to start sending link up/down messages async-ly via 
netlink, so that's even more added value as well.

>>6) skb_mangle_for_davem is pretty gross...  curious: what sort of NIC 
>>alignment restrictions are there on rx and tx buffers (not descriptors)? 
>> None? 32-bit?  Ignore CPU alignment for a moment here...
>>
>
>tx descriptors have no alignment restriction, rx descriptors must be 
>64 bit aligned.  Someone chose not to include the transistors for a 
>barrel shifter in the rx engine.
>

Sigh :)

>>7) What are the criteria for netif_wake_queue?  If you are waking when 
>>the TX is still "mostly full" you probably generate excessive wakeups...
>>
>
>Hrm?  Currently it will do a wakeup when at least one packet (8 sg 
>descriptors) can be sent.  Given that the tx done code is only called 
>when a tx desc (every 1/4 or so of the tx queue) or txidle interrupt 
>occurs, it shouldn't be that often.
>

Cool.  As FYI (_not_ advice on your driver), here's the logic I was 
referring to:

    dev->hard_start_xmit()
        if (free slots < MAX_SKB_FRAGS)
            BUG()
        queue packet
        if (free slots < MAX_SKB_FRAGS)
            netif_stop_queue(dev)

    foo_interrupt()
        if (some tx interrupt)
            complete as many TX's as possible
            if (netif_queue_stopped && (free slots > (TX_RING_SIZE / 4)))
                netif_wake_queue(dev)

But as long as your TX interrupts are well mitigated (and it sounds like 
they are), you can get by with your current scheme just fine.

    Jeff





  reply	other threads:[~2002-03-15  1:02 UTC|newest]

Thread overview: 58+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-02-15 12:58 Broadcom 5700/5701 Gigabit Ethernet Adapters Frank Elsner
2002-02-15 13:06 ` Jeff Garzik
2002-02-15 14:36   ` Thomas Langås
2002-02-15 14:45     ` Jeff Garzik
2002-02-15 14:55       ` Thomas Langås
2002-02-15 15:00         ` Jeff Garzik
2002-02-15 15:36           ` Thomas Langås
2002-02-15 20:20     ` David S. Miller
2002-02-19  0:18       ` Thomas Langås
2002-02-15 15:03   ` Jason Lunz
2002-02-26 20:09     ` Jes Sorensen
2002-02-15 14:43 ` J Sloan
2002-02-27 14:12   ` Stephan von Krawczynski
2002-03-10 15:33     ` Harald Welte
2002-03-10 19:10       ` Jeff Garzik
2002-03-10 21:35         ` Harald Welte
2002-03-11  0:41       ` David S. Miller
2002-03-11  0:55         ` Richard Gooch
2002-03-11  1:03           ` David S. Miller
2002-03-11  1:14             ` Richard Gooch
2002-03-11  1:31               ` David S. Miller
2002-03-11  1:31               ` Jeff Garzik
2002-03-11  2:05               ` Wayne Whitney
2002-03-11  2:04                 ` David S. Miller
2002-03-11  2:10                   ` Richard Gooch
2002-03-11  2:15                     ` David S. Miller
2002-03-11  2:22                   ` Benjamin LaHaise
2002-03-11  2:28                     ` Mike Fedyk
2002-03-11  2:32                       ` David S. Miller
2002-03-11  2:30                     ` David S. Miller
2002-03-11  3:15                       ` Benjamin LaHaise
2002-03-11  4:20                         ` Michael Clark
2002-03-11  4:28                           ` Benjamin LaHaise
2002-03-11 19:48                       ` Richard Gooch
2002-03-12  6:04                         ` David S. Miller
2002-03-12  6:20                           ` Richard Gooch
2002-03-12  5:40                       ` [patch] ns83820 0.17 (Re: Broadcom 5700/5701 Gigabit Ethernet Adapters) Benjamin LaHaise
2002-03-12 11:00                         ` Michael Clark
2002-03-12 11:15                           ` [patch] ns83820 0.17 David S. Miller
2002-03-12 13:03                             ` dean gaudet
2002-03-12 13:03                               ` David S. Miller
2002-03-12 18:12                             ` Trever L. Adams
2002-03-12 18:17                               ` David S. Miller
2002-03-12 18:31                                 ` Trever L. Adams
2002-03-12 19:52                                 ` pjd
2002-03-12 19:06                               ` Charles Cazabon
2002-03-12 19:39                               ` Pedro M. Rodrigues
2002-03-14  9:54                         ` [patch] ns83820 0.17 (Re: Broadcom 5700/5701 Gigabit Ethernet Adapters) Jeff Garzik
2002-03-14 20:37                           ` Benjamin LaHaise
2002-03-15  1:02                             ` Jeff Garzik [this message]
2002-03-15  8:56                             ` Daniel Phillips
2002-04-08  5:14                         ` Richard Gooch
2002-03-11  2:04             ` Broadcom 5700/5701 Gigabit Ethernet Adapters Ben Collins
2002-03-11  2:13               ` David S. Miller
2002-03-11  2:22                 ` Ben Collins
2002-03-11  2:31                   ` David S. Miller
2002-03-21 20:39             ` Thomas Langås
2002-03-11  6:07         ` Harald Welte

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=3C914816.1010707@mandrakesoft.com \
    --to=jgarzik@mandrakesoft.com \
    --cc=bcrl@redhat.com \
    --cc=davem@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marcelo@conectiva.com.br \
    --cc=rgooch@ras.ucalgary.ca \
    --cc=whitney@math.berkeley.edu \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox