netdev
[Top] [All Lists]

Re: [PATCH]: r8169: Expose hardware stats via ethtool

To: Richard Dawe <rich@xxxxxxxxxxxxxxxxxxxx>
Subject: Re: [PATCH]: r8169: Expose hardware stats via ethtool
From: Jon Mason <jdmason@xxxxxxxxxx>
Date: Sun, 27 Feb 2005 20:31:12 -0600
Cc: Francois Romieu <romieu@xxxxxxxxxxxxx>, netdev@xxxxxxxxxxx
In-reply-to: <42224F76.9000602@xxxxxxxxxxxxxxxxxxxx>
Organization: IBM
References: <42208D83.80803@xxxxxxxxxxxxxxxxxxxx> <20050226181213.GA13230@xxxxxxxxxxxxxxxxxxxxxxxxxx> <42224F76.9000602@xxxxxxxxxxxxxxxxxxxx>
Sender: netdev-bounce@xxxxxxxxxxx
User-agent: KMail/1.7.2
I think I've found a (very hackish) way around the bad stats error.  

Tested on amd64, and "solves" the problem.

--- drivers/net/r8169.c 2005-02-27 20:27:48.000000000 -0600
+++ drivers/net/r8169.c.new     2005-02-27 20:29:29.000000000 -0600
@@ -929,8 +929,13 @@ static void rtl8169_get_ethtool_stats(st
                cpu_relax();
        }

-       if (RTL_R32(StatsAddrLow) & DumpStats)
+       if (RTL_R32(StatsAddrLow) & DumpStats) {
+               if (!netif_running(netdev)) {
+                       for (i = 0; i < 14; i++)
+                               data[i] = 0;
+               }
                return; /* no stats - took too long */
+       }

        i = 0;
        data[i++] = le64_to_cpu(tp->nic_stats->tx_ok);

<Prev in Thread] Current Thread [Next in Thread>