netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Kok, Auke" <auke-jan.h.kok@intel.com>
To: Jeff Garzik <jeff@garzik.org>
Cc: netdev@vger.kernel.org, Andrew Morton <akpm@linux-foundation.org>,
	Jason Lunz <lunz@reflexsecurity.com>,
	Mark McLoughlin <markmc@redhat.com>,
	e1000-devel@lists.sourceforge.net,
	Arjan van de Ven <arjan@linux.intel.com>,
	"Ronciak, John" <john.ronciak@intel.com>
Subject: Re: RFR: New e1000 driver (e1000new), was: Re: e1000: backport ich9 support from 7.5.5 ?
Date: Fri, 06 Jul 2007 17:13:56 -0700	[thread overview]
Message-ID: <468EDAC4.8070300@intel.com> (raw)
In-Reply-To: <468E92F8.7010501@garzik.org>

Jeff Garzik wrote:
> OK, just looked through the driver.  I think its structured inside-out 
> from what it should be.
> 
> Comments:
> 
> * is a clear improvement from current e1000
> 
> * The multitude of tiny, fine-grained operations for MAC, NVM, PHY, etc. 
> is a signal that organization is backwards.  You should be creating 
> hardware-specific high level operations (PHY layer hooks, net_device 
> hooks, interrupt handler) that call out to more-generic functions when 
> necessary.  Doing so eliminates the need to create a new hook for every 
> little twirl in the code path.
> 
> In the long run, a driver is easier to maintain if you can easily follow 
> the code path for a particular hardware generation.  Creating 
> e1001_8257x_do_this_thing(), which calls more generic code as needed, is 
> easier to review and doesn't require all sorts of indirection through APIs.
> 
> Doing so also means that many workarounds for older hardware "disappear" 
> from the most-travelled code paths over time.  The 64k boundary check 
> found in e1000new is an easy example of something that really shouldn't 
> pollute newer code at all [yes, even though it reduces to 'return 1' for 
> most].

are you talking about the internals of e1000_phy/mac/nvm etc? i agree that the 
amount of forward/backward mapping in here is a bit of a spaghetti and could be 
more clear

> * The multitude of files makes it difficult to review.  Much easier in 
> one file, or a small few.

well, at least the files are reasonably well structured by topic. Combining 
small files just to make reviewing easier seems strange to me, besides making it 
easier to jump around in an editor it doesn't add any value to the code 
organization, and just encourages more forward declarations and horrible 
ordering issues.

> * bitfields

consider these gone ;)

> * check for PCI DMA mapping failure

*draws blank* specific one? I'm not seeing what you mean here

> * atomic_t irq_sem is reinventing the wheel (and too heavy for you 
> needs, too?).  You might as well use a lock or mutex or whatnot at that 
> point, since you are using a locked instruction.  tg3 might also have 
> some hints in this regard.

absolutely, I really don't like irq_sem and several people insist even that it 
can be removed (allthough I've demonstrated that plain removing it actually 
breaks on pci-e adapters). I had left it in since it currently works fine, but 
it's high on my list to fix.

> * like I noted in the last email, the quickest path to upstream is to 
> start SMALL.  Create the smallest working driver, review it heavily, get 
> it upstream.  Add all hardware&features after that.

In this line, I will try to drop things like multiqueue from it completely to 
avoid making it over-complex (and not used at all right now), as is the case in 
a lot of points right now.

Thanks for reviewing.

Auke

  reply	other threads:[~2007-07-07  0:14 UTC|newest]

Thread overview: 67+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-06-29 17:29 e1000: backport ich9 support from 7.5.5 ? Mark McLoughlin
2007-06-29 17:50 ` Jason Lunz
2007-06-29 19:51   ` Kok, Auke
2007-06-29 20:22     ` Jason Lunz
2007-06-29 20:59     ` Jeff Garzik
2007-06-30 21:24     ` Mark McLoughlin
2007-07-02 23:52       ` Williams, Mitch A
2007-07-03  0:10         ` Rick Jones
2007-07-03  0:55           ` Jason Lunz
2007-07-03  1:44             ` Kok, Auke
2007-07-03  7:15         ` Christoph Hellwig
2007-07-03 13:13           ` [E1000-devel] " Jeff Garzik
2007-06-29 20:55   ` Jeff Garzik
2007-06-29 21:39     ` Kok, Auke
2007-06-29 22:03       ` Andrew Morton
2007-06-29 22:11         ` Jeff Garzik
2007-06-29 23:24           ` RFR: New e1000 driver (e1000new), was: " Kok, Auke
2007-06-29 23:38             ` Arjan van de Ven
2007-07-08 18:20               ` Jeff Garzik
2007-07-08 20:14                 ` Arjan van de Ven
2007-07-08 22:01                   ` [E1000-devel] " Jonathan Lundell
2007-06-30  3:32             ` Roland Dreier
2007-07-08 18:20               ` Jeff Garzik
2007-07-06 19:07             ` Jeff Garzik
2007-07-07  0:13               ` Kok, Auke [this message]
2007-07-07 12:23                 ` James Chapman
2007-07-08 18:41                   ` James Chapman
2007-07-07 18:59               ` Andrew Grover
2007-06-29 23:57           ` Andrew Grover
2007-06-30  0:02             ` Andrew Grover
2007-06-30  0:09             ` Jeff Garzik
2007-06-30  1:29               ` Jim McCullough
2007-06-30  1:31                 ` Jim McCullough
2007-06-30  2:34                 ` [E1000-devel] " Kok, Auke
2007-06-30  2:31               ` Kok, Auke
2007-06-30  8:25                 ` Christoph Hellwig
2007-07-03 22:48                   ` Splitting e1000 (Was: Re: e1000: backport ich9 support from 7.5.5 ?) Kok, Auke
2007-07-05 18:32                     ` Kok, Auke
2007-07-06  0:22                     ` Jeff Garzik
2007-07-07  0:14                       ` Kok, Auke
2007-07-07 13:58                         ` James Chapman
2007-07-07 19:04                         ` Francois Romieu
2007-07-07 21:54                           ` Kok, Auke
2007-07-08  1:32                             ` Stephen Hemminger
2007-07-08 10:07                               ` James Chapman
2007-07-08 16:29                               ` Arjan van de Ven
2007-07-08 18:06                                 ` Jeff Garzik
2007-07-08 19:24                                   ` Andrew Grover
2007-07-09 17:56                                     ` Jeff Garzik
2007-07-08 20:05                                   ` Arjan van de Ven
2007-07-09 18:39                                     ` Jeff Garzik
2007-07-09 18:46                                       ` Stephen Hemminger
2007-07-09 19:36                                       ` Arjan van de Ven
2007-07-09 20:46                                       ` Kok, Auke
2007-07-09 22:26                                         ` Jeff Garzik
2007-07-13 21:45                                           ` Kok, Auke
2007-07-13 22:08                                             ` Jeff Garzik
2007-07-13 22:13                                               ` Kok, Auke
2007-07-08 18:08                               ` Jeff Garzik
2007-07-08 17:41                         ` Jeff Garzik
2007-06-30 14:31                 ` e1000: backport ich9 support from 7.5.5 ? James Chapman
2007-06-30 16:29                   ` Kok, Auke
2007-07-01 10:45                     ` James Chapman
2007-06-30  8:26             ` Christoph Hellwig
2007-06-29 22:16         ` Kok, Auke
2007-06-29 22:07       ` Jeff Garzik
2007-06-29 21:39   ` Andy Gospodarek

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=468EDAC4.8070300@intel.com \
    --to=auke-jan.h.kok@intel.com \
    --cc=akpm@linux-foundation.org \
    --cc=arjan@linux.intel.com \
    --cc=e1000-devel@lists.sourceforge.net \
    --cc=jeff@garzik.org \
    --cc=john.ronciak@intel.com \
    --cc=lunz@reflexsecurity.com \
    --cc=markmc@redhat.com \
    --cc=netdev@vger.kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).