netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>
To: Ben Hutchings <bhutchings@solarflare.com>
Cc: netdev@vger.kernel.org, linux-sh@vger.kernel.org,
	Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Subject: Re: [PATCH] sh: sh_eth: Add support ethtool
Date: Tue, 11 Jan 2011 20:54:19 +0900	[thread overview]
Message-ID: <AANLkTikw+fcA_pvtcXLu8MENJSaO2u+wiQwRWe6Tejdp@mail.gmail.com> (raw)
In-Reply-To: <1294410955.4200.3.camel@bwh-desktop>

2011/1/7 Ben Hutchings <bhutchings@solarflare.com>:
> On Fri, 2011-01-07 at 16:25 +0900, Nobuhiro Iwamatsu wrote:
>> This commit supports following functions.
>>  - get_drvinfo
>>  - get_settings
>>  - set_settings
>>  - nway_reset
>>  - get_msglevel
>>  - set_msglevel
>>  - get_link
>>  - get_strings
>>  - get_ethtool_stats
>>  - get_sset_count
>>
>> About other function, the device does not support.
>>
>> Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
>> Signed-off-by: Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>
>> ---
>>  drivers/net/sh_eth.c |  190 ++++++++++++++++++++++++++++++++++++++++++++++----
>>  1 files changed, 176 insertions(+), 14 deletions(-)
>>
>> diff --git a/drivers/net/sh_eth.c b/drivers/net/sh_eth.c
>> index 819c175..10493e8 100644
>> --- a/drivers/net/sh_eth.c
>> +++ b/drivers/net/sh_eth.c
>> @@ -32,6 +32,7 @@
>>  #include <linux/io.h>
>>  #include <linux/pm_runtime.h>
>>  #include <linux/slab.h>
>> +#include <linux/ethtool.h>
>>  #include <asm/cacheflush.h>
>>
>>  #include "sh_eth.h"
>> @@ -573,7 +574,7 @@ static int sh_eth_ring_init(struct net_device *ndev)
>>       }
>>
>>       /* Allocate all Rx descriptors. */
>> -     rx_ringsize = sizeof(struct sh_eth_rxdesc) * RX_RING_SIZE;
>> +     rx_ringsize = sizeof(struct sh_eth_rxdesc) *RX_RING_SIZE;
>
> Please don't delete spaces just because checkpatch.pl is too stupid to
> recognise a multiplication.
>
> Also, don't mix formatting cleanup with actual feature changes.
>
I see.

> [...]
>> +static const char sh_eth_gstrings_stats[][ETH_GSTRING_LEN] = {
>> +     "rx_packets", "tx_packets", "rx_bytes", "tx_bytes", "rx_errors",
>> +     "tx_errors", "rx_dropped", "tx_dropped", "multicast", "collisions",
>> +     "rx_length_errors", "rx_over_errors", "rx_crc_errors",
>> +     "rx_frame_errors", "rx_fifo_errors", "rx_missed_errors",
>> +     "tx_aborted_errors", "tx_carrier_errors", "tx_fifo_errors",
>> +     "tx_heartbeat_errors", "tx_window_errors",
>> +     /* device-specific stats */
>> +     "rx_current", "tx_current",
>> +     "rx_dirty", "tx_dirty",
>> +};
>> +#define SH_ETH_NET_STATS_LEN  21
>> +#define SH_ETH_STATS_LEN  ARRAY_SIZE(sh_eth_gstrings_stats)
>> +
>> +static int sh_eth_get_sset_count(struct net_device *netdev, int sset)
>> +{
>> +     switch (sset) {
>> +     case ETH_SS_STATS:
>> +             return SH_ETH_STATS_LEN;
>> +     default:
>> +             return -EOPNOTSUPP;
>> +     }
>> +}
>> +
>> +static void sh_eth_get_ethtool_stats(struct net_device *ndev,
>> +                     struct ethtool_stats *stats, u64 *data)
>> +{
>> +     struct sh_eth_private *mdp = netdev_priv(ndev);
>> +     int i;
>> +
>> +     for (i = 0; i < SH_ETH_NET_STATS_LEN; i++)
>> +             data[i] = ((unsigned long *)&ndev->stats)[i];
> [...]
>
> There is no need to duplicate net_device_stats here.
Oh, yes. thanks,

I send the patch which revised the part which you pointed out.

Best regards,
  Nobuhiro

-- 
Nobuhiro Iwamatsu

      reply	other threads:[~2011-01-11 11:54 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-07  7:25 [PATCH] sh: sh_eth: Add support ethtool Nobuhiro Iwamatsu
2011-01-07 14:35 ` Ben Hutchings
2011-01-11 11:54   ` Nobuhiro Iwamatsu [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=AANLkTikw+fcA_pvtcXLu8MENJSaO2u+wiQwRWe6Tejdp@mail.gmail.com \
    --to=nobuhiro.iwamatsu.yj@renesas.com \
    --cc=bhutchings@solarflare.com \
    --cc=linux-sh@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=yoshihiro.shimoda.uh@renesas.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).