Re: [RFC net-next v3 2/2] net/mlx5e: Add per queue netdev-genl stats

From: Joe Damato
Date: Mon Jun 03 2024 - 17:50:34 EST


On Tue, Jun 04, 2024 at 12:36:16AM +0300, Tariq Toukan wrote:
>
>
> On 03/06/2024 22:22, Joe Damato wrote:
> > On Mon, Jun 03, 2024 at 02:11:14PM +0300, Tariq Toukan wrote:
> > >
>
> ...
>
> > >
> > > I still don't really like this design, so I gave some more thought on
> > > this...
> > >
> > > I think we should come up with a new mapping array under priv, that maps i
> > > (from real_num_tx_queues) to the matching sq_stats struct.
> > > This array would be maintained in the channels open/close functions,
> > > similarly to priv->txq2sq.
> > >
> > > Then, we would not calculate the mapping per call, but just get the proper
> > > pointer from the array. This eases the handling of htb and ptp queues, which
> > > were missed in your txq_ix_to_chtc_ix().
> >
> > Maybe I am just getting way off track here, but I noticed this in
> > drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c in
> > set_pflag_tx_port_ts:
> >
> > if (!err)
> > priv->tx_ptp_opened = true;
> >
> > but what if enable is false, meaning the user is disabling ptp via
> > ethtool?
> >
>
> This bool field under priv acts as a flag, means: ptp was ever opened.
> It's the same idea as max_opened_tc, but with boolean instead of numeric.

OK, but then to avoid double counting ptp, I suppose we don't
output ptp stats in base and only when the correct txq_ix is passed
in to the tx stats function which refers to the PTP queue?

It's either that or we dont include ptp's sqstats in the
txq2sq_stats mapping you've proposed, if I understand correctly.