All of lore.kernel.org
 help / color / mirror / Atom feed
From: Lorenzo Bianconi <lorenzo@kernel.org>
To: Sven Auhagen <sven.auhagen@voleatech.de>
Cc: "netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"thomas.petazzoni@bootlin.com" <thomas.petazzoni@bootlin.com>,
	"brouer@redhat.com" <brouer@redhat.com>,
	"ilias.apalodimas@linaro.org" <ilias.apalodimas@linaro.org>,
	"mcroce@microsoft.com" <mcroce@microsoft.com>,
	"leon@kernel.org" <leon@kernel.org>,
	"kuba@kernel.org" <kuba@kernel.org>
Subject: Re: [PATCH v4] net: mvneta: fix calls to page_pool_get_stats
Date: Thu, 9 Nov 2023 12:31:45 +0100	[thread overview]
Message-ID: <ZUzDIV2SQ4U/rhzI@lore-desk> (raw)
In-Reply-To: <4fxnidhi7gfpzmeels363loksphtifgsan6w64n5y7dxzi7dyx@jwbe4gp37mwy>

[-- Attachment #1: Type: text/plain, Size: 1606 bytes --]

[...]
> > 
> > do we need to check pp->is_stopped here? (we already check if page_pool
> > pointer is NULL in mvneta_ethtool_pp_stats).
> > Moreover in mvneta_ethtool_get_sset_count() and in mvneta_ethtool_get_strings()
> > we just check pp->bm_priv pointer. Are the stats disaligned in this case?
> 
> Hi Lorenzo,
> 
> so the buffer manager (bm) does not support the page pool.
> If this mode is used we can skip any page pool references.
> 
> The question is do we end up with a race condition when we skip the is_stopped check
> as the variable is set to true just before the page pools are
> deallocated on suspend or interface stop calls.

Do we really have a race here? e.g. both ndo_stop and ethtool_get_stats() run under rtnl.
Moreover it seems is_stopped is not set for armada-3700 devices (e.g. my
espressobin). Do we have the issue for this kind of devices?

Regards,
Lorenzo

> 
> Best
> Sven
> 
> > 
> > > +		mvneta_ethtool_pp_stats(pp, data);
> > >  }
> > >  
> > >  static int mvneta_ethtool_get_sset_count(struct net_device *dev, int sset)
> > >  {
> > > -	if (sset == ETH_SS_STATS)
> > > -		return ARRAY_SIZE(mvneta_statistics) +
> > > -		       page_pool_ethtool_stats_get_count();
> > > +	if (sset == ETH_SS_STATS) {
> > > +		int count = ARRAY_SIZE(mvneta_statistics);
> > > +		struct mvneta_port *pp = netdev_priv(dev);
> > > +
> > > +		if (!pp->bm_priv)
> > > +			count += page_pool_ethtool_stats_get_count();
> > > +
> > > +		return count;
> > > +	}
> > >  
> > >  	return -EOPNOTSUPP;
> > >  }
> > > -- 
> > > 2.42.0
> > > 
> 
> 

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

  reply	other threads:[~2023-11-09 11:31 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-09  5:59 [PATCH v4] net: mvneta: fix calls to page_pool_get_stats Sven Auhagen
2023-11-09  7:48 ` Lorenzo Bianconi
2023-11-09 11:06   ` Sven Auhagen
2023-11-09 11:31     ` Lorenzo Bianconi [this message]
2023-11-10  4:22       ` Sven Auhagen

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=ZUzDIV2SQ4U/rhzI@lore-desk \
    --to=lorenzo@kernel.org \
    --cc=brouer@redhat.com \
    --cc=ilias.apalodimas@linaro.org \
    --cc=kuba@kernel.org \
    --cc=leon@kernel.org \
    --cc=mcroce@microsoft.com \
    --cc=netdev@vger.kernel.org \
    --cc=sven.auhagen@voleatech.de \
    --cc=thomas.petazzoni@bootlin.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.