lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <YzT59R+zx4dA5G5Q@lunn.ch>
Date:   Thu, 29 Sep 2022 03:50:45 +0200
From:   Andrew Lunn <andrew@...n.ch>
To:     Shenwei Wang <shenwei.wang@....com>
Cc:     Joakim Zhang <qiangqing.zhang@....com>,
        "David S. Miller" <davem@...emloft.net>,
        Eric Dumazet <edumazet@...gle.com>,
        Jakub Kicinski <kuba@...nel.org>,
        Paolo Abeni <pabeni@...hat.com>,
        Alexei Starovoitov <ast@...nel.org>,
        Daniel Borkmann <daniel@...earbox.net>,
        Jesper Dangaard Brouer <hawk@...nel.org>,
        John Fastabend <john.fastabend@...il.com>,
        netdev@...r.kernel.org, linux-kernel@...r.kernel.org,
        imx@...ts.linux.dev
Subject: Re: [PATCH 1/1] net: fec: add initial XDP support

> +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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ