From: Michael Chan <michael.chan@broadcom.com>
To: Jakub Kicinski <kuba@kernel.org>
Cc: davem@davemloft.net, netdev@vger.kernel.org, edumazet@google.com,
pabeni@redhat.com, amritha.nambiar@intel.com,
danielj@nvidia.com, mst@redhat.com, sdf@google.com,
vadim.fedorenko@linux.dev, przemyslaw.kitszel@intel.com
Subject: Re: [PATCH net-next v2 3/3] eth: bnxt: support per-queue statistics
Date: Wed, 28 Feb 2024 19:40:01 -0800 [thread overview]
Message-ID: <CACKFLin4dUL9eOrH_=sZpc26ep5iZe5mgOHAxyWEAHwVWuASTQ@mail.gmail.com> (raw)
In-Reply-To: <20240229010221.2408413-4-kuba@kernel.org>
[-- Attachment #1: Type: text/plain, Size: 1496 bytes --]
On Wed, Feb 28, 2024 at 5:02 PM Jakub Kicinski <kuba@kernel.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);
> +}
> +
[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4209 bytes --]
next prev parent reply other threads:[~2024-02-29 3:40 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-02-29 1:02 [PATCH net-next v2 0/3] netdev: add per-queue statistics Jakub Kicinski
2024-02-29 1:02 ` [PATCH net-next v2 1/3] " Jakub Kicinski
2024-02-29 1:02 ` [PATCH net-next v2 2/3] netdev: add queue stat for alloc failures Jakub Kicinski
2024-02-29 1:02 ` [PATCH net-next v2 3/3] eth: bnxt: support per-queue statistics Jakub Kicinski
2024-02-29 3:40 ` Michael Chan [this message]
2024-02-29 3:52 ` Jakub Kicinski
2024-03-06 14:56 ` Jakub Kicinski
2024-03-06 18:10 ` Michael Chan
2024-02-29 17:26 ` [PATCH net-next v2 0/3] netdev: add " Stanislav Fomichev
2024-02-29 18:53 ` Nambiar, Amritha
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='CACKFLin4dUL9eOrH_=sZpc26ep5iZe5mgOHAxyWEAHwVWuASTQ@mail.gmail.com' \
--to=michael.chan@broadcom.com \
--cc=amritha.nambiar@intel.com \
--cc=danielj@nvidia.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=kuba@kernel.org \
--cc=mst@redhat.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=przemyslaw.kitszel@intel.com \
--cc=sdf@google.com \
--cc=vadim.fedorenko@linux.dev \
/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).