* [PATCH] Update embedded copy of ethtool.h from kernel 2.6.30
@ 2009-12-01 15:17 Jesper Nilsson
2009-12-01 15:21 ` Ben Hutchings
0 siblings, 1 reply; 5+ messages in thread
From: Jesper Nilsson @ 2009-12-01 15:17 UTC (permalink / raw)
To: Jeff Garzik, netdev
Commit 0c09c1a49cc7b819b33566a49d9901f7cfdd6889 in the Linux kernel
added a new field mdio_support inside the struct ethtool_cmd,
changing the struct size for architectures that does not pad structs.
(for example the CRIS architecture)
This size mismatch lead to the ethtool_cmd struct being written
as 44 bytes in the kernel, but only 43 bytes allocated on stack,
overwriting one byte in the stack frame.
Update the ethtool copy of the definition to match the 2.6.30 kernel.
Signed-off-by: Jesper Nilsson <jesper.nilsson@axis.com>
---
ethtool-copy.h | 7 +++++--
1 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/ethtool-copy.h b/ethtool-copy.h
index eadba25..fa92515 100644
--- a/ethtool-copy.h
+++ b/ethtool-copy.h
@@ -23,11 +23,14 @@ struct ethtool_cmd {
__u8 phy_address;
__u8 transceiver; /* Which transceiver to use */
__u8 autoneg; /* Enable or disable autonegotiation */
+ __u8 mdio_support;
__u32 maxtxpkt; /* Tx pkts before generating tx int */
__u32 maxrxpkt; /* Rx pkts before generating rx int */
__u16 speed_hi;
- __u16 reserved2;
- __u32 reserved[3];
+ __u8 eth_tp_mdix;
+ __u8 reserved2;
+ __u32 lp_advertising; /* Features the link partner advertises */
+ __u32 reserved[2];
};
static inline void ethtool_cmd_speed_set(struct ethtool_cmd *ep,
--
1.6.4.GIT
/^JN - Jesper Nilsson
--
Jesper Nilsson -- jesper.nilsson@axis.com
^ permalink raw reply related [flat|nested] 5+ messages in thread* Re: [PATCH] Update embedded copy of ethtool.h from kernel 2.6.30
2009-12-01 15:17 [PATCH] Update embedded copy of ethtool.h from kernel 2.6.30 Jesper Nilsson
@ 2009-12-01 15:21 ` Ben Hutchings
2009-12-01 15:42 ` Jesper Nilsson
0 siblings, 1 reply; 5+ messages in thread
From: Ben Hutchings @ 2009-12-01 15:21 UTC (permalink / raw)
To: Jesper Nilsson; +Cc: Jeff Garzik, netdev
On Tue, 2009-12-01 at 16:17 +0100, Jesper Nilsson wrote:
> Commit 0c09c1a49cc7b819b33566a49d9901f7cfdd6889 in the Linux kernel
> added a new field mdio_support inside the struct ethtool_cmd,
> changing the struct size for architectures that does not pad structs.
> (for example the CRIS architecture)
CRIS has no alignment requirements?! Wow. Sorry for changing the
structure, then.
> This size mismatch lead to the ethtool_cmd struct being written
> as 44 bytes in the kernel, but only 43 bytes allocated on stack,
> overwriting one byte in the stack frame.
>
> Update the ethtool copy of the definition to match the 2.6.30 kernel.
[...]
This has already been done.
Ben.
--
Ben Hutchings, Senior Software Engineer, Solarflare Communications
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] Update embedded copy of ethtool.h from kernel 2.6.30
2009-12-01 15:21 ` Ben Hutchings
@ 2009-12-01 15:42 ` Jesper Nilsson
2009-12-01 15:52 ` Ben Hutchings
0 siblings, 1 reply; 5+ messages in thread
From: Jesper Nilsson @ 2009-12-01 15:42 UTC (permalink / raw)
To: Ben Hutchings; +Cc: Jeff Garzik, netdev@vger.kernel.org
On Tue, Dec 01, 2009 at 04:21:18PM +0100, Ben Hutchings wrote:
> On Tue, 2009-12-01 at 16:17 +0100, Jesper Nilsson wrote:
> > Commit 0c09c1a49cc7b819b33566a49d9901f7cfdd6889 in the Linux kernel
> > added a new field mdio_support inside the struct ethtool_cmd,
> > changing the struct size for architectures that does not pad structs.
> > (for example the CRIS architecture)
>
> CRIS has no alignment requirements?! Wow.
Yep, we don't even have the choice of adding padding inside structs. :-(
> Sorry for changing the
> structure, then.
We're used to tripping over this kind of thing. :-)
> > This size mismatch lead to the ethtool_cmd struct being written
> > as 44 bytes in the kernel, but only 43 bytes allocated on stack,
> > overwriting one byte in the stack frame.
> >
> > Update the ethtool copy of the definition to match the 2.6.30 kernel.
> [...]
>
> This has already been done.
Ah? Could someone point me to the correct git-tree for ethtool then?
I've been using http://www.kernel.org/pub/scm/network/ethtool/ethtool.git
which still has this problem...
> Ben.
/^JN - Jesper Nilsson
--
Jesper Nilsson -- jesper.nilsson@axis.com
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [PATCH] Update embedded copy of ethtool.h from kernel 2.6.30
2009-12-01 15:42 ` Jesper Nilsson
@ 2009-12-01 15:52 ` Ben Hutchings
2009-12-01 15:54 ` Jesper Nilsson
0 siblings, 1 reply; 5+ messages in thread
From: Ben Hutchings @ 2009-12-01 15:52 UTC (permalink / raw)
To: Jesper Nilsson; +Cc: Jeff Garzik, netdev
On Tue, 2009-12-01 at 16:42 +0100, Jesper Nilsson wrote:
> On Tue, Dec 01, 2009 at 04:21:18PM +0100, Ben Hutchings wrote:
> > On Tue, 2009-12-01 at 16:17 +0100, Jesper Nilsson wrote:
[...]
> > > This size mismatch lead to the ethtool_cmd struct being written
> > > as 44 bytes in the kernel, but only 43 bytes allocated on stack,
> > > overwriting one byte in the stack frame.
> > >
> > > Update the ethtool copy of the definition to match the 2.6.30 kernel.
> > [...]
> >
> > This has already been done.
>
> Ah? Could someone point me to the correct git-tree for ethtool then?
> I've been using http://www.kernel.org/pub/scm/network/ethtool/ethtool.git
> which still has this problem...
That's the correct repository. It is possible that the extra static
information needed to serve it over HTTP is not up-to-date. Try using
git protocol instead?
Ben.
--
Ben Hutchings, Senior Software Engineer, Solarflare Communications
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] Update embedded copy of ethtool.h from kernel 2.6.30
2009-12-01 15:52 ` Ben Hutchings
@ 2009-12-01 15:54 ` Jesper Nilsson
0 siblings, 0 replies; 5+ messages in thread
From: Jesper Nilsson @ 2009-12-01 15:54 UTC (permalink / raw)
To: Ben Hutchings; +Cc: Jeff Garzik, netdev@vger.kernel.org
On Tue, Dec 01, 2009 at 04:52:34PM +0100, Ben Hutchings wrote:
> On Tue, 2009-12-01 at 16:42 +0100, Jesper Nilsson wrote:
> > On Tue, Dec 01, 2009 at 04:21:18PM +0100, Ben Hutchings wrote:
> > > On Tue, 2009-12-01 at 16:17 +0100, Jesper Nilsson wrote:
> That's the correct repository. It is possible that the extra static
> information needed to serve it over HTTP is not up-to-date. Try using
> git protocol instead?
Yep, that was it, looks much better now. Thanks.
> Ben.
/^JN - Jesper Nilsson
--
Jesper Nilsson -- jesper.nilsson@axis.com
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2009-12-01 16:30 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-12-01 15:17 [PATCH] Update embedded copy of ethtool.h from kernel 2.6.30 Jesper Nilsson
2009-12-01 15:21 ` Ben Hutchings
2009-12-01 15:42 ` Jesper Nilsson
2009-12-01 15:52 ` Ben Hutchings
2009-12-01 15:54 ` Jesper Nilsson
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).