Bug 9891 - /proc/net/dev entries limited to u32 in s2io.c neterion nics
Summary: /proc/net/dev entries limited to u32 in s2io.c neterion nics
Status: REJECTED WILL_NOT_FIX
Alias: None
Product: Drivers
Classification: Unclassified
Component: Network (show other bugs)
Hardware: All Linux
: P1 normal
Assignee: Jeff Garzik
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-02-05 03:21 UTC by Bernd Melchers
Modified: 2009-03-24 04:31 UTC (History)
1 user (show)

See Also:
Kernel Version: 2.6.24
Subsystem:
Regression: ---
Bisected commit-id:


Attachments

Description Bernd Melchers 2008-02-05 03:21:06 UTC
Latest working kernel version: never
Earliest failing kernel version:
Distribution: sles9, sles10, vanilla
Hardware Environment: ia64, x86_64
Software Environment:
Problem Description:
values for tx_packets, tx_errors, rx_errors, multicast, rx_length_errors
as presented by /proc/net/dev for neterion nics are limited to 32 bit,
although the statistic variables are 8 bytes (only for 64 bit OS!).
The problem is, that the assignment in the s2io.c driver, function
s2io_get_stats():

sp->stats.tx_packets = le32_to_cpu(mac_control->stats_info->tmac_frms);
etc. omits the overflow values, e.g. tmac_frms_oflow.

tx_packets and the other statistics counter are of type "unsigned long",
for 64 bit os, the width is 64 bit, so all bits should be used.

The correct(?) handling can be seen in the function s2io_get_ethtool_stats():
tmp_stats[i++] =
      (u64)le32_to_cpu(stat_info->tmac_frms_oflow) << 32  |
      le32_to_cpu(stat_info->tmac_frms);
here, more than 32 bit values are seen.

Steps to reproduce:
transmit more than 0xffffffff packets through the interface. This is
quite easy for these 10 GBit nics.
Comment 1 Anonymous Emailer 2008-02-05 03:27:26 UTC
Reply-To: akpm@linux-foundation.org

On Tue,  5 Feb 2008 03:21:06 -0800 (PST) bugme-daemon@bugzilla.kernel.org wrote:

> http://bugzilla.kernel.org/show_bug.cgi?id=9891
> 
>            Summary: /proc/net/dev entries limited to u32 in s2io.c neterion
>                     nics
>            Product: Drivers
>            Version: 2.5
>      KernelVersion: 2.6.24
>           Platform: All
>         OS/Version: Linux
>               Tree: Mainline
>             Status: NEW
>           Severity: normal
>           Priority: P1
>          Component: Network
>         AssignedTo: jgarzik@pobox.com
>         ReportedBy: melchers@zedat.fu-berlin.de
> 
> 
> Latest working kernel version: never
> Earliest failing kernel version:
> Distribution: sles9, sles10, vanilla
> Hardware Environment: ia64, x86_64
> Software Environment:
> Problem Description:
> values for tx_packets, tx_errors, rx_errors, multicast, rx_length_errors
> as presented by /proc/net/dev for neterion nics are limited to 32 bit,
> although the statistic variables are 8 bytes (only for 64 bit OS!).
> The problem is, that the assignment in the s2io.c driver, function
> s2io_get_stats():
> 
> sp->stats.tx_packets = le32_to_cpu(mac_control->stats_info->tmac_frms);
> etc. omits the overflow values, e.g. tmac_frms_oflow.
> 
> tx_packets and the other statistics counter are of type "unsigned long",
> for 64 bit os, the width is 64 bit, so all bits should be used.
> 
> The correct(?) handling can be seen in the function s2io_get_ethtool_stats():
> tmp_stats[i++] =
>       (u64)le32_to_cpu(stat_info->tmac_frms_oflow) << 32  |
>       le32_to_cpu(stat_info->tmac_frms);
> here, more than 32 bit values are seen.
> 
> Steps to reproduce:
> transmit more than 0xffffffff packets through the interface. This is
> quite easy for these 10 GBit nics.
> 
> 
> -- 
> Configure bugmail: http://bugzilla.kernel.org/userprefs.cgi?tab=email
> ------- You are receiving this mail because: -------
> You are on the CC list for the bug, or are watching someone who is.
Comment 2 Natalie Protasevich 2008-05-03 17:11:27 UTC
Bernd, if this still a problem, would you be interested in creating a patch and posting to lkml?
Comment 3 Bernd Melchers 2008-05-05 02:00:11 UTC
the people at neterion are working on the problem. I got a patch from them, but it does not work as expected. Perhaps there are additional 32 bit limits to the data structure outside the driver. I don't know. What really should be happen is the extension of all variables shown in /proc/net/dev to 64 bit - for 64bit _and_ 32bit systems. But that is outside of my expertise...
We have an x86-32bit ftp-Server (without 10 GB nic) who is overflowing tx_packets in every minute, and therefore our nagios-counter is feeded with random values. This makes tx_packets in /proc/net/dev free of any sense.

Note You need to log in before you can comment on or make changes to this bug.