netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jakub Kicinski <kuba@kernel.org>
To: Jiawen Wu <jiawenwu@trustnetic.com>
Cc: netdev@vger.kernel.org, davem@davemloft.net, edumazet@google.com,
	pabeni@redhat.com, andrew@lunn.ch, mengyuanlou@net-swift.com
Subject: Re: [RESEND PATCH net-next v2 1/3] net: libwx: support hardware statistics
Date: Wed, 4 Oct 2023 16:46:06 -0700	[thread overview]
Message-ID: <20231004164606.31e98eb6@kernel.org> (raw)
In-Reply-To: <20230927061457.993277-2-jiawenwu@trustnetic.com>

On Wed, 27 Sep 2023 14:14:55 +0800 Jiawen Wu wrote:
> +static const struct wx_stats wx_gstrings_stats[] = {
> +	WX_NETDEV_STAT("rx_packets", rx_packets),
> +	WX_NETDEV_STAT("tx_packets", tx_packets),
> +	WX_NETDEV_STAT("rx_bytes", rx_bytes),
> +	WX_NETDEV_STAT("tx_bytes", tx_bytes),
> +	WX_NETDEV_STAT("multicast", multicast),
> +	WX_NETDEV_STAT("rx_errors", rx_errors),
> +	WX_NETDEV_STAT("rx_length_errors", rx_length_errors),
> +	WX_NETDEV_STAT("rx_crc_errors", rx_crc_errors),

Please don't report standard netdev statistics in ethtool -S.
Users can get them thru any of the (too) many standard APIs.

> +	WX_STAT("rx_pkts_nic", stats.gprc),
> +	WX_STAT("tx_pkts_nic", stats.gptc),
> +	WX_STAT("rx_bytes_nic", stats.gorc),
> +	WX_STAT("tx_bytes_nic", stats.gotc),
> +	WX_STAT("rx_total_pkts", stats.tpr),
> +	WX_STAT("tx_total_pkts", stats.tpt),
> +	WX_STAT("rx_broadcast", stats.bprc),
> +	WX_STAT("tx_broadcast", stats.bptc),
> +	WX_STAT("rx_multicast", stats.mprc),
> +	WX_STAT("tx_multicast", stats.mptc),
> +	WX_STAT("rx_long_length_count", stats.roc),
> +	WX_STAT("rx_short_length_count", stats.ruc),
> +	WX_STAT("rx_flow_control_xon_xoff", stats.lxonoffrxc),
> +	WX_STAT("tx_flow_control_xon", stats.lxontxc),
> +	WX_STAT("tx_flow_control_xoff", stats.lxofftxc),

Please take a look at the statistics defined in ethtool.h
Look for callbacks in struct ethtool_ops with "stats" in the name.
Anything that matches one of the callbacks should go into those
APIs no to ethtool -S.

> +	WX_STAT("os2bmc_rx_by_bmc", stats.o2bgptc),
> +	WX_STAT("os2bmc_tx_by_bmc", stats.b2ospc),
> +	WX_STAT("os2bmc_tx_by_host", stats.o2bspc),
> +	WX_STAT("os2bmc_rx_by_host", stats.b2ogprc),
> +	WX_STAT("rx_no_dma_resources", stats.rdmdrop),
> +	WX_STAT("tx_busy", tx_busy),
> +	WX_STAT("non_eop_descs", non_eop_descs),
> +	WX_STAT("tx_restart_queue", restart_queue),
> +	WX_STAT("rx_csum_offload_good_count", hw_csum_rx_good),
> +	WX_STAT("rx_csum_offload_errors", hw_csum_rx_error),
> +	WX_STAT("alloc_rx_buff_failed", alloc_rx_buff_failed),
> +};
> +
> +static const char wx_gstrings_test[][ETH_GSTRING_LEN] = {
> +	"Register test  (offline)", "Eeprom test    (offline)",
> +	"Interrupt test (offline)", "Loopback test  (offline)",
> +	"Link test   (on/offline)"
> +};

You said this adds stats. Why are strings for tests here?
-- 
pw-bot: cr

  reply	other threads:[~2023-10-04 23:46 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-27  6:14 [RESEND PATCH net-next v2 0/3] Wangxun ethtool stats Jiawen Wu
2023-09-27  6:14 ` [RESEND PATCH net-next v2 1/3] net: libwx: support hardware statistics Jiawen Wu
2023-10-04 23:46   ` Jakub Kicinski [this message]
2023-09-27  6:14 ` [RESEND PATCH net-next v2 2/3] net: txgbe: add ethtool stats support Jiawen Wu
2023-09-27  6:14 ` [RESEND PATCH net-next v2 3/3] net: ngbe: " Jiawen Wu

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=20231004164606.31e98eb6@kernel.org \
    --to=kuba@kernel.org \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=jiawenwu@trustnetic.com \
    --cc=mengyuanlou@net-swift.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.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).