| To: | "David S. Miller" <davem@xxxxxxxxxx> |
|---|---|
| Subject: | Re: [PATCH] ethtool_ops rev 4 |
| From: | Jeff Garzik <jgarzik@xxxxxxxxx> |
| Date: | Fri, 01 Aug 2003 19:01:21 -0400 |
| Cc: | willy@xxxxxxxxxx, netdev@xxxxxxxxxxx |
| In-reply-to: | <20030801153255.204baf66.davem@redhat.com> |
| Organization: | none |
| References: | <20030801150232.GV22222@parcelfarce.linux.theplanet.co.uk> <20030801154021.GA7696@gtf.org> <20030801154656.GW22222@parcelfarce.linux.theplanet.co.uk> <20030801162536.GA18574@gtf.org> <20030801132037.3f3542ae.davem@redhat.com> <3F2AE91D.5090705@pobox.com> <20030801153255.204baf66.davem@redhat.com> |
| Sender: | netdev-bounce@xxxxxxxxxxx |
| User-agent: | Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.2.1) Gecko/20021213 Debian/1.2.1-2.bunk |
David S. Miller wrote:
On Fri, 01 Aug 2003 18:26:37 -0400 Jeff Garzik <jgarzik@xxxxxxxxx> wrote: Not correct: there is nothing unused, there are no warnings, in either the in-kernel case or the older-kernel case. Look at kcompat. That is code that is working, and producing the 2.4/2.6-ready vendor drivers I spoke of. I'm apparently not communicating the design that exists in kcompat, if you think this. The design is: code for 2.6, and it magically works in 2.4 It's a back-compat system that is so good you don't even know it's there. It's completely invisible to the mainline kernel -- as it should be -- presuming that one pays attention to subtle API change effects. Do you see yet how there is no code duplication, no ifdefs, no warnings about unused functions? That is the key point of the whole design, and key to the thread of discussion here. You can't get rid of the duplicated code without accepting that you will have seperate 2.6.x and 2.4.x strains of your driver.
the few things that is not easily work-around-able is new additions to existing structures (which wouldn't exist in older kernels). That's what SET_ETHTOOL_OPS would wrap, while also providing a trigger for generic compat glue.
The back-compat form of SET_ETHTOOL_OPS registers the ethtool_ops pointer in storage for later use. A DO_ETHTOOL_OPS macro in the driver's ->do_ioctl -- intentionally not included in the kernel -- does the rest, calling kcompat's backported net/core/ethtool.c, which in turn calls the ethtool_ops hooks in the driver. Making the kcompat'd net driver ready for 2.6 would then involve simply deleting one line. That's why there is no code duplication or unused driver code. Jeff |
| Previous by Date: | 2.4.21: bug report for tg3: tx lockup when changing MTU, Ben Greear |
|---|---|
| Next by Date: | Re: [PATCH] ethtool_ops rev 4, David S. Miller |
| Previous by Thread: | Re: [PATCH] ethtool_ops rev 4, David S. Miller |
| Next by Thread: | Re: [PATCH] ethtool_ops rev 4, David S. Miller |
| Indexes: | [Date] [Thread] [Top] [All Lists] |