linux-kselftest.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Cosmin Ratiu <cratiu@nvidia.com>
To: "andrew+netdev@lunn.ch" <andrew+netdev@lunn.ch>,
	Saeed Mahameed <saeedm@nvidia.com>,
	"davem@davemloft.net" <davem@davemloft.net>,
	Tariq Toukan <tariqt@nvidia.com>,
	"leon@kernel.org" <leon@kernel.org>,
	"shuah@kernel.org" <shuah@kernel.org>,
	Mark Bloch <mbloch@nvidia.com>,
	"kuba@kernel.org" <kuba@kernel.org>,
	"horms@kernel.org" <horms@kernel.org>,
	"daniel.zahka@gmail.com" <daniel.zahka@gmail.com>,
	"donald.hunter@gmail.com" <donald.hunter@gmail.com>,
	Boris Pismenny <borisp@nvidia.com>,
	"edumazet@google.com" <edumazet@google.com>,
	"pabeni@redhat.com" <pabeni@redhat.com>
Cc: "netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"linux-kselftest@vger.kernel.org"
	<linux-kselftest@vger.kernel.org>
Subject: Re: [PATCH net-next v2 4/5] net/mlx5e: Add PSP stats support for Rx/Tx flows
Date: Thu, 30 Oct 2025 16:11:49 +0000	[thread overview]
Message-ID: <0025ef2f3eb0787d6ee29111f936a86f865320cd.camel@nvidia.com> (raw)
In-Reply-To: <20251028000018.3869664-5-daniel.zahka@gmail.com>

On Mon, 2025-10-27 at 17:00 -0700, Daniel Zahka wrote:
> @@ -670,9 +813,57 @@ static int accel_psp_fs_init_tx(struct
> mlx5e_psp_fs *fs)
>  		return -ENOMEM;
>  
>  	mutex_init(&tx_fs->mutex);
> +	flow_counter = mlx5_fc_create(mdev, false);
> +	if (IS_ERR(flow_counter)) {
> +		mlx5_core_warn(mdev,
> +			       "fail to create psp tx flow counter
> err=%pe\n",
> +			       flow_counter);
> +		err = PTR_ERR(flow_counter);
> +		goto out_err;
> +	}
> +	tx_fs->tx_counter = flow_counter;

Nit: Moving the flow counter init before the mutex init would simplify
cleanup a bit (simple return instead of goto out_err).

> +static void
> +mlx5e_accel_psp_fs_get_stats_fill(struct mlx5e_priv *priv, void
> *psp_stats)
> +{
> +	struct mlx5e_psp_stats *stats = (struct mlx5e_psp_stats
> *)psp_stats;

Why can't this function receive an mlx5e_psp_stats pointer directly? It
would avoid the boilerplate cast.

> +static void
> +mlx5e_psp_get_stats(struct psp_dev *psd, struct psp_dev_stats
> *stats)
> +{
> +	struct mlx5e_priv *priv = netdev_priv(psd->main_netdev);
> +	struct mlx5e_psp_stats nstats;
> +
> +	mlx5e_accel_psp_fs_get_stats_fill(priv, &nstats);

I don't see the point of the intermediate struct mlx5e_psp_stats, this
function could query counters directly into stats.
>  
> +struct mlx5e_psp_stats {
> +	u64 psp_rx_pkts;
> +	u64 psp_rx_bytes;
> +	u64 psp_rx_pkts_auth_fail;
> +	u64 psp_rx_bytes_auth_fail;
> +	u64 psp_rx_pkts_frame_err;
> +	u64 psp_rx_bytes_frame_err;
> +	u64 psp_rx_pkts_drop;
> +	u64 psp_rx_bytes_drop;
> +	u64 psp_tx_pkts;
> +	u64 psp_tx_bytes;
> +	u64 psp_tx_pkts_drop;
> +	u64 psp_tx_bytes_drop;
> +};
> +
>  struct mlx5e_psp {
>  	struct psp_dev *psp;
>  	struct psp_dev_caps caps;
>  	struct mlx5e_psp_fs *fs;
>  	atomic_t tx_key_cnt;
> +	atomic_t tx_drop;
> +	/* Stats manage */
> +	struct mlx5e_psp_stats stats;

This does not appear written anywhere. Is it planned to be used in a
future patch?

Cosmin.

  reply	other threads:[~2025-10-30 16:11 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-28  0:00 [PATCH net-next v2 0/5] psp: track stats from core and provide a driver stats api Daniel Zahka
2025-10-28  0:00 ` [PATCH net-next v2 1/5] psp: report basic stats from the core Daniel Zahka
2025-10-28  0:00 ` [PATCH net-next v2 2/5] selftests: drv-net: psp: add assertions on core-tracked psp dev stats Daniel Zahka
2025-10-28  0:00 ` [PATCH net-next v2 3/5] psp: add stats from psp spec to driver facing api Daniel Zahka
2025-10-28  9:02   ` Paolo Abeni
2025-10-28 17:30     ` Jakub Kicinski
2025-10-28 17:33       ` Jakub Kicinski
2025-10-28  0:00 ` [PATCH net-next v2 4/5] net/mlx5e: Add PSP stats support for Rx/Tx flows Daniel Zahka
2025-10-30 16:11   ` Cosmin Ratiu [this message]
2025-11-05 20:31     ` Daniel Zahka
2025-10-28  0:00 ` [PATCH net-next v2 5/5] netdevsim: implement psp device stats Daniel Zahka

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=0025ef2f3eb0787d6ee29111f936a86f865320cd.camel@nvidia.com \
    --to=cratiu@nvidia.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=borisp@nvidia.com \
    --cc=daniel.zahka@gmail.com \
    --cc=davem@davemloft.net \
    --cc=donald.hunter@gmail.com \
    --cc=edumazet@google.com \
    --cc=horms@kernel.org \
    --cc=kuba@kernel.org \
    --cc=leon@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=mbloch@nvidia.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=saeedm@nvidia.com \
    --cc=shuah@kernel.org \
    --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;
as well as URLs for NNTP newsgroup(s).