From: Jakub Kicinski <kuba@kernel.org>
To: Paolo Abeni <pabeni@redhat.com>
Cc: intel-wired-lan@lists.osuosl.org,
Tony Nguyen <anthony.l.nguyen@intel.com>,
Przemek Kitszel <przemyslaw.kitszel@intel.com>,
Andrew Lunn <andrew+netdev@lunn.ch>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Alexei Starovoitov <ast@kernel.org>,
Daniel Borkmann <daniel@iogearbox.net>,
Jesper Dangaard Brouer <hawk@kernel.org>,
John Fastabend <john.fastabend@gmail.com>,
Stanislav Fomichev <sdf@fomichev.me>,
netdev@vger.kernel.org
Subject: Re: [PATCH iwl-next 1/2] i40e: implement basic per-queue stats
Date: Wed, 8 Apr 2026 17:45:04 -0700 [thread overview]
Message-ID: <20260408174504.17210f78@kernel.org> (raw)
In-Reply-To: <0815f1eb4b60faa653ea703e420395b724d05216.1775648513.git.pabeni@redhat.com>
On Wed, 8 Apr 2026 13:43:45 +0200 Paolo Abeni wrote:
> +static void i40e_get_queue_stats_tx(struct net_device *dev, int idx,
> + struct netdev_queue_stats_tx *tx)
> +{
> + struct i40e_netdev_priv *np = netdev_priv(dev);
> + struct i40e_vsi *vsi = np->vsi;
> + struct i40e_ring *tx_ring;
> +
> + rcu_read_lock();
> + tx_ring = READ_ONCE(vsi->tx_rings[idx]);
> + if (!tx_ring)
> + goto out;
> +
> + i40e_zero_tx_ring_stats(tx);
> + i40e_add_tx_ring_stats(tx_ring, tx);
> +
> + if (i40e_enabled_xdp_vsi(vsi)) {
> + tx_ring = READ_ONCE(vsi->xdp_rings[idx]);
> + if (tx_ring)
> + i40e_add_tx_ring_stats(tx_ring, tx);
If XDP Tx happens on dedicated queues it should be added to base,
not to the stats of the "stack" queue. This is in anticipation of
XDP being its own queue type one day, we'll then isolate those
out of base. Ripping the out of TX could cause regressions.
> + }
> +
> +out:
> + rcu_read_unlock();
> +}
> +
> +static void i40e_get_base_stats(struct net_device *dev,
> + struct netdev_queue_stats_rx *rx,
> + struct netdev_queue_stats_tx *tx)
> +{
> + struct i40e_netdev_priv *np = netdev_priv(dev);
> + struct i40e_vsi *vsi = np->vsi;
> +
> + tx->bytes = vsi->tx_bytes;
> + tx->packets = vsi->tx_packets;
> + tx->wake = vsi->tx_restart_base;
> + tx->stop = vsi->tx_stopped_base;
> + tx->hw_drops = vsi->tx_busy_base;
> +
> + rx->bytes = vsi->rx_bytes;
> + rx->packets = vsi->rx_packets;
> +}
next prev parent reply other threads:[~2026-04-09 0:45 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-08 11:43 [PATCH iwl-next 0/2] i40e: implement per-queue stats Paolo Abeni
2026-04-08 11:43 ` [PATCH iwl-next 1/2] i40e: implement basic " Paolo Abeni
2026-04-08 12:07 ` [Intel-wired-lan] " Loktionov, Aleksandr
2026-04-08 14:44 ` Paolo Abeni
2026-04-09 0:45 ` Jakub Kicinski [this message]
2026-04-08 11:43 ` [PATCH iwl-next 2/2] i40e: keep track of per queue gso counters Paolo Abeni
2026-04-08 12:08 ` [Intel-wired-lan] " Loktionov, Aleksandr
2026-04-08 11:50 ` [Intel-wired-lan] [PATCH iwl-next 0/2] i40e: implement per-queue stats Paul Menzel
2026-04-08 14:58 ` Paolo Abeni
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=20260408174504.17210f78@kernel.org \
--to=kuba@kernel.org \
--cc=andrew+netdev@lunn.ch \
--cc=anthony.l.nguyen@intel.com \
--cc=ast@kernel.org \
--cc=daniel@iogearbox.net \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=hawk@kernel.org \
--cc=intel-wired-lan@lists.osuosl.org \
--cc=john.fastabend@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=przemyslaw.kitszel@intel.com \
--cc=sdf@fomichev.me \
/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