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: <CACKFLin4dUL9eOrH_=sZpc26ep5iZe5mgOHAxyWEAHwVWuASTQ@mail.gmail.com>
Date: Wed, 28 Feb 2024 19:40:01 -0800
From: Michael Chan <michael.chan@...adcom.com>
To: Jakub Kicinski <kuba@...nel.org>
Cc: davem@...emloft.net, netdev@...r.kernel.org, edumazet@...gle.com, 
	pabeni@...hat.com, amritha.nambiar@...el.com, danielj@...dia.com, 
	mst@...hat.com, sdf@...gle.com, vadim.fedorenko@...ux.dev, 
	przemyslaw.kitszel@...el.com
Subject: Re: [PATCH net-next v2 3/3] eth: bnxt: support per-queue statistics

On Wed, Feb 28, 2024 at 5:02 PM Jakub Kicinski <kuba@...nel.org> wrote:
>
> Support per-queue statistics API in bnxt.
>
> $ ethtool -S eth0
> NIC statistics:
>      [0]: rx_ucast_packets: 1418
>      [0]: rx_mcast_packets: 178
>      [0]: rx_bcast_packets: 0
>      [0]: rx_discards: 0
>      [0]: rx_errors: 0
>      [0]: rx_ucast_bytes: 1141815
>      [0]: rx_mcast_bytes: 16766
>      [0]: rx_bcast_bytes: 0
>      [0]: tx_ucast_packets: 1734
> ...
> +
> +static void bnxt_get_queue_stats_tx(struct net_device *dev, int i,
> +                                   struct netdev_queue_stats_tx *stats)
> +{
> +       struct bnxt *bp = netdev_priv(dev);
> +       u64 *sw;
> +
> +       sw = bp->bnapi[i]->cp_ring.stats.sw_stats;

Sorry I missed this earlier.  When we are in XDP mode, the first set
of TX rings is generally hidden from the user.  The standard TX rings
don't start from index 0.  They start from bp->tx_nr_rings_xdp.
Should we adjust for that?

> +
> +       stats->packets = 0;
> +       stats->packets += BNXT_GET_RING_STATS64(sw, tx_ucast_pkts);
> +       stats->packets += BNXT_GET_RING_STATS64(sw, tx_mcast_pkts);
> +       stats->packets += BNXT_GET_RING_STATS64(sw, tx_bcast_pkts);
> +
> +       stats->bytes = 0;
> +       stats->bytes += BNXT_GET_RING_STATS64(sw, tx_ucast_bytes);
> +       stats->bytes += BNXT_GET_RING_STATS64(sw, tx_mcast_bytes);
> +       stats->bytes += BNXT_GET_RING_STATS64(sw, tx_bcast_bytes);
> +}
> +

Download attachment "smime.p7s" of type "application/pkcs7-signature" (4209 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ