lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <YlQe8QysuyGRtxAx@lore-desk>
Date:   Mon, 11 Apr 2022 14:28:33 +0200
From:   Lorenzo Bianconi <lorenzo@...nel.org>
To:     Ilias Apalodimas <ilias.apalodimas@...aro.org>
Cc:     netdev@...r.kernel.org, lorenzo.bianconi@...hat.com,
        davem@...emloft.net, kuba@...nel.org, pabeni@...hat.com,
        thomas.petazzoni@...tlin.com, linux@...linux.org.uk,
        jbrouer@...hat.com, jdamato@...tly.com, andrew@...n.ch
Subject: Re: [PATCH v3 net-next 1/2] net: page_pool: introduce ethtool stats

> Hi Lorenzo,

Hi Ilias,

> 
> [...]
> 
> >
> >         for_each_possible_cpu(cpu) {
> >                 const struct page_pool_recycle_stats *pcpu =
> > @@ -66,6 +87,47 @@ bool page_pool_get_stats(struct page_pool *pool,
> >         return true;
> >  }
> >  EXPORT_SYMBOL(page_pool_get_stats);
> > +
> > +u8 *page_pool_ethtool_stats_get_strings(u8 *data)
> > +{
> > +       int i;
> > +
> > +       for (i = 0; i < ARRAY_SIZE(pp_stats); i++) {
> > +               memcpy(data, pp_stats[i], ETH_GSTRING_LEN);
> > +               data += ETH_GSTRING_LEN;
> > +       }
> > +
> > +       return data;
> 
> Is there a point returning data here or can we make this a void?

it is to add the capability to add more strings in the driver code after
running page_pool_ethtool_stats_get_strings.

> 
> > +}
> > +EXPORT_SYMBOL(page_pool_ethtool_stats_get_strings);
> > +
> > +int page_pool_ethtool_stats_get_count(void)
> > +{
> > +       return ARRAY_SIZE(pp_stats);
> > +}
> > +EXPORT_SYMBOL(page_pool_ethtool_stats_get_count);
> > +
> > +u64 *page_pool_ethtool_stats_get(u64 *data, struct page_pool_stats *stats)
> > +{
> > +       int i;
> > +
> > +       for (i = 0; i < ARRAY_SIZE(pp_stats); i++) {
> > +               *data++ = stats->alloc_stats.fast;
> > +               *data++ = stats->alloc_stats.slow;
> > +               *data++ = stats->alloc_stats.slow_high_order;
> > +               *data++ = stats->alloc_stats.empty;
> > +               *data++ = stats->alloc_stats.refill;
> > +               *data++ = stats->alloc_stats.waive;
> > +               *data++ = stats->recycle_stats.cached;
> > +               *data++ = stats->recycle_stats.cache_full;
> > +               *data++ = stats->recycle_stats.ring;
> > +               *data++ = stats->recycle_stats.ring_full;
> > +               *data++ = stats->recycle_stats.released_refcnt;
> > +       }
> > +
> > +       return data;
> 
> Ditto

same here.

Regards,
Lorenzo

> 
> > +}
> > +EXPORT_SYMBOL(page_pool_ethtool_stats_get);
> >  #else
> >  #define alloc_stat_inc(pool, __stat)
> >  #define recycle_stat_inc(pool, __stat)
> > --
> > 2.35.1
> >
> 
> Thanks
> /Ilias

Download attachment "signature.asc" of type "application/pgp-signature" (229 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ