Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
For bugs related to Red Hat Enterprise Linux 4 product line. The current stable release is 4.9. For Red Hat Enterprise Linux 6 and above, please visit Red Hat JIRA https://issues.redhat.com/secure/CreateIssue!default.jspa?pid=12332745 to report new issues.

Bug 446456

Summary: RFE: add ability to reset interface stats via procfs
Product: Red Hat Enterprise Linux 4 Reporter: James Cammarata <james.cammarata>
Component: kernelAssignee: Jiri Pirko <jpirko>
Status: CLOSED WONTFIX QA Contact: Martin Jenner <mjenner>
Severity: low Docs Contact:
Priority: low    
Version: 4.6CC: davem, inode0, jkvalerius, rkhan, tgraf, vgoyal
Target Milestone: rc   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2008-06-24 02:01:42 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
Patch to accomplish RFE
none
Updated patch none

Description James Cammarata 2008-05-14 17:12:39 UTC
This is an RFE to add the ability to reset interface statistics via the
/proc/net/dev interface.  

Syntax:
  echo 'net clear-stats ifdev' > /proc/net/dev
Where "ifdev" is the device name you wish to clear.

Attached is a patch I have generated against the 2.6.9 kernel (RHEL4), and I've
submitted this to the mainstream kernel as well
(http://lkml.org/lkml/2008/5/13/413).

This code is based mainly on the code found in drivers/scsi/scsi_proc.c

Comment 1 James Cammarata 2008-05-14 17:12:39 UTC
Created attachment 305385 [details]
Patch to accomplish RFE

Comment 2 James Cammarata 2008-05-15 15:49:54 UTC
Created attachment 305503 [details]
Updated patch

Added some sanity checking on the sscanf() to make sure there isn't a buffer
overflow, and that it picks up the interface name.

Comment 3 David Miller 2008-06-23 22:16:18 UTC
Similar proposals were nearly universally rejected numerous times upstream.

The scsi case is an exception, and an unfortunate one, because it has
dire consequences.

If one administrator is doing statistics and decides to reset the stats,
this can wreck analysis being done by another administrator.  This is why
such things belong in userland tools, not in the kernel.

And the most recent discussion about this on netdev showed numerous
userland solutions to this problem.


Comment 4 James Cammarata 2008-06-23 23:00:35 UTC
Yep, this was submitted here and upstream at the same time, and was shot down
there, so please feel free to close this.  I had forgotten it was even open till
I saw the assignment email :)