[dpdk-dev] [PATCH v3 7/8] raw/ioat: add statistics functions
Bruce Richardson
bruce.richardson at intel.com
Mon Jul 1 14:56:53 CEST 2019
On Mon, Jul 01, 2019 at 11:11:20AM +0100, Pattan, Reshma wrote:
>
>
> > -----Original Message-----
> > From: dev [mailto:dev-bounces at dpdk.org] On Behalf Of Bruce Richardson
> > Sent: Thursday, June 27, 2019 11:41 AM
> > To: dev at dpdk.org
>
>
> <snip>
>
> > +static int
> > +ioat_xstats_get(const struct rte_rawdev *dev, const unsigned int ids[],
> > + uint64_t values[], unsigned int n)
> > +{
> > + const struct rte_ioat_rawdev *ioat = dev->dev_private;
> > + unsigned int i;
> > +
> > + for (i = 0; i < n; i++) {
> > + switch (ids[i]) {
> > + case 0: values[i] = ioat->enqueue_failed; break;
> > + case 1: values[i] = ioat->enqueued; break;
> > + case 2: values[i] = ioat->started; break;
> > + case 3: values[i] = ioat->completed; break;
> > + default: values[i] = 0; break;
> > + }
> > + }
> > + return n;
>
> Should this return n or how many actually filled ?
>
They should both be "n", since we never break out of the loop early.
/Bruce
More information about the dev
mailing list