Netdev List
 help / color / mirror / Atom feed
From: Jakub Kicinski <jakub.kicinski@netronome.com>
To: Felix Manlunas <felix.manlunas@cavium.com>
Cc: davem@davemloft.net, netdev@vger.kernel.org,
	raghu.vatsavayi@cavium.com, derek.chickles@cavium.com,
	satananda.burla@cavium.com, vijaya.guvva@cavium.com
Subject: Re: [PATCH net-next 3/3] liquidio: ethtool support for switchdev ports
Date: Thu, 26 Oct 2017 15:03:33 -0700	[thread overview]
Message-ID: <20171026150333.7aa11cc3@cakuba.netronome.com> (raw)
In-Reply-To: <20171026053735.GA17901@felix-thinkpad.cavium.com>

On Wed, 25 Oct 2017 22:37:35 -0700, Felix Manlunas wrote:
> +static const char lio_vf_rep_stats_strings[][ETH_GSTRING_LEN] = {
> +	"rx_packets",
> +	"tx_packets",
> +	"rx_bytes",
> +	"tx_bytes",
> +	"rx_dropped",
> +	"tx_dropped",
> +};
> +
> [...]
> +
> +static void
> +lio_vf_rep_get_ethtool_stats(struct net_device *ndev,
> +			     struct ethtool_stats *stats,
> +			     u64 *data)
> +{
> +	struct rtnl_link_stats64 *stats_ptr, net_stats;
> +	int i = 0;
> +
> +	stats_ptr = dev_get_stats(ndev, &net_stats);
> +
> +	data[i++] = stats_ptr->rx_packets;
> +	data[i++] = stats_ptr->tx_packets;
> +	data[i++] = stats_ptr->rx_bytes;
> +	data[i++] = stats_ptr->tx_bytes;
> +	data[i++] = stats_ptr->rx_dropped;
> +	data[i++] = stats_ptr->tx_dropped;
> +}

Duplicating basic netdev stats in ethtool is discouraged these days.

  reply	other threads:[~2017-10-26 22:03 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-26  5:36 [PATCH net-next 0/3] liquidio: Switchdev support for LiquidIO NIC Felix Manlunas
2017-10-26  5:37 ` [PATCH net-next 1/3] liquidio: switchdev " Felix Manlunas
2017-10-26 22:00   ` Jakub Kicinski
2017-10-26  5:37 ` [PATCH net-next 2/3] liquidio: Configure switchdev with devlink Felix Manlunas
2017-10-26  5:37 ` [PATCH net-next 3/3] liquidio: ethtool support for switchdev ports Felix Manlunas
2017-10-26 22:03   ` Jakub Kicinski [this message]
2017-10-26  6:19 ` [PATCH net-next 0/3] liquidio: Switchdev support for LiquidIO NIC Jiri Pirko

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=20171026150333.7aa11cc3@cakuba.netronome.com \
    --to=jakub.kicinski@netronome.com \
    --cc=davem@davemloft.net \
    --cc=derek.chickles@cavium.com \
    --cc=felix.manlunas@cavium.com \
    --cc=netdev@vger.kernel.org \
    --cc=raghu.vatsavayi@cavium.com \
    --cc=satananda.burla@cavium.com \
    --cc=vijaya.guvva@cavium.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