linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Lunn <andrew@lunn.ch>
To: Shenwei Wang <shenwei.wang@nxp.com>
Cc: Joakim Zhang <qiangqing.zhang@nxp.com>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	Alexei Starovoitov <ast@kernel.org>,
	Daniel Borkmann <daniel@iogearbox.net>,
	Jesper Dangaard Brouer <hawk@kernel.org>,
	John Fastabend <john.fastabend@gmail.com>,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	imx@lists.linux.dev
Subject: Re: [PATCH 1/1] net: fec: add initial XDP support
Date: Thu, 29 Sep 2022 03:50:45 +0200	[thread overview]
Message-ID: <YzT59R+zx4dA5G5Q@lunn.ch> (raw)
In-Reply-To: <20220928152509.141490-1-shenwei.wang@nxp.com>

> +struct fec_enet_xdp_stats {
> +	u64	xdp_pass;
> +	u64	xdp_drop;
> +	u64	xdp_xmit;
> +	u64	xdp_redirect;
> +	u64	xdp_xmit_err;
> +	u64	xdp_tx;
> +	u64	xdp_tx_err;
> +};
> +
> +	switch (act) {
> +	case XDP_PASS:
> +		rxq->stats.xdp_pass++;

Since the stats are u64, and most machines using the FEC are 32 bit,
you cannot just do an increment. Took a look at u64_stats_sync.h.

> -#define FEC_STATS_SIZE		(ARRAY_SIZE(fec_stats) * sizeof(u64))
> +static struct fec_xdp_stat {
> +	char name[ETH_GSTRING_LEN];
> +	u32 count;
> +} fec_xdp_stats[] = {
> +	{ "rx_xdp_redirect", 0 },
> +	{ "rx_xdp_pass", 0 },
> +	{ "rx_xdp_drop", 0 },
> +	{ "rx_xdp_tx", 0 },
> +	{ "rx_xdp_tx_errors", 0 },
> +	{ "tx_xdp_xmit", 0 },
> +	{ "tx_xdp_xmit_errors", 0 },
> +};
> +
> +#define FEC_STATS_SIZE	((ARRAY_SIZE(fec_stats) + \
> +			ARRAY_SIZE(fec_xdp_stats)) * sizeof(u64))

The page pool also has some stats. See page_pool_get_stats(),
page_pool_ethtool_stats_get_strings() etc.

      Andrew

  parent reply	other threads:[~2022-09-29  1:51 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-28 15:25 [PATCH 1/1] net: fec: add initial XDP support Shenwei Wang
2022-09-28 21:18 ` kernel test robot
2022-09-29  1:33 ` Andrew Lunn
2022-09-29 12:40   ` [EXT] " Shenwei Wang
2022-09-29 13:22     ` Andrew Lunn
2022-09-29 13:26       ` Shenwei Wang
2022-09-29 15:19         ` Andrew Lunn
2022-09-29 15:28         ` Jesper Dangaard Brouer
2022-09-29 15:39           ` Andrew Lunn
2022-09-29 15:52           ` Shenwei Wang
2022-09-29 18:55             ` Jesper Dangaard Brouer
2022-10-03 12:49               ` Shenwei Wang
2022-10-04 11:21                 ` Jesper Dangaard Brouer
2022-10-04 13:12                   ` Shenwei Wang
2022-10-04 13:34                     ` Shenwei Wang
2022-10-05 12:40                       ` Shenwei Wang
2022-10-06  8:37                         ` Jesper Dangaard Brouer
2022-10-07  8:08                           ` Ilias Apalodimas
2022-10-07 19:18                             ` Shenwei Wang
2022-09-29  1:50 ` Andrew Lunn [this message]
2022-09-29 12:46   ` Shenwei Wang
2022-09-29 13:24     ` Andrew Lunn
2022-09-29 13:35       ` Shenwei Wang
2022-09-29  2:43 ` kernel test robot
2022-09-29 10:16 ` Jesper Dangaard Brouer
2022-09-29 13:11   ` [EXT] " Shenwei Wang
2022-09-29 15:44     ` Jesper Dangaard Brouer
2022-10-03  5:41 ` kernel test robot
2022-10-25 20:11 Shenwei Wang
2022-10-25 22:08 ` Andrew Lunn
2022-10-26  7:45 ` kernel test robot

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=YzT59R+zx4dA5G5Q@lunn.ch \
    --to=andrew@lunn.ch \
    --cc=ast@kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=hawk@kernel.org \
    --cc=imx@lists.linux.dev \
    --cc=john.fastabend@gmail.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=qiangqing.zhang@nxp.com \
    --cc=shenwei.wang@nxp.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).