Commit 805aaa29fa breaks device statistics with the usbnet module. Reverting this commit fixes it. I think usbnet needed this callback to lookup the dev so it could update .stats. Also, I do have CONFIG_COMPAT_NET_DEV_OPS defined and am using usbnet with cdc_ether and zaurus. Thanks
Actually reverting the commit didn't fix it. Adding the following to usbnet_netdev_ops works: .ndo_get_stats = usbnet_get_stats,
Ben can you send that as a patch with Signed-off-by: line to the linux-kernel@vger.kernel.org mailing list (don't need to be subscribed) that way you'll get the due credit. If not I can just submit a fix anyway
I'm not sure how the patch was applied, but the notice I got from lkml about the patch being accepted looked like it wouldn't work. Commit 805aaa29fa needed to be reverted and modified to add the mentioned line to usbnet_netdev_opts. I didn't see any usbnet_get_stats in the lkml patch. But like I said, I'm not sure how it was applied. As far as creating a a Signed-off-by: line, I'd rather you just submit the fix. Thanks
(switched to email. Please respond via emailed reply-to-all, not via the bugzilla web interface). On Sat, 20 Jun 2009 16:24:13 GMT bugzilla-daemon@bugzilla.kernel.org wrote: > http://bugzilla.kernel.org/show_bug.cgi?id=13589 > > Summary: usbnet and /proc/net/dev stats > Product: Networking > Version: 2.5 > Kernel Version: 2.6.30 > Platform: All > OS/Version: Linux > Tree: Mainline > Status: NEW > Severity: normal > Priority: P1 > Component: Other > AssignedTo: acme@ghostprotocols.net > ReportedBy: bjk@luxsci.net > Regression: No > > > Commit 805aaa29fa breaks device statistics with the usbnet module. Reverting > this commit fixes it. I think usbnet needed this callback to lookup the dev > so > it could update .stats. > > Also, I do have CONFIG_COMPAT_NET_DEV_OPS defined and am using usbnet with > cdc_ether and zaurus. > This has turned into a bit of a mess, as the fix which I typed in needs the revert of another patch, and I don't know what actually went wrong with usbnet stats anyway. Could someone (Stephen?) please take a look? As it appears to be a 2.6.29->2.6.30 regression, please remember to cc stable@kernel.org on any fixes, thanks.
On Mon, Jun 29, 2009 at 05:23:41PM -0700, Andrew Morton wrote: All usbnet stats weren't getting updated (ifconfig, was always showing 0). When applied to 2.6.30 this fixes it. Commit 805aaa29fa was the culprit and reverting it re-adds usbnet_get_stats() but needed to be modified to add whats in usbnet_netdev_ops: --- /tmp/usbnet.c 2009-06-29 20:35:59.000000000 -0400 +++ usbnet.c 2009-06-20 11:40:41.000000000 -0400 @@ -1106,9 +1106,16 @@ } EXPORT_SYMBOL_GPL(usbnet_disconnect); +static struct net_device_stats *usbnet_get_stats (struct net_device *net) +{ + struct usbnet *dev = netdev_priv(net); + return &dev->stats; +} + static const struct net_device_ops usbnet_netdev_ops = { .ndo_open = usbnet_open, .ndo_stop = usbnet_stop, + .ndo_get_stats = usbnet_get_stats, .ndo_start_xmit = usbnet_start_xmit, .ndo_tx_timeout = usbnet_tx_timeout, .ndo_change_mtu = usbnet_change_mtu,