From: Joe Damato <jdamato@fastly.com>
To: Jakub Kicinski <kuba@kernel.org>
Cc: Saeed Mahameed <saeedm@nvidia.com>,
linux-kernel@vger.kernel.org, netdev@vger.kernel.org,
nalramli@fastly.com, "David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Leon Romanovsky <leon@kernel.org>,
"open list:MELLANOX MLX5 core VPI driver"
<linux-rdma@vger.kernel.org>, Paolo Abeni <pabeni@redhat.com>,
Richard Cochran <richardcochran@gmail.com>,
Tariq Toukan <tariqt@nvidia.com>
Subject: Re: [RFC net-next v3 0/2] mlx5: Add netdev-genl queue stats
Date: Thu, 30 May 2024 17:56:52 -0700 [thread overview]
Message-ID: <ZlkgVJbRpkzx6rTI@LQ3V64L9R2> (raw)
In-Reply-To: <20240530173902.7f00a610@kernel.org>
On Thu, May 30, 2024 at 05:39:02PM -0700, Jakub Kicinski wrote:
> On Thu, 30 May 2024 17:15:25 -0700 Joe Damato wrote:
> > > Why to base, and not report them as queue stats?
> > >
> > > Judging by mlx5e_update_tx_netdev_queues() calls sprinkled in
> > > ../mlx5/core/en/htb.c it seems that the driver will update the
> > > real_num_tx_queues accordingly. And from mlx5e_qid_from_qos()
> > > it seems like the inverse calculation is:
> > >
> > > i - (chs->params.num_channels + is_ptp)*mlx5e_get_dcb_num_tc(&chs->params)
> > >
> > > But really, isn't it enough to use priv->txq2sq[i] for the active
> > > queues, and not active ones you've already covered?
> >
> > This is what I proposed in the thread for the v2, but Tariq
> > suggested a different approach he liked more, please see this
> > message for more details:
> >
> > https://lore.kernel.org/netdev/68225941-f3c3-4335-8f3d-edee43f59033@gmail.com/
> >
> > I attempted to implement option 1 as he described in his message.
>
> I see, although it sounds like option 2 would also work.
I don't really mind either way; from Tariq's message it sounded like
he preferred option 1, so I tried to implement that thinking that it would be
my best bet at getting this done.
If option 2 is easier/preferred for some reason... it seems like
(other than the locking I forgot to include) the base implementation
in v2 was correct and I could use what I proposed in the thread for
the tx stats, which was:
mutex_lock(&priv->state_lock);
if (priv->channels.num > 0) {
sq = priv->txq2sq[i];
stats->packets = sq->stats->packets;
stats->bytes = sq->stats->bytes;
}
mutex_unlock(&priv->state_lock);
And I would have implemented option 2... IIUC.
next prev parent reply other threads:[~2024-05-31 0:56 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-05-29 3:16 [RFC net-next v3 0/2] mlx5: Add netdev-genl queue stats Joe Damato
2024-05-29 3:16 ` [RFC net-next v3 1/2] net/mlx5e: Add helpers to calculate txq and ch idx Joe Damato
2024-05-30 21:15 ` Jacob Keller
2024-06-01 11:35 ` Simon Horman
2024-06-01 11:39 ` Simon Horman
2024-06-02 19:23 ` Joe Damato
2024-05-29 3:16 ` [RFC net-next v3 2/2] net/mlx5e: Add per queue netdev-genl stats Joe Damato
2024-05-30 21:16 ` Jacob Keller
2024-06-02 9:14 ` Tariq Toukan
2024-06-02 19:22 ` Joe Damato
2024-06-03 11:11 ` Tariq Toukan
2024-06-03 18:11 ` Joe Damato
2024-06-03 19:22 ` Joe Damato
2024-06-03 21:36 ` Tariq Toukan
2024-06-03 21:50 ` Joe Damato
2024-05-31 0:11 ` [RFC net-next v3 0/2] mlx5: Add netdev-genl queue stats Jakub Kicinski
2024-05-31 0:15 ` Joe Damato
2024-05-31 0:39 ` Jakub Kicinski
2024-05-31 0:56 ` Joe Damato [this message]
2024-05-31 1:07 ` Joe Damato
2024-05-31 1:26 ` Jakub Kicinski
2024-05-31 18:30 ` Joe Damato
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=ZlkgVJbRpkzx6rTI@LQ3V64L9R2 \
--to=jdamato@fastly.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=kuba@kernel.org \
--cc=leon@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rdma@vger.kernel.org \
--cc=nalramli@fastly.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=richardcochran@gmail.com \
--cc=saeedm@nvidia.com \
--cc=tariqt@nvidia.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