netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: James Chapman <jchapman@katalix.com>
To: "Kok, Auke" <auke-jan.h.kok@intel.com>
Cc: Mark McLoughlin <markmc@redhat.com>,
	Jeff Garzik <jeff@garzik.org>,
	e1000-devel@lists.sourceforge.net, netdev@vger.kernel.org,
	Andrew Grover <andy.grover@gmail.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Jason Lunz <lunz@reflexsecurity.com>
Subject: Re: e1000: backport ich9 support from 7.5.5 ?
Date: Sun, 01 Jul 2007 11:45:53 +0100	[thread overview]
Message-ID: <468785E1.7050801@katalix.com> (raw)
In-Reply-To: <468684E1.6080901@intel.com>

Kok, Auke wrote:
> James Chapman wrote:
>> I briefly looked over your new driver. I think it might benefit by 
>> moving common parts into one or more libraries (or modules) and have 
>> separate chip-specific drivers for 82540, 82541, 82542, 82543, 82571 
>> etc. Put all the chip-specific bits in a chip-specific driver and have 
>> each driver call into the common (shared) code. The device 
>> probe/init/remove would be done by the chip-specific code, not the 
>> common code like it is now. When built as a module, the chip-specific 
>> parts and the common parts could be built as separate modules; 
>> modprobe would load the common parts automatically. Most of the code 
>> would be in the common part since these chips are very similar.
> 
> splitting beyond the obvious does not make any sense and will just add 
> confusion.

Users wouldn't need to know which driver to load - the right driver 
would be loaded automatically. Distros would ship all of them (and the 
common bits). The few users who know which device(s) they have could 
build only the required drivers if they wanted to do so.

> I'm not against a pcie/pre-pcie split or even going a step 
> further and looking into using PHYlib as you suggest below, but we 
> should really avoid trying to create an unmaintainable mess where we 
> have to patch 7 drivers for each generic issue we find.

The generic issues would be in the common part so would be patched once.

Looking at your new driver code, there are separate source files for the 
5 chips I mention, hence my leaning towards a driver per device. I 
counted 24 funcptrs that are set up in order for the common code to call 
out to driver-private chip specific functions. Wouldn't most of these go 
away if the chip-specific code called common code, not the other way round?

Let me use an example to illustrate what I mean. e1000_setup_link() is 
common code. It simply calls a function pointed to by func.setup_link, 
which was initialized to a chip-specific function, e.g. 
e1000_setup_link_82543() in e1000_init_mac_params_82543(). It turns out 
that e1000_setup_link() is called by chip-specific code from 
e1000_init_hw_82543() so the abstraction through e1000_setup_link() 
wouldn't be needed for init. However, e1000_setup_link() is also called 
from the common driver/ethtool entry points e1000_open() and 
e1000_set_pause_params(). These entry points could be moved in to the 
chip specific code, calling out to common code when necessary: the 
funcptrs/abstractions wouldn't then be needed. This would obviously lead 
to some common boilerplate code in each chip specific driver for the 
driver entry points open/close etc and occasionally some common changes 
might be needed in that code. However, I'm sure most bugs will be in the 
guts of the driver, not the boilerplate code so the duplication of the 
driver boilerplate code wouldn't matter so much. I think maintenance 
effort would actually reduce with this kind of structure.

I don't want to sound negative though; it's great that you and Intel are 
putting a lot of work into this driver. You know much more about the 
actual chip feature differences/workarounds than I do so if you don't 
think the approach I suggest will work, I'm happy to just drop this thread.

-- 
James Chapman
Katalix Systems Ltd
http://www.katalix.com
Catalysts for your Embedded Linux software development



-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/

  reply	other threads:[~2007-07-01 10:45 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
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 [this message]
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=468785E1.7050801@katalix.com \
    --to=jchapman@katalix.com \
    --cc=akpm@linux-foundation.org \
    --cc=andy.grover@gmail.com \
    --cc=auke-jan.h.kok@intel.com \
    --cc=e1000-devel@lists.sourceforge.net \
    --cc=jeff@garzik.org \
    --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).