[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <belurnyearlc7kcqyhct5nm4nx5oznid7s5qakzjhe7x6t66z2@ezzdmjkirvtv>
Date: Fri, 10 Nov 2023 05:22:44 +0100
From: Sven Auhagen <sven.auhagen@...eatech.de>
To: Lorenzo Bianconi <lorenzo@...nel.org>
Cc: "netdev@...r.kernel.org" <netdev@...r.kernel.org>,
"thomas.petazzoni@...tlin.com" <thomas.petazzoni@...tlin.com>, "brouer@...hat.com" <brouer@...hat.com>,
"ilias.apalodimas@...aro.org" <ilias.apalodimas@...aro.org>, "mcroce@...rosoft.com" <mcroce@...rosoft.com>,
"leon@...nel.org" <leon@...nel.org>, "kuba@...nel.org" <kuba@...nel.org>
Subject: Re: [PATCH v4] net: mvneta: fix calls to page_pool_get_stats
On Thu, Nov 09, 2023 at 12:31:45PM +0100, Lorenzo Bianconi wrote:
> [...]
> > >
> > > 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
We are fine then if ethtool get stats is under rntl.
I am testing on a clearfog base so is_stopped is set on my device.
Let me remove the check and also fix the variable order
and send a new version.
Best
Sven
>
> >
> > 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
> > > >
> >
> >
Powered by blists - more mailing lists